Ask Your Question

rospack ends with "rosboost_cfg.rosboost_cfg.BoostError"

asked 2011-09-08 11:34:28 -0500

130s gravatar image

updated 2011-09-13 06:06:47 -0500

While I'm trying to build the stack someone made 2 years ago, I started having this error since a week ago and haven't been able to remove it.

% rospack libs-only-L --deps-only packageA
Traceback (most recent call last):
  File "/opt/ros/diamondback/ros/bin/rosboost-cfg", line 35, in <module>
  File "/opt/ros/diamondback/ros/tools/rosboost_cfg/src/rosboost_cfg/", line 359, in main
    output = lflags(ver, options.lflags.split(','))
  File "/opt/ros/diamondback/ros/tools/rosboost_cfg/src/rosboost_cfg/", line 276, in lflags
    print >> s, lib_flags(ver, lib),
  File "/opt/ros/diamondback/ros/tools/rosboost_cfg/src/rosboost_cfg/", line 265, in lib_flags
    lib = find_lib(ver, name)
  File "/opt/ros/diamondback/ros/tools/rosboost_cfg/src/rosboost_cfg/", line 246, in find_lib
    raise BoostError('Could not locate library [%s] in lib directory [%s]'%(name, dir))
rosboost_cfg.rosboost_cfg.BoostError: 'Could not locate library [math] in lib directory [/usr/lib]'
[rospack] warning: got non-zero exit status from executing backquote expression "ret="-Wl,-rpath,/home/ros-user/Documents/Workspace_Eclipse/packageA/crowdnav_common/lib -L/home/ros-user/Documents/Workspace_Eclipse/packageA/crowdnav_common/lib -lcrowdnav_common `rosboost-cfg --lflags math,signals,thread`" && echo $ret" in [/home/ros-user/Documents/Workspace_Eclipse/packageA/crowdnav_common/manifest.xml]
[rospack] error in backquote expansion for packageA

I can't detect where this package designates the "math" library, nor from where is called (seems like rospack.cpp doesn't call it).

Env) Ubuntu 10.10, diamondback/electric (same under either distribution)


Update 9/9/2011) In response to the suggestion, I checked libboost-math-dev which I found is already installed as follows:


But the error log indicates it searched /usr/lib. Any way to modify/add the search path? I looked at where I couldn't find one.

Update 9/9/2011 #2)

In /usr/lib, many libboost_math* files are found, which seems to correspond to the files of libboost_math-dev (note that incl. underscore) that is defined in ubuntu's web site.

Update 9/13/2011)

Modifying as bypassed the error. However, since I haven't regression tested, side effect might occur.

edit retag flag offensive close merge delete


Libraries gets installed to /usr/lib. Check whether you have the boost math library: `ls /usr/lib/libboost_math*`.
Brian Gerkey gravatar image Brian Gerkey  ( 2011-09-09 05:19:11 -0500 )edit
@Brian Gerkey as the link of the pastebin I put shows, libboost_math files are there. Is it possibly because the rospack's option used is -libs-only-L so that that files starting with lower l are ignored? If that's the case, how can I configure to accept lower l files...
130s gravatar image 130s  ( 2011-09-09 09:38:27 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2011-09-08 16:19:51 -0500

Brian Gerkey gravatar image

updated 2011-09-09 09:56:47 -0500

I'm able to replicate your problem (see below for more). The first I would try is removing math from the call to rosbuild_link_boost() in the package's CMakeLists.txt. Perhaps you don't really need boost.math.

The way to debug this is to call rosboost-cfg directly, e.g.:

rosboost-cfg --libs math,signals,thread

Or even more specifically:

rosboost-cfg --libs math

On both OSX and Ubuntu 10.04, the above query for the boost.math library fails. It seems that the naming scheme on the boost.math library is different from the other boost libraries, causing rosboost-cfg's pattern match not to work. There's probably a patch to made to rosboost-cfg, around line 211.

edit flag offensive delete link more


@Brian Gerkey Modifying the code as you pointed out bypassed the error. I added the change in the body above, and also submitted a ticket (for the 1st time so not sure if I follow the tickt submission rule though) . Thanks!
130s gravatar image 130s  ( 2011-09-13 06:01:52 -0500 )edit

answered 2014-02-16 21:41:16 -0500

veger gravatar image

updated 2014-02-18 21:41:05 -0500

On my 64-bit Ubuntu (13.10), the boost libraries are installed in /usr/lib/x86-64-linux-gnu, so rosboost-cfg needs to be made aware of this by setting ROS_BOOST_LIB_DIR_NAME like this:

ROS_BOOST_LIB_DIR_NAME=/usr/lib/x86_64-linux-gnu/ rosboost-cfg --libs thread

and it is able to find the boost libraries again. You can of course also set the environment variable, if you do not want to add the ROS_BOOST_LIB_DIR_NAME all the time:

export ROS_BOOST_LIB_DIR_NAME=/usr/lib/x86_64-linux-gnu/
rosboost-cfg --libs thread
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-09-08 11:34:28 -0500

Seen: 888 times

Last updated: Feb 18 '14