View previous topic :: View next topic |
Author |
Message |
svenc n00b
Joined: 06 Apr 2003 Posts: 33
|
Posted: Tue Oct 09, 2012 5:32 pm Post subject: /usr/local/lib/libfoo has precedence over /usr/lib/libfoo ? |
|
|
Hi forum. Been vexed by this one for many years. Have an older version of icu installed in /usr/local/lib needed for binary not in portage. Whenever I emerge something that depends on icu ( currently libxml ) it links against the /usr/local/lib version and no amount of ld.so.conf manipulation via /etc/env.d files seems to make any difference. Anybody have insights into this ?
Sven |
|
Back to top |
|
|
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5909
|
Posted: Tue Oct 09, 2012 5:44 pm Post subject: |
|
|
maybe it is LD_LIBRARY_PATH issue, might worth while to check it. _________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein |
|
Back to top |
|
|
svenc n00b
Joined: 06 Apr 2003 Posts: 33
|
Posted: Wed Oct 10, 2012 3:20 am Post subject: Understanding emerge runtime library search library ? |
|
|
Thanks for responding DaggyStyle. The only way that I was able to emerge libxml2 was: Code: | mv /usr/local /usr/local-temp |
By reading http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html I now think this problem could be solved with RPATH, but I'm not sure how such an environment variable could be configured for gcc when running emerge. In the end, the best solution for a situation like this is probably to locate the needed libraries somewhere in a home directory and execute the binary that requires these needed libraries with a shell script that sets up the environment to search the home directory for specific libraries.
Sven |
|
Back to top |
|
|
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5909
|
Posted: Wed Oct 10, 2012 6:16 am Post subject: Re: Understanding emerge runtime library search library ? |
|
|
svenc wrote: | Thanks for responding DaggyStyle. The only way that I was able to emerge libxml2 was: Code: | mv /usr/local /usr/local-temp |
By reading http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html I now think this problem could be solved with RPATH, but I'm not sure how such an environment variable could be configured for gcc when running emerge. In the end, the best solution for a situation like this is probably to locate the needed libraries somewhere in a home directory and execute the binary that requires these needed libraries with a shell script that sets up the environment to search the home directory for specific libraries.
Sven |
now that is an extremely bad idea!
can't you uninstall icu and install it properly? _________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein |
|
Back to top |
|
|
svenc n00b
Joined: 06 Apr 2003 Posts: 33
|
Posted: Wed Oct 10, 2012 4:39 pm Post subject: |
|
|
I require icu4c-4_0_1 ( no longer in tree ) for a binary not in portage. In the end, I added LD_LIBRARY_PATH environment variable to .bash_profile which pointed to needed icu libraries in home directory. Everything seems to work including emerging of libxml2 which previously failed when this tarball was installed into /usr/local/. The details are beyond me. Thanks for replying.
Sven |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9532 Location: beyond the rim
|
Posted: Thu Oct 11, 2012 10:43 am Post subject: |
|
|
Unless the user with the LD_LIBRARY_PATH setting is used exclusively to run that old binary I suggest you remove it again an instead write a wrapper script for it with the setting, e.g.
Code: | #!/bin/sh
LD_LIBRARY_PATH=/path/to/old-icu-libs-dir /path/to/old/binary |
and put that in a ../bin directory.
Keeping it in your standard profile may cause other applications to crash at runtime if they load the wrong library version (that's why global LD_LIBRARY_PATH is usually considered a bad thing). |
|
Back to top |
|
|
svenc n00b
Joined: 06 Apr 2003 Posts: 33
|
Posted: Thu Oct 11, 2012 1:48 pm Post subject: |
|
|
Thanks Genone, makes sense.
Sven |
|
Back to top |
|
|
|