Discussion:
Where is the load path defined?
(too old to reply)
n***@greatnowhere.org
2011-02-28 11:44:38 UTC
Permalink
Hi can anyone please tell me where the program library load path is defined
in Solaris 10? I have modules in /usr/local/lib but they are not being
detected and the program fails until I export LD_LIBRARY_PATH for that
user. I would like to change the system to include /usr/local thanks.
Zfs..
2011-02-28 13:20:06 UTC
Permalink
Post by n***@greatnowhere.org
Hi can anyone please tell me where the program library load path is defined
in Solaris 10? I have modules in /usr/local/lib but they are not being
detected and the program fails until I export LD_LIBRARY_PATH for that
user. I would like to change the system to include /usr/local thanks.
update the users .profile and add in the LD_LIBRARY_PATH
Chris Ridd
2011-02-28 13:41:37 UTC
Permalink
Post by Zfs..
Post by n***@greatnowhere.org
Hi can anyone please tell me where the program library load path is defined
in Solaris 10? I have modules in /usr/local/lib but they are not being
detected and the program fails until I export LD_LIBRARY_PATH for that
user. I would like to change the system to include /usr/local thanks.
update the users .profile and add in the LD_LIBRARY_PATH
For a more complete way to break your system and make it unbootable,
try crle(1).
--
Chris
n***@greatnowhere.com
2011-02-28 13:52:17 UTC
Permalink
Post by Chris Ridd
For a more complete way to break your system and make it unbootable,
try crle(1).
Ok point taken so how should it be done in Solaris for non-root users?
n***@greatnowhere.com
2011-02-28 13:51:36 UTC
Permalink
Post by Zfs..
update the users .profile and add in the LD_LIBRARY_PATH
Is there a central place where I can do this for all non-root users or do I
have to update all the possible profiles for each user depending on shell?
Thanks.
John D Groenveld
2011-02-28 13:48:52 UTC
Permalink
Post by n***@greatnowhere.org
Hi can anyone please tell me where the program library load path is defined
in Solaris 10? I have modules in /usr/local/lib but they are not being
detected and the program fails until I export LD_LIBRARY_PATH for that
user. I would like to change the system to include /usr/local thanks.
I can't find David Barr's original, but here's an archive of
his rant about the evils of LD_LIBRARY_PATH:
<URL:http://xahlee.org/UnixResource_dir/_/ldpath.html>

What program are you trying to install?
John
***@acm.org
n***@greatnowhere.com
2011-02-28 13:54:21 UTC
Permalink
Post by John D Groenveld
I can't find David Barr's original, but here's an archive of
<URL:http://xahlee.org/UnixResource_dir/_/ldpath.html>
I read that before posting ;) which is why I asked. So what is the approved
Solaris way of doing this?
Post by John D Groenveld
What program are you trying to install?
I am building apps in /usr/local and the library members go in
/usr/local/lib to keep them separate from what came with the system. It's
not just one app. I'd like to include /usr/local/lib in all the non-root
users load paths.
Doug McIntyre
2011-02-28 13:56:16 UTC
Permalink
Post by n***@greatnowhere.org
Hi can anyone please tell me where the program library load path is defined
in Solaris 10? I have modules in /usr/local/lib but they are not being
detected and the program fails until I export LD_LIBRARY_PATH for that
user. I would like to change the system to include /usr/local thanks.
Best solution is to compile them with -R defining the load path during
linktime.

