ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org

# Cannot compile Electric from source against boost 1.46.1

Hello,

I am using Ubuntu 10.04 and trying to recompile ROS Electric from source against boost version 1.46.1 (needed for my libraries). The default version used by ROS is 1.40.

The problem is somewhat related to this one but I have already tried to edit the boost versions and paths in my bashrc as shown, with no success.

The build output can be seen here: http://pastebin.com/R5TSA3kE

It seems that it cannot recognize the boost. But how is this possible? I have already verified that boost version 1.46.1 is installed in /usr/local.

edit: I have opened a defect ticket, but I am not sure if this error is reproducible since another user have already compiled Electric against 1.46.1. I am still looking for an answer in the ROS CMakeFiles. Setting verbose=1 I found out that the actual command does only includes the thread and signals libraries from boost, but not the filesystem or system:

Linking CXX executable ../rosout
/usr/bin/c++ -O2 -g -Wl,-rpath,/home/caris/ros/ros_comm/clients/cpp/roscpp/lib -Wl,-rpath,/home/caris/ros/ros_comm/clients/cpp/roscpp_serialization/lib -Wl,-rpath,/home/caris/ros/ros_comm/utilities/xmlrpcpp/lib -Wl,-rpath,/home/caris/ros/ros_comm/tools/rosconsole/lib -Wl,-rpath,/home/caris/ros/ros/core/roslib/lib -Wl,-rpath,/home/caris/ros/ros_comm/tools/rosconsole/lib -Wl,-rpath,/home/caris/ros/ros_comm/utilities/rostime/lib -Wl,-rpath,/home/caris/ros/ros_comm/utilities/cpp_common/lib -Wl,-rpath,/home/caris/ros/ros/core/roslib/lib -Wl,-rpath,/home/caris/ros/ros/tools/rospack/lib -pthread CMakeFiles/rosout.dir/rosout.o -o ../rosout -rdynamic -L/home/caris/ros/ros_comm/clients/cpp/roscpp/lib -L/home/caris/ros/ros_comm/clients/cpp/roscpp_serialization/lib -L/home/caris/ros/ros_comm/utilities/xmlrpcpp/lib -L/home/caris/ros/ros_comm/tools/rosconsole/lib -L/home/caris/ros/ros/core/roslib/lib -L/home/caris/ros/ros_comm/utilities/rostime/lib -L/home/caris/ros/ros_comm/utilities/cpp_common/lib -L/home/caris/ros/ros/tools/rospack/lib -lros -lboost_signals -lroscpp_serialization -lXmlRpc -lrosconsole -lboost_thread -llog4cxx -lrostime -lcpp_common -lroslib -lrospack -lrosstack -Wl,-rpath,/home/caris/ros/ros_comm/clients/cpp/roscpp/lib:/home/caris/ros/ros_comm/clients/cpp/roscpp_serialization/lib:/home/caris/ros/ros_comm/utilities/xmlrpcpp/lib:/home/caris/ros/ros_comm/tools/rosconsole/lib:/home/caris/ros/ros/core/roslib/lib:/home/caris/ros/ros_comm/utilities/rostime/lib:/home/caris/ros/ros_comm/utilities/cpp_common/lib:/home/caris/ros/ros/tools/rospack/lib

As we can see there are no -lboost_filesystem or -lboost_system flags, which could explain the errors.

But my question is: where can I set these flags? I have already made sure that my CMakeLists.txt from libros has this exact line:

rosbuild_link_boost(ros thread signals filesystem system)


which, in my point of view, should include all the pre-mentioned libraries.

edit retag close merge delete

Are you setting $ROS_BOOST_VERSION? ( 2012-08-30 17:06:23 -0600 )edit Yes, I am. I have edited my .bashrc in order to take into account for the new changes, by including these lines: export ROS_BOOST_ROOT="/usr/local/" export ROS_BOOST_VERSION="1.46.1" ( 2012-08-31 09:19:29 -0600 )edit ## 2 Answers Sort by » oldest newest most voted Ok. It seems there is a way to trick ROS CMakeFiles, since it seems that rosbuild isn't linking the libraries properly. I added: find_package(Boost 1.46.1 COMPONENTS thread signals filesystem system) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS})
endif()


in the file: ~/ros/ros_comm/clients/cpp/roscpp/src/libros/CMakeLists.txt

That allowed me to go past the compilation. There is a similar problem with rosbag CMakeLists.txt as well, but the same applies. This is probably a bug and hopefully it will be fixed.

Unfortunately it doesn't seem this is the end since I have another issue, this time with roscore. But this will be the subject for another question.

more

This is probably a bug.

Since you are using Electric, please open a defect ticket for the rosbuild component, with a link to this question.

more