On Mon, 1 Jun 2009, Kevin Cowtan wrote:

OK, I understand, RPATH bad.

But as far as I can tell we don't use RPATH. Coot uses LD_LIBRARY_PATH, which is only set by a wrapper script which launches the actual binary, and so the use of LD_LIBRARY_PATH is never exposed to the rest of the system (which I understand is the only problem with LD_LIBRARY_PATH).

Not quite: if your application starts a subprocess and runs something else, that subprocess will inherit LD_LIBRARY_PATH as set in the wrapper. That might be fatal for whatever you are running in the subprocess (unless it too is invoked from a wrapper that overrides/unsets LD_LIBRARY_PATH).

On the whole, I prefer to use rpath, because it makes it easier to harden an installation against the vagaries of what users have set in their environment - using an rpath like '$ORIGIN/../lib' to set a path relative to the location of the ELF can help with installation issues. OS X and Solaris both allow editing of the runpath inside an executable, so are streets ahead of Linux here.

Ezra Peisach wrote:
One of the other misfeatures of rpath is that it sets DT_RPATH and not
DT_RUNPATH  - which means that LD_LIBRARY_PATH will not override the

That depends on the version of ld - a modern version should set both. Use 'readelf -d' on your executables to check.

Regards,
Peter.

--
Peter Keller                                     Tel.: +44 (0)1223 353033
Global Phasing Ltd.,                             Fax.: +44 (0)1223 366889
Sheraton House,
Castle Park,
Cambridge CB3 0AX
United Kingdom

Reply via email to