(relative paths are supported too (ie $ORIGIN/../lib) so the binaries
can move anywhere as a group.

Otherwise, if you want to manage the system like a linux box instead
of a solaris box, you can use the 'crle' command.
n***@greatnowhere.com
2011-02-28 14:15:42 UTC
Permalink
Post by Doug McIntyre
Best solution is to compile them with -R defining the load path during
linktime.
I guess that means the load path is compiled in? I have been doing that
because I saw an example somewhere and I think I even did it in this case
but I may have missed something. One app that's giving me the problem has
such a horrible build script I had to basically change everything in it. I
guess I can go back and try again.
Post by Doug McIntyre
(relative paths are supported too (ie $ORIGIN/../lib) so the binaries
can move anywhere as a group.
Thanks that will help to know.
Post by Doug McIntyre
Otherwise, if you want to manage the system like a linux box instead
of a solaris box, you can use the 'crle' command.
Thanks to you and the other poster who mentioned it. I'll look into it. I
was thinking there was a file like ldconfig uses on Linux but I am new to
Solaris and alot is confusing and I am trying not to make my Solaris box
into a Solinux box ;) so I have to ask alot of dumb questions.

Thanks guys.
River Tarnell
2011-02-28 15:25:47 UTC
Permalink
Post by n***@greatnowhere.com
Post by Doug McIntyre
Best solution is to compile them with -R defining the load path during
linktime.
I guess that means the load path is compiled in?
Yes.
Post by n***@greatnowhere.com
One app that's giving me the problem has > such a horrible build
script I had to basically change everything in it. I > guess I can go
back and try again.
You could try setting LD_RUN_PATH=/usr/local/lib in the environment
before starting the build, which will have the same effect as passing
-R/usr/local/lib to every invocation of ld. If you do that, don't
specify any -R at all.

- river.
n***@greatnowhere.com
2011-02-28 16:00:47 UTC
Permalink
Post by River Tarnell
Post by n***@greatnowhere.com
I guess that means the load path is compiled in?
Yes.
Thanks.
Post by River Tarnell
Post by n***@greatnowhere.com
One app that's giving me the problem has > such a horrible build
script I had to basically change everything in it. I > guess I can go
back and try again.
You could try setting LD_RUN_PATH=/usr/local/lib in the environment
before starting the build, which will have the same effect as passing
-R/usr/local/lib to every invocation of ld. If you do that, don't
specify any -R at all.
That sounds like a good idea in general but what if the build script doesn't
respect it? The one I am looking at resets all the normal variables and
overrides everything! Thank you.
River Tarnell
2011-02-28 16:43:53 UTC
Permalink
Post by n***@greatnowhere.com
Post by River Tarnell
You could try setting LD_RUN_PATH=/usr/local/lib in the environment
before starting the build, which will have the same effect as passing
-R/usr/local/lib to every invocation of ld. If you do that, don't
specify any -R at all.
That sounds like a good idea in general but what if the build script doesn't
respect it? The one I am looking at resets all the normal variables and
overrides everything!
Does it explicitly unset LD_RUN_PATH? This is only used by ld, and most
build systems don't know or care about it.

- river.
n***@greatnowhere.com
2011-02-28 17:01:08 UTC
Permalink
Post by River Tarnell
Does it explicitly unset LD_RUN_PATH? This is only used by ld, and most
build systems don't know or care about it.
Ah no, it unsets load path but not run path. Thank you that should work.
Scott
2011-03-02 02:43:53 UTC
Permalink
Post by n***@greatnowhere.org
Hi can anyone please tell me where the program library load path is defined
in Solaris 10? I have modules in /usr/local/lib but they are not being
detected and the program fails until I export LD_LIBRARY_PATH for that
user. I would like to change the system to include /usr/local thanks.
See this page: http://bwachter.lart.info/solaris/solfaq.html,
under "Configuring the dynamic linker". I'm sure there are other
explanations too;
this one was the first one I Googled and didn't contain spam.

- Scott
David Kirkby
2011-03-02 05:23:56 UTC
Permalink
Post by n***@greatnowhere.org
Hi can anyone please tell me where the program library load path is defined
in Solaris 10? I have modules in /usr/local/lib but they are not being
detected and the program fails until I export LD_LIBRARY_PATH for that
user. I would like to change the system to include /usr/local thanks.
man crle
Teddy
2011-03-02 06:23:48 UTC
Permalink
Post by n***@greatnowhere.org
Hi can anyone please tell me where the program library load path is defined
in Solaris 10? I have modules in /usr/local/lib but they are not being
detected and the program fails until I export LD_LIBRARY_PATH for that
user. I would like to change the system to include /usr/local thanks.
You can update your .profile or ..rc file specific to your logn shell.
These files are usually in your home directory.
Vincent
2011-03-04 22:47:42 UTC
Permalink
Post by n***@greatnowhere.org
Hi can anyone please tell me where the program library load path is defined
in Solaris 10? I have modules in /usr/local/lib but they are not being
detected and the program fails until I export LD_LIBRARY_PATH for that
user. I would like to change the system to include /usr/local thanks.
Use the crle program to update your system default search paths.
If run by itself it will inform you of current status also:

[***@sulaco]<612> crle

Configuration file [version 4]: /var/ld/ld.config
Default Library Path (ELF): /ucd/lib:/lib:/usr/lib
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system
default)

Command line:
crle -c /var/ld/ld.config -l /ucd/lib:/lib:/usr/lib

Loading...