Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Set LD_LIBRARY_PATH and restart program (improvements)

by tye (Sage)
on Aug 18, 2011 at 04:01 UTC ( #920853=note: print w/replies, xml ) Need Help??


in reply to Set LD_LIBRARY_PATH and restart program

Usually you want these solutions to add directories to the path, not just overwrite the current list with a new list.

As noted in the threads you mentioned, some versions of some operating systems notice that perl is exec'ing perl (itself) and then avoid repeating some of the work of loading dependencies. This can lead to this solution still not working.

That is why some of the solutions previously provided did something like:

exec "env", $^X, $0, @ARGV # ^^^^^ have perl exec env that execs perl

- tye        

Replies are listed 'Best First'.
Re^2: Set LD_LIBRARY_PATH and restart program (improvements)
by runrig (Abbot) on Aug 18, 2011 at 16:37 UTC

    In my case, I do want it to overwrite the path, because the 'default' environment "they" have picked for us has a bunch of crap in LD_LIBRARY_PATH, and I want shared lib paths to default to the path that the other shared libs were compiled under, not get overridden by LD_LIBRARY_PATH.

    E.g., (On Solaris) I've compiled a new libxml2 in a non-standard place, and compiled XML::LibXML against that new version. With LD_LIBRARY_PATH unset, it finds the right libxml2. If I leave LD_LIBRARY_PATH set, it finds the old version and complains. I've tried adding '-i' to the LDDLFLAGS when compiling XML::LibXML to try and say 'ignore LD_LIBRARY_PATH' (-R/path was already being used), but it doesn't seem to work, so this is my BandAid(tm).

    And it seems to work ok without the "env" (though if this were a universal portable solution, I'd put it in).

    Oh, and if you want to add paths instead of overwrite it, I'm sure you could just pass the current value of LD_LIBRARY_PATH in to the import list along with other paths.

    Update: AFAICT, my main issue seems to be that "they" decided to put "/usr/lib" in LD_LIBRARY_PATH, which, if my recent research has led me to a correct conclusion, is a bad bad thing.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://920853]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2018-06-18 02:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (107 votes). Check out past polls.

    Notices?