LD_LIBRARY_PATH

jdavidb on 2008-01-08T19:19:34

I've previously linked to David Barr's fine article about LD_LIBRARY_PATH, which explains why you should never be using this variable. Unfortunately, awhile back it disappeared.

Thankfully, it has reappeared, and I thought I'd save some links to other helpful articles on the subject. It seems to finally be getting some attention.


not quite so

jhi on 2008-01-09T02:04:02

> LD_LIBRARY_PATH, which explains why you should never be using this variable

That's not what he said, read again. There are still legitimate uses for LD_LIBRARY_PATH (and its moral equivalents, not all platforms call it that). For example, Perl's build process uses that for a very good reason.

Re:not quite so

jdavidb on 2008-01-09T14:02:57

When I said "you" should never be using this variable, I meant the average person reading what I was writing. :) People who've done heavy hacking on Perl's build process have a high probability of running into the legitimate use cases for it, and I knew that. :)

Basically, if the developers of a package do their job right, and know what LD_LIBRARY_PATH is for and what it is not for, the end user should almost never, ever have to use it. If I purchase a huge commercial package like, say, Oracle, and have to set LD_LIBRARY_PATH to use it, the developers of that package have not done their job right. Likewise if I compile all the pieces of GNOME from scratch and put it in a non-standard location.

Re:not quite so

Mr. Muskrat on 2008-01-09T15:42:47

I've always wondered why some versions of Oracle had it set to something and others didn't. I don't recall needing it for 10.1.0.3 but during the 10.2.0.x installation it gets set. Now that I think about it, it may just been the DBAs that tweaked our installation scripts.

Re:not quite so

jdavidb on 2008-01-09T17:41:09

Let me also amplify that not only should a user never set LD_LIBRARY_PATH, it should never be set for him.

LD_LIBRARY_PATH is a developer-only variable. It's a test-time option, not a run-time option. Unfortunately due to many developers who don't know what they're doing, it becomes a necessary run-time option for some apps. But even then it should only be used as a method of last resort to get them running!

Re:not quite so

jhi on 2008-01-10T13:46:59

I have to remember that I'm not included in "you" :-)