Skip to main content
Welcome guest. | Register | Login | Post

Do GNU/Linux programs usually check local directory for libraries?

7 replies [Last post]
libervisco's picture
Offline
Joined: 2006-05-04

Slightly related to what I was saying here, this is a straightforward question.

I didn't compile very many programs myself so I'm wondering. How common is it for a program, once you compile it and have the binaries ready in the directory in which you ran "make", to check for libraries and dependencies in the current local path and not just paths like /usr/bin and /usr/libs.

The reason I am asking is because I have this idea of perhaps switching completely to Debian Stable, therefore getting a rock solid system, but still allowing myself to run the latest applications available from original developers by using something like Debian Backports OR, even better perhaps, compile my own software, put the resulting binaries and all their dependencies in a single archive and then uploading it for others to use.

People could then basically install those archives on pretty much any distribution - just decompress to /programs and run. I could make a script to add shortcuts to menus and/or /home/user/Desktop or a special shortcuts folder for easy access.

And if it works it could be a start of a new universal package format for ALL GNU/Linux. We could call it bin.tar.gz or something. Sticking out tongue Eventually we could even join together to build a whole repository of these kinds of packages which will work everywhere and have a special program for checking, fetching and installing them. Smiling

It's like source tarballs, except that they're binary tarballs.

Offline
Joined: 2006-03-28
You might use the

You might use the /usr/local-tree for this. I don't know how much you can split this off from the rest of the world, meaning that only your stuff in /usr/local looks for libraries in /usr/local, and the stuff in the system does not search for libraries there, but it might be an idea.

libervisco's picture
Offline
Joined: 2006-05-04
Hmm, by local I actually

Hmm, by local I actually meant that if I compile ProgramA within say /home/user/ProgramA and then compile some libraries elsewhere and drop them inside /home/user/ProgramA will the binary that is in that directory find the libraries in the same directory or does it usually only look for stuff in the traditional UNIX path?

Thanks

Offline
Joined: 2006-03-28
You may need to supply

You may need to supply LD_LIBRARY_PATH when starting the program, but then it should work.
It's been quite some time since I last played around with that.

libervisco's picture
Offline
Joined: 2006-05-04
I see, might try that then

I see, might try that then when I experiment with this. I'm possibly gonna switch to Lenny (the soon to be new Debian Stable, hence having a solid core) and then try building some newest stuff I want that way.

Thanks

Offline
Joined: 2006-03-28
I just found something that

I just found something that might be useful for you.
I was browsing through the Fedora-repository (actually I was looking if checkinstall is available, which it isn't...) and found Zero Install Injector, which may just be what you are looking for.
It installs stuff in a local cache, without the necessity of being root and without messing up stuff under /usr or /usr/local
It even downloads dependencies and puts them into the cache.

From what I read it's also possible to have different versions of programs/libraries inside that cache. I guess every application will be sort of sandboxed in it's own little directory with all the libraries needed.

libervisco's picture
Offline
Joined: 2006-05-04
Sounds pretty cool. I'll

Sounds pretty cool. I'll keep it in mind if I encounter something not available in Ubuntu (intrepid) which I'm using now (installed with LVM and bottom up using a minicd Smiling ).

I heard of Zero before, but didn't really look much into it. That was a while ago when i was using Slackware. Laughing out loud

Thanks

Offline
Joined: 2007-09-10
Quote: Do GNU/Linux
Quote:

Do GNU/Linux programs usually check local directory for libraries?

No, they don't.

But here's what you can do to simplify your life:
Add this line to your ~/.bashrc:
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.