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

Cannot compile Electric from source against boost 1.46.1

asked 2012-08-30 14:02:14 -0500

agoto gravatar image

updated 2012-09-04 15:06:05 -0500

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.

Thanks in advance.

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/cmake -E cmake_link_script CMakeFiles/rosout.dir/link.txt --verbose=1
/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 flag offensive close merge delete

Comments

Are you setting $ROS_BOOST_VERSION?

joq gravatar image joq  ( 2012-08-30 17:06:23 -0500 )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"

agoto gravatar image agoto  ( 2012-08-31 09:19:29 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-09-07 12:08:33 -0500

agoto gravatar image

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})
    target_link_libraries(ros ${Boost_LIBRARIES})
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.

edit flag offensive delete link more
0

answered 2012-08-31 09:43:16 -0500

joq gravatar image

updated 2012-08-31 09:46:28 -0500

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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-08-30 14:02:14 -0500

Seen: 259 times

Last updated: Sep 07 '12