Closed pojiro closed 2 years ago
Setting LD_LIBRARY_PATH
explicitly to the execution environment resolves this issue.
However, I have not been able to figure out why it needs to be set explicitly, even though able to reference other ROS so's.
Now I understand why this happend.
Failed to find library 'rmw_dds_common__rosidl_typesupport_fastrtps_cpp'
rosidl_typesupport did. following is the code
Who: rcpputils::find_library_path
caused by returning empty string.
Why: only search LD_LIBRARY_PATH env paths
ldd
doesn't show the so, rmw_dds_common__rosidl_typesupport_fastrtps_cpp?librmw_dds_common__rosidl_typesupport_fastrtps_cpp.so
is loaded by dlopen
.
below is the details
rcpputils::SharedLibrary
constractor
calls rcutils_load_shared_library
, then it
calls dlopen
.
Yes.
https://github.com/ros2/rcpputils/pull/122 has prompted improvements, but no action seems to have been taken yet.
Description
NOTE: I confirmed below on rpi4 Ubuntu focal too.
I crosscompiled ros2 foxy for rpi4, aarch64, buildroot linux, successfully. And I copied generated artifacts to target's /usr/lib and /usr/include, both of the pathes are recognized. Then I ran my binary(so) from erlang vm which uses rcl and got
Failed to find library 'rmw_dds_common__rosidl_typesupport_fastrtps_cpp'
log.I confirmed below,
librmw_dds_common__rosidl_typesupport_fastrtps_cpp.so
exists under/usr/lib
(is symlinked from /usr/lib64).so
is tried to be linked fromlibrmw_dds_common__rosidl_typesupport_fastrtps_c.so
andlibrmw_fastrtps_cpp.so
, confirmed bygrep
edlink.txt
under build_aarch64so
.Expected Behavior
can find the library
Actual Behavior
failed to find it.
To Reproduce
I simply croscompiled following,
System (please complete the following information)
For ROS 2 bugs - please attach a VCS.repos or Dockerfile if possible to help us reproduce the environment
Additional context
librmw_fastrtps_cpp.so relates code: https://github.com/ros2/rmw_fastrtps/blob/foxy/rmw_fastrtps_cpp/CMakeLists.txt#L107-L109