Two versions of liboctomap installed by ros-melodic-moveit

asked 2019-11-05 08:26:58 -0600

jmainpri gravatar image

updated 2019-11-11 10:39:23 -0600

gvdhoorn gravatar image

After installing moveit on 18.04

sudo apt install ros-melodic-moveit

I have the following

/opt/ros/melodic/lib/liboctomap.so.1.9
/usr/lib/liboctomap.so.1.8

Is this intended or is this a bug? Does anyone know an efficient way to know which version does moveit_core links against?

I depend on also on dart, which links with 1.8.


Edit: More precisions after gvdhoorm's comment:

I devellop libsigned_distance_field.so, which relies on a library using dart, which links to octomap 1.8 and I currently get :

ldd devel/lib/libsigned_distance_field.so | grep octomap
liboctomap.so.1.9 => /opt/ros/melodic/lib/liboctomap.so.1.9 (0x00007f5e43f9c000)
liboctomap.so.1.8 => /usr/lib/liboctomap.so.1.8 (0x00007f5e341bb000)

And I can not figure out how the linker picked up liboctomap.so.1.9 since all the dependencies that I can see use only 1.8.

Is there a way to know how the libraries are chosen at linking time?

In the CMakeLists.txt I have

add_library(${PROJECT_NAME} SHARED ${LIB_SOURCES} ${INC_SIGNED_DISTANCE_FIELD})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})

When I print catkin_LIBRARIES : No mention of liboctomap at all At link time with VERBOSE=1 it suddenly appears and it points to 1.9.

Does anyone know how I can prevent 1.9 from being passed to the linker?

edit retag flag offensive close merge delete

Comments

Does anyone know an efficient way to know which version does moveit_core links against?

Run ldd against binaries and it should tell you which libraries it has linked against.

But I predict it's going to be liboctomap.so.1.9, unless there is no path hardcoded in the binary and /usr/lib appears before /opt/ros/melodic/lib on the linker search path and sonames are not used when linking.

gvdhoorn gravatar image gvdhoorn  ( 2019-11-05 11:24:30 -0600 )edit