Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/usr/local/lib/libfoo has precedence over /usr/lib/libfoo ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
svenc
n00b
n00b


Joined: 06 Apr 2003
Posts: 33

PostPosted: Tue Oct 09, 2012 5:32 pm    Post subject: /usr/local/lib/libfoo has precedence over /usr/lib/libfoo ? Reply with quote

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
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5909

PostPosted: Tue Oct 09, 2012 5:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
svenc
n00b
n00b


Joined: 06 Apr 2003
Posts: 33

PostPosted: Wed Oct 10, 2012 3:20 am    Post subject: Understanding emerge runtime library search library ? Reply with quote

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
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5909

PostPosted: Wed Oct 10, 2012 6:16 am    Post subject: Re: Understanding emerge runtime library search library ? Reply with quote

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
View user's profile Send private message
svenc
n00b
n00b


Joined: 06 Apr 2003
Posts: 33

PostPosted: Wed Oct 10, 2012 4:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9501
Location: beyond the rim

PostPosted: Thu Oct 11, 2012 10:43 am    Post subject: Reply with quote

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
View user's profile Send private message
svenc
n00b
n00b


Joined: 06 Apr 2003
Posts: 33

PostPosted: Thu Oct 11, 2012 1:48 pm    Post subject: Reply with quote

Thanks Genone, makes sense.

Sven
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum