Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lib search path

0 views
Skip to first unread message

Cypher

unread,
May 23, 2001, 2:01:51 PM5/23/01
to
Hi,
I've downloaded some free software from sunfreeware.com, installed it in
/usr/local (which has been created by new) and now I'd like to add
/usr/local/lib to the LIBSEARCHPATH.
I know I've to ise crle to create a /var/ld/ld.config file with -l
parameter, but how to maintain in the search path also traditional lib
directories like /usr/lib?
I see also that some applications like those placed by the Solaris
installer in /opt/sfw has the same problem, their lib dirs are not
shared to the system, but why?
For bin and man directories there are no problems as I've add them into
my .profile file.

Thank you

Eric Dennis

unread,
May 24, 2001, 3:05:37 AM5/24/01
to
In article <3B0BFB0F...@tiscalinet.it>, "Cypher"
<cyp...@tiscalinet.it> wrote:

You can accomplish this by setting the LD_LIBRARY_PATH environment
variable to /usr/local/lib in your .profile file. This environment
variable supplements the default paths ld uses to search for libraries
(in other words, it does *not* override the default path).

See the man pages for ld and ld.so.1 for more information. Good luck!

--
Eric Dennis
http://www.ericdennis.com

Aleksandar Milivojevic

unread,
May 24, 2001, 4:37:10 AM5/24/01
to
Eric Dennis (m...@spammers.go.away.ericdennis.com) wrote:
> You can accomplish this by setting the LD_LIBRARY_PATH environment
> variable to /usr/local/lib in your .profile file. This environment
> variable supplements the default paths ld uses to search for libraries
> (in other words, it does *not* override the default path).

Is is a BAD THING to advice newbies to use LD_LIBRARY_PATH. He should
link programs using -R/usr/local/lib (for exapmple) option so that
path to librires is encoded into executable.

Anyhow, LD_LIBRARY_PATH does not work for setuid root programs, so he
will need to do the right thing anyway from time to time.

--
Aleksandar Milivojević <al...@fly.srk.fer.hr>
Opinions expressed herein are my own.
Statements included here may be fiction rather than truth.

Philip Brown

unread,
May 24, 2001, 11:05:03 AM5/24/01
to
On 24 May 2001 10:37:10 +0200, al...@fly.srk.fer.hr wrote:
>...

>Is is a BAD THING to advice newbies to use LD_LIBRARY_PATH. He should
>link programs using -R/usr/local/lib (for exapmple) option so that
>path to librires is encoded into executable.

However, getting some programs to compile correctly with -R, is much more
difficult than doing

export LD_LIBRARY_PATH=/usr/lib:/opt/sfw/lib:/usr/local/lib

once.

So I would say that setting LD_LIBRARY_PATH *is* for newbies, not the other
way around.

>Anyhow, LD_LIBRARY_PATH does not work for setuid root programs, so he
>will need to do the right thing anyway from time to time.

true

--
[Trim the no-bots from my address to reply to me by email!]
[ Do NOT email-CC me on posts. Pick one or the other.]
S.1618 http://thomas.loc.gov/cgi-bin/bdquery/z?d105:SN01618:@@@D
The word of the day is mispergitude

John D Groenveld

unread,
May 24, 2001, 11:52:34 AM5/24/01
to
In article <slrn9gq8ou....@shell3.ba.best.com>,

Philip Brown <phi...@bolthole.no-bots.com> wrote:
>However, getting some programs to compile correctly with -R, is much more
>difficult than doing
Then perhaps they shouldn't be building software.

Hey, its easier to just run "xhost +" but we all acknowledge that some
quick and easy hacks are just a bad idea.

Good system administration practices should be shouted from the rooftops,
bad ones should be left for Microsoft Press books.
John
groe...@acm.org

Drazen Kacar

unread,
May 24, 2001, 1:07:23 PM5/24/01
to
Philip Brown wrote:

> However, getting some programs to compile correctly with -R, is much more
> difficult than doing
>
> export LD_LIBRARY_PATH=/usr/lib:/opt/sfw/lib:/usr/local/lib
>
> once.

/usr/lib in front of others?

> So I would say that setting LD_LIBRARY_PATH *is* for newbies, not the other
> way around.

You can set LD_OPTIONS=-R/opt/sfw/lib:/usr/local/lib once.

> >Anyhow, LD_LIBRARY_PATH does not work for setuid root programs, so he
> >will need to do the right thing anyway from time to time.
>
> true

