Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • But if the library in question itself has shared libraries to look up, the rpath stored in the binary isn't applied recursively to the sub-library lookups. I haven't found a way around this other than setting LD_LIBRARY_PATH in the environment, which then does get applied to recursive lookups...
    – Ethan
    Commented May 27, 2017 at 18:56
  • @Ethan: True. But what's also true is that the usual scenarios where you want to "package" shared libraries for some binary, is one where you placed them all together; e.g. /opt/mypackage/bin/someBinary will need libs that you store in /opt/mypackage/lib/. Pretty much all proprietary SW installed under /opt follows this rule - which means that the way shown above will cover all such installs. They will then usually add also a symlink under /usr/bin that points to the binary under /opt - knowing that the "default search path" will find the .sos under the appropriate /opt/.../lib folder.
    – ttsiodras
    Commented May 28, 2017 at 20:08
  • yeah, in my case I was wanting to test a package by linking against its build directory rather than installing it... (but the package had several internal .so's with some inter-dependencies... variety of workarounds but just annoying)
    – Ethan
    Commented May 29, 2017 at 21:13