Ask Your Question

boost path when cross compiling

asked 2012-01-09 13:28:19 -0500

dougnets22 gravatar image

When cross-compiling for the Nao in should the boost path be set to the system's boost directory (i.e. /usr) or to some directory local to the location of the cross-compilation (i.e. /media/external/ros/electric/ros...)? If the latter, where should I be setting the path?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2012-01-09 22:53:20 -0500

Stefan Osswald gravatar image

Alternatively, you could set the ROS_BOOST_ROOT and ROS_BOOST_VERSION environment variables:

// for naoqi 1.10.xx
export ROS_BOOST_ROOT="${CTC_DIR}/staging/geode-linux/usr"    
export ROS_BOOST_VERSION="1.38.0"

// for naoqi 1.12
export ROS_BOOST_ROOT="${CTC_DIR}/sysroot/usr"
export ROS_BOOST_VERSION="1.45.0"

Make sure that the version variable matches the boost library version in your cross-compilation toolchain and that

rosboost-cfg --lib_dir

actually returns the correct directory containing the boost libraries.

edit flag offensive delete link more

answered 2012-01-09 17:51:42 -0500

Daniel Stonier gravatar image

If you're cross compiling you absolutely don't want to use your natively compiled boost directories - i.e. do not use /usr!

You need to look for where your cross compiled boost libs are actually installed - usually this will be inside your toolchain. I notice from the wiki page you link to the instructions:

cp -r $CTC_USR_DIR/lib/libboost* $TARGETDIR/libs/

The short of it - $TARGETDIR/libs should be what he's attaching to LD_LIBRARY_PATH in to find boosts's libs. Just make sure it's empty to begin with (notice the export LD_LIBRARY_PATH= # just to be sure just above) otherwise it will pick up your native libs. Is there another variable you are trying to set to help with boost?

Actually, hacking it this way is a bit ugly - cmake would be much better here.

For more details:

If you want to be absolutely sure you have the libs, have a look in $TARGETDIR/libs/. You should see libboost*.so in there. You can actually check that they're cross compiled by running file on the command - e.g. in my arm toolchain:

file ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped
edit flag offensive delete link more

answered 2012-07-23 18:57:55 -0500

ryann2k1 gravatar image

Hi, Thanks for the posting. Helped me move to the next stage of my installation for ros nao. But I come accross another problem which is missing tf in my ros compilation as my post at Anyone please can direct the problem? Thank you

edit flag offensive delete link more


Please don't write a question or comment as "answer" to the original question. Either post a comment or open a new question.

AHornung gravatar image AHornung  ( 2012-07-23 22:43:25 -0500 )edit

I am sorry about that

ryann2k1 gravatar image ryann2k1  ( 2012-07-24 15:39:47 -0500 )edit

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: 2012-01-09 13:28:19 -0500

Seen: 873 times

Last updated: Jul 23 '12