Mmm. You can use crle to make it work. Not that I would advise that, but
it's sometimes necessary with binary crap.

--
.-. .-. Sarcasm is just one more service we offer.
(_ \ / _)
| da...@arsdigita.com
|

Philip Brown

unread,
May 24, 2001, 2:29:50 PM5/24/01
to
On Thu, 24 May 2001 17:07:23 +0000 (UTC), da...@arsdigita.com wrote:
>...

>You can set LD_OPTIONS=-R/opt/sfw/lib:/usr/local/lib once.
>

interesting. havent heard of that one before. At what level does it work
at?
(EG: what programs/libraries pay attention to it?)

Drazen Kacar

unread,
May 24, 2001, 2:35:24 PM5/24/01
to
Philip Brown wrote:
> On Thu, 24 May 2001 17:07:23 +0000 (UTC), da...@arsdigita.com wrote:
> >...
> >You can set LD_OPTIONS=-R/opt/sfw/lib:/usr/local/lib once.
>
> interesting. havent heard of that one before. At what level does it work
> at?
> (EG: what programs/libraries pay attention to it?)

The ld(1) utility. It bypasses all the crap that you (and me) don't like
and kindly asks linker to use this flag. It's a kind of magic. :-)

Philip Brown

unread,
May 25, 2001, 1:57:33 AM5/25/01
to
On Thu, 24 May 2001 18:35:24 +0000 (UTC), da...@arsdigita.com wrote:
>Philip Brown wrote:
>> On Thu, 24 May 2001 17:07:23 +0000 (UTC), da...@arsdigita.com wrote:
>> >...
>> >You can set LD_OPTIONS=-R/opt/sfw/lib:/usr/local/lib once.
>> ..
>
>[for the ...] ld(1) utility. It bypasses all the crap that you (and me)
>don't like ,and kindly asks linker to use this flag. It's a kind of magic. :-)

ooOOoooo.....

And its an environment var, so it doesnt matter what the hell some ung-dly
"open" sourcer did with their makefile. I *LIKE*.

Hmmm. Seems like "LD_RUN_PATH" is the more specific -R permutation
of this method. Although if there is an -R set, that overrides.
Hmmmm...

Aleksandar Milivojevic

unread,
May 25, 2001, 5:37:53 AM5/25/01
to
Philip Brown (phi...@bolthole.no-bots.com) wrote:
> On 24 May 2001 10:37:10 +0200, al...@fly.srk.fer.hr wrote:
> >...
> >Is is a BAD THING to advice newbies to use LD_LIBRARY_PATH. He should
> >link programs using -R/usr/local/lib (for exapmple) option so that
> >path to librires is encoded into executable.
>
> However, getting some programs to compile correctly with -R, is much more
> difficult than doing
>
> export LD_LIBRARY_PATH=/usr/lib:/opt/sfw/lib:/usr/local/lib
>
> once.
>
> So I would say that setting LD_LIBRARY_PATH *is* for newbies, not the other
> way around.

Taking the easy way will leave him in the newbie state forever. I'd
rather suggest "the right way" of doing something to people asking
advice. Never quick and dirty shortcuts.

Drazen Kacar

unread,
May 25, 2001, 9:18:44 AM5/25/01
to
Philip Brown wrote:
> On Thu, 24 May 2001 18:35:24 +0000 (UTC), da...@arsdigita.com wrote:
> >Philip Brown wrote:
> >> On Thu, 24 May 2001 17:07:23 +0000 (UTC), da...@arsdigita.com wrote:
> >> >...
> >> >You can set LD_OPTIONS=-R/opt/sfw/lib:/usr/local/lib once.
> >> ..
> >
> >[for the ...] ld(1) utility. It bypasses all the crap that you (and me)
> >don't like ,and kindly asks linker to use this flag. It's a kind of magic. :-)
>
> ooOOoooo.....
>
> And its an environment var, so it doesnt matter what the hell some ung-dly
> "open" sourcer did with their makefile. I *LIKE*.

Did I ever tell you that linker subsystem is the best part of Solaris?

> Hmmm. Seems like "LD_RUN_PATH" is the more specific -R permutation
> of this method. Although if there is an -R set, that overrides.
> Hmmmm...

LD_RUN_PATH is somewhat more portable, while LD_OPTIONS is a nice and
incompatible interface for your private use.

There are Makefiles which will set LD_RUN_PATH (products of imake, there
might be more of them). But setting -R overrides. That's good. Control
should belong to the user and not to some disgusting product of a
disgusting product of some unreadable script.

0 new messages