introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
957 stars 556 forks source link

Undefined references to curl symbols when building RTABMap in ROS 2 #1204

Closed Anchor1566 closed 1 week ago

Anchor1566 commented 2 weeks ago

Description:

Hi,

I am encountering an issue while building RTABMap for ROS 2 humble. The error occurs during the colcon build step and appears to be related to missing symbols from the libcurl library that are required by GDAL libraries.

Here are the steps I followed to reproduce the issue:

cd ~/ros2_ws
git clone https://github.com/introlab/rtabmap.git src/rtabmap
git clone --branch ros2 https://github.com/introlab/rtabmap_ros.git src/rtabmap_ros
rosdep update && rosdep install --from-paths src --ignore-src -r -y
export MAKEFLAGS="-j6" # Can be ignored if you have a lot of RAM (>16GB)
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release

ERROR

AKE_BUILD_TYPE=Release
Starting >>> rtabmap 
Starting >>> rtabmap_msgs
Starting >>> rtabmap_python
--- stderr: rtabmap_python                                       
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< rtabmap_python [1.18s]
Finished <<< rtabmap_msgs [3.32s]                                
[Processing: rtabmap]                              
[Processing: rtabmap]                                      
[Processing: rtabmap]                                        
--- stderr: rtabmap                                          
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_multi_cleanup@CURL_OPENSSL_4'
/usr/bin/ld: /lib/x86_64-linux-gnu/libnetcdf.so.19: undefined reference to `curl_global_init@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_multi_info_read@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_mime_free@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_easy_cleanup@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_mime_data_cb@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_easy_init@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_multi_poll@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_version@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_multi_setopt@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_mime_data@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_multi_wait@CURL_OPENSSL_4'
/usr/bin/ld: /lib/x86_64-linux-gnu/libnetcdf.so.19: undefined reference to `curl_global_cleanup@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_easy_getinfo@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_multi_perform@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_mime_init@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_multi_remove_handle@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_mime_addpart@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_version_info@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_mime_name@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_mime_filename@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_easy_setopt@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_easy_perform@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_multi_add_handle@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_slist_free_all@CURL_OPENSSL_4'
/usr/bin/ld: /lib/x86_64-linux-gnu/libnetcdf.so.19: undefined reference to `curl_easy_strerror@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_slist_append@CURL_OPENSSL_4'
/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `curl_multi_init@CURL_OPENSSL_4'
collect2: error: ld returned 1 exit status
gmake[2]: *** [tools/EurocDataset/CMakeFiles/euroc_dataset.dir/build.make:190: bin/rtabmap-euroc_dataset] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1193: tools/EurocDataset/CMakeFiles/euroc_dataset.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:156: all] Error 2
---
Failed   <<< rtabmap [1min 41s, exited with code 2]

Summary: 2 packages finished [1min 41s]
  1 package failed: rtabmap
  2 packages had stderr output: rtabmap rtabmap_python
  11 packages not processed
matlabbe commented 1 week ago

Similar issue here https://github.com/stella-cv/stella_vslam_ros/discussions/174

What is your machine? jetpack? libgdal.so is not used by rtabmap directly, it is coming from one of the dependence.

One person suggested here to do:

sudo ldconfig
Anchor1566 commented 1 week ago

Similar issue here stella-cv/stella_vslam_ros#174

What is your machine? jetpack? libgdal.so is not used by rtabmap directly, it is coming from one of the dependence.

One person suggested here to do:

sudo ldconfig

Thank you for your assistance and for taking the time to help resolve this issue! I'm pleased to report that the problem has been resolved on my end. I was using Ubuntu 22.04 but experiencing errors when attempting to use colcon build with a conda virtual environment. However, after deactivating the conda environment (conda deactivate), the compilation process proceeded successfully.