Boost C++ Libraries: Ticket #9350: boost does not use prefix for rpath https://svn.boost.org/trac10/ticket/9350 <p> How to reproduce: </p> <pre class="wiki">MY_PREFIX=/my/boost/target ./bootstrap.sh --prefix=$MY_PREFIX ./b2 -j 14 -d+2 address-model=64 install ldd $MY_PREFIX/lib/libboost_filesystem.so | grep boost libboost_system.so.1.54.0 =&gt; NOT FOUND </pre><p> I've observed this issue with Boost 1.52 (using the sun toolset - sun.jam) and with Boost 1.54 (using the gcc toolset - gcc.jam). </p> <p> It seems that boost sets the rpath to the build directory and not to the specified prefix (during link time). </p> <p> Expected results: </p> <p> ldd $MY_PREFIX/lib/libboost_filesystem.so | grep boost </p> <blockquote> <p> libboost_system.so.1.54.0 =&gt; $MY_PREFIX/lib/libboost_system.so.1.54.0 </p> </blockquote> <p> (note that I've picked libboost_filesystem as an example - other boost libraries have the same issue, e.g. chrono/log/time/...) </p> <p> Currently I use a dirty workaround to have the rpath set correctly: </p> <pre class="wiki">--- a/tools/build/v2/tools/gcc.jam +++ b/tools/build/v2/tools/gcc.jam @@ -945,7 +945,7 @@ rule link ( targets * : sources * : properties * ) actions link bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(&lt;)" $(START-GROUP) "$(&gt;)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(MY_PREFIX)/lib -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(&lt;)" $(START-GROUP) "$(&gt;)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } @@ -1011,7 +1011,7 @@ rule link.dll ( targets * : sources * : properties * ) # Differs from 'link' above only by -shared. actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) "$(.IMPLIB-COMMAND)$(&lt;[1])" -o "$(&lt;[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(&lt;[-1]:D=) -shared $(START-GROUP) "$(&gt;)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(MY_PREFIX)/lib "$(.IMPLIB-COMMAND)$(&lt;[1])" -o "$(&lt;[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(&lt;[-1]:D=) -shared $(START-GROUP) "$(&gt;)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } rule setup-threading ( targets * : sources * : properties * ) </pre><p> The workaround for <code>tools/build/v2/tools/sun.jam</code> is similar. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9350 Trac 1.4.3