Rpath (linking)
From Wikipedia, the free encyclopedia
- For information on rPath, Inc. please see rPath.
- The correct title of this article is rpath. The initial letter is shown capitalized due to technical restrictions.
rpath is a term in computer science which refers to a runtime search path hardcoded in an executable file or library, used during dynamic linking to find the libraries and the executable file or library requires. It is inserted in the executable or library at link-time.
Specifically it encodes a path to shared libraries into the header of an executable (or another shared library). This RPATH header value (so named in the ELF header standards) may either over-ride or supplement the system default dynamic linking search path (as defined in /etc/ld.so.conf on Linux systems ... for example).
It can be thought of as a compile time alternative to the LD_LIBRARY_PATH environment setting. While LD_LIBRARY_PATH would have to be properly set in the environment of any process attempting to run a given program; the RPATH setting is compiled into that program's headers. (The primary disadvantage of use RPATH is that it over-rides the LD_LIBRARY_PATH settings which makes things like running a pre-compiled binary out of a user's home directory or some other non-default location difficult or impossible).