[gmx-developers] Library search path: Rpath - Runpath

Roland Schulz roland at utk.edu
Mon Jun 21 03:18:07 CEST 2010


Hi,

I just noticed it isn't possible to overwrite where the GROMACS binaries
search for their shared libraries (after they have been installed). The
reason is that the library search path is encoded as the rpath. And the
libraries are searched in the order:

RPATH
LD_LIBRARY_PATH
RUNPATH

Thus GROMACS binaries (have an rpath specified) always search the rpath
first before the LD_LIBRARY_PATH is searched. By encoding the library path
in the runpath instead it is still possible to overwrite it by setting the
LD_LIBRARY_PATH. This can be done by at compile time by running ld with
the --enable-new-dtags.

Is there a reason why we don't run ld with --enable-new-dtags? I think it
would be preferable if it is still possible to overwrite the path
with LD_LIBRARY_PATH.
One can get this by manually adding "-Wl,--enable-new-dtags" to LDFLAGS but
I think it would be better if it is the default.

For information of why enable-new-dtags is better and the different of rpath
and runpath, see:
http://blog.devork.be/2009/02/specifying-runpath-in-sofiles.html
http://hackage.haskell.org/trac/ghc/wiki/SharedLibraries/Management

Roland
-- 
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20100620/effa93be/attachment.html>


More information about the gromacs.org_gmx-developers mailing list