I’m building a ROS (Humble) workspace using ‘colcon build’.
I’m getting the warning:
CMake Warning at CMakeLists.txt:22 (add_executable):
Cannot generate a safe runtime search path for target talker because files
in some directories may conflict with libraries in implicit directories:
runtime library [libpython3.6m.so.1.0] in //lib64 may be hidden by files in:
/nobackup/XXXXXXX/vobs_ros2/ros2_lin64/Python36/lib
Some of these libraries may not be found correctly.
CMake Warning at CMakeLists.txt:25 (add_executable):
Cannot generate a safe runtime search path for target listener because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libpython3.6m.so.1.0] in //lib64 may be hidden by files in:
/nobackup/XXXXXXX/vobs_ros2/ros2_lin64/Python36/lib
Some of these libraries may not be found correctly.
I see libpython3.6m.so.1.0
is in lib64
and in the Python local version I installed with conda: /nobackup/XXXXXXX/vobs_ros2/ros2_lin64/Python36/lib
.
According to this post: CMake cannot resolve runtime directory path, setting CMAKE_PREFIX_PATH
should fix the problem. But even if I set COLCON_COMMON_ARGS="--cmake-args -DCMAKE_PREFIX_PATH=/nobackup/XXXXXXX/vobs_ros2/ros2_lin64/Python36"
, clean, remove CMakeCache.txt
and retry, warning is still shown.
What’s the good strategy to remove this warning?
Note: I printed CMAKE_PREFIX_PATH
from my CMakeLists.txt
to verify it’s set as expected. And I also tried with CMAKE_PREFIX_PATH=/nobackup/XXXXXXX/vobs_ros2/ros2_lin64/Python36/lib
.