# rospack ends with "rosboost_cfg.rosboost_cfg.BoostError"

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>
rosboost_cfg.main()
File "/opt/ros/diamondback/ros/tools/rosboost_cfg/src/rosboost_cfg/rosboost_cfg.py", line 359, in main
output = lflags(ver, options.lflags.split(','))
File "/opt/ros/diamondback/ros/tools/rosboost_cfg/src/rosboost_cfg/rosboost_cfg.py", line 276, in lflags
print >> s, lib_flags(ver, lib),
File "/opt/ros/diamondback/ros/tools/rosboost_cfg/src/rosboost_cfg/rosboost_cfg.py", line 265, in lib_flags
lib = find_lib(ver, name)
File "/opt/ros/diamondback/ros/tools/rosboost_cfg/src/rosboost_cfg/rosboost_cfg.py", 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 rosboost_cfg.py is called (seems like rospack.cpp doesn't call it).

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

Thanks.

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

/usr/share/doc/libboost-math1.42-dev
/usr/share/doc/libboost-math1.42.0
/usr/share/doc/libboost-math-dev
/usr/share/lintian/overrides/libboost-math1.42.0


But the error log indicates it searched /usr/lib. Any way to modify/add the search path? I looked at rosboost_cfg.py 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 rosboost_cfg.py as https://code.ros.org/trac/ros/attachment/ticket/3671/rosboost_cfg.py.20110912.diff bypassed the error. However, since I haven't regression tested, side effect might occur.

edit retag close merge delete

Libraries gets installed to /usr/lib. Check whether you have the boost math library: ls /usr/lib/libboost_math*.
( 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...
( 2011-09-09 09:38:27 -0500 )edit

Sort by » oldest newest most voted

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.

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) http://goo.gl/lgjbr . Thanks!
( 2011-09-13 06:01:52 -0500 )edit

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/

more