ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Why cmake is looking for default Boost version?

asked 2023-02-07 08:48:56 -0500

bhomaidan gravatar image

updated 2023-02-07 09:13:47 -0500

gvdhoorn gravatar image

I have installed latest Boost library 1.80.0 from source on Ubuntu 20.04, then I tried to install the abb_robot_driver, but I have got this Error:

 Errors     << abb_robot_cpp_utilities:make /home/belal/ros1_ws/pacbot_ws/logs/abb_robot_cpp_utilities/build.make.000.log                                                    
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.71.0', needed by '/home/belal/ros1_ws/pacbot_ws/devel/.private/abb_robot_cpp_utilities/lib/libabb_robot_cpp_utilities.so'.  
Stop.

Can you please tell me how can I tell CMake and Catkin that My Boost is 1.81.0 and not the default 1.71.0, and my libraries folder is /usr/local/lib/ and not /usr/lib/x86_64-linux-gnu/? thanks in advance.

Note that I have added export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib to my ~/.bashrc and I have already done $ sudo ldconfig.

edit retag flag offensive close merge delete

Comments

1

I've updated the title of your question, as this is a CMake question. Catkin is not involved.

gvdhoorn gravatar image gvdhoorn  ( 2023-02-07 09:14:17 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-02-07 09:13:21 -0500

gvdhoorn gravatar image

updated 2023-02-07 09:16:53 -0500

Setting LD_LIBRARY_PATH will likely not do anything. That's a runtime setting.

This is purely a "CMake thing". According to the FindBoost.cmake documentation:

This module reads hints about search locations from variables:

  • BOOST_ROOT, BOOSTROOT

    Preferred installation prefix.

You should be able to do something like:

catkin_make [all your other args] --cmake-args -DBOOST_ROOT:PATHNAME=/path/to/your/boost

This might or might not work, depending on whether the package(s) you're trying to build are the first to look for Boost. If one of the dependencies have already done that, and the result gets cached or exported, your dependents will most likely not evaluate FindBoost again, leading to your BOOST_ROOT being ignored.

But in all cases: please be aware that mixing different Boost versions is fraught with potential problems.

Mostly SEGFAULTs.

You cannot link a ROS node to multiple versions of Boost, which is what will happen when you link abb_robot_driver's nodes against roscpp (which it must) and your custom Boost version.

Unless you've built the whole of your ROS Noetic from source with that specific Boost version, I wouldn't recommend doing what you're trying to do.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-02-07 08:48:56 -0500

Seen: 622 times

Last updated: Feb 07 '23