[SUMMARY] Where is the default library path set?

From: Bryan J. Smith (Bryan.Smith@theseus.com)
Date: Wed Sep 01 1999 - 09:18:36 CDT


[SUMMARY] Where is the default library path set?

ANSWER
======

The answer is that it can NOT be modified. The default library path
is hard-linked into:
   /usr/lib/ld.so.*
   /usr/lib/libld.so.*

[ Thanks to: Klaus Heinz, David Mitchell, Matthew Steir and others
for that note. ]

WORKAROUND
==========

Is to, of course, use the LD_LIBRARY_PATH environmental variable.
To my ignorance, the LD_LIBRARY_PATH does *NOT REPLACE* the default
library path, but it *PRECEDES IT* in library resolution. In my
past experience, I forgot to "reuse" the LD_LIBRARY_PATH in my user
~/.cshrc or ~/.profile, which did replace the current
LD_LIBRARY_PATH set by the system in /etc/.cshrc or /etc/.profile.
So, in summary ...

SYSTEM-WIDE LIBRARIES
---------------------

For csh/tcsh users, set in /etc/.cshrc (NOT /etc/.login, which the
CDE/dt does NOT always run):
   setenv LD_LIBRARY_PATH /usr/local/lib: ...

For sh/ksh/bash users, set in /etc/.profile:
   export LD_LIBRARY_PATH /usr/local/lib: ...

Again, LD_LIBRARY_PATH only precedes the hardcoded path in
resolution, it does not replace it (thanx for setting my ignorance
straight).

USER LIBRARIES
--------------

For csh/tcsh users, set in ~/.cshrc:
   setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:~/lib: ...

For sh/ksh/bash users, set in ~/.profile:
   export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:~/lib: ...

Again, I *FORGOT* to put the ${LD_LIBRARY_PATH} in my user .cshrc's
in the past, hence, why I had problems (since it replaced the
system-wide one).

Thanx again to everyone who helped straighten me out!!!

-- Bryan "TheBS" Smith

--
Bryan J. Smith        mailto:Bryan.Smith@theseus.com
Theseus Logic                 http://www.theseus.com
- "Setting the Standard For Clockless Systems(TM)" -
====================================================
Disclaimer:  http://www.SmithConcepts.com/legal.html
Personal E-Mail:  mailto:president@SmithConcepts.com



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:25 CDT