How to make Boost use rpath?

I need to create a Boost outside the "normal" directory tree (i.e. /custom/dir instead of /usr ), which is not so much: just go --prefix=/custom/path to ./runscript.sh / ./bjam and there you go.

Or so I thought.

The problem is that some Boost libraries are dependent on each other, and - using the default build process that goes through ./bootstrap.sh / ./bjam - it seems that the --prefix path is not added to the library search path for Boost libs, those. no -Wl,-rpath . This means that Boost libraries, depending on other Boost libraries, cannot find them at runtime.

My application linking those /custom/path Boost libraries is no longer running at the ./configure stage because libboost_filesystem.so cannot find libboost_system.so , although I passed -Wl,-rpath=/custom/path/boost/lib to my own compiler line (i.e. the correct path to Boost libs, I double checked that libboost_system.so is there).

Now, to avoid heavy methods such as setting LD_LIBRARY_PATH , I would like to create Boost so that all Boost libraries have the correct search path for other Boost collections compiled into them. However, I could not find the correct procedure for this. Can anybody help me?

+6
boost bjam boost-bjam
source share
1 answer

You can add compiler options and links during build from the command line with:

 bjam dll-path=/custom/path 

There is a FAQ section in the Boost Build docs about this (see BBv2 docs ).

+5
source share