in reply to Re^2: LD_LIBRARY_PATH setting
in thread LD_LIBRARY_PATH setting

Maybe you can print some output so you see what is happening?

Alternatively, trace your program with truss or strace to see what system calls it makes.

Maybe you can post a short, self-contained example of the program you're actually running so we can reproduce your problem exactly?

Replies are listed 'Best First'.
Re^4: LD_LIBRARY_PATH setting
by pdupre (Acolyte) on Aug 05, 2016 at 19:08 UTC
    #!/usr/bin/perl BEGIN { $ENV{LD_LIBRARY_PATH} = "/usr/local/gsl-1/lib" ; exec $0, '--restarted', @ARGV ; } ; require Math::GSL ; use strict; use warnings; print $ENV{LD_LIBRARY_PATH}, "\n";
    Can't load '/usr/lib/perl5/vendor_perl/auto/Math/GSL/Errno/Errno.so' +for module Math::GSL::Errno: libgsl.so.0: cannot open shared object f +ile: No such file or directory at /usr/lib/perl5/DynaLoader.pm line 1 +93. at /usr/lib/perl5/vendor_perl/Math/GSL/Errno.pm line 11. Compilation failed in require at /usr/lib/perl5/vendor_perl/Math/GSL/T +est.pm line 7. BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/Math/G +SL/Test.pm line 7. Compilation failed in require at /usr/lib/perl5/vendor_perl/Math/GSL.p +m line 10. BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/Math/G +SL.pm line 10. Compilation failed in require at ./test.pl line 10.
    Patrick Dupre Universite du Littoral, FR Dunkirk

      This is higly weird because I would expect that code to go into an endless self-exec loop instead of producing that error message. You never check for the self-restart flag.

      Maybe consider adding more debug output, for example two print statements around the exec statement:

      ... print "Rerunning $0 --restarted @ARGV\n"; exec $0, '--restarted', @ARGV or print STDERR "couldn't exec foo: $!"; ...

      Also, if you put your code in between <code>...</code> tags, it renders and downloads much better.

        Rerunning ./test.pl --restarted --restarted --restarted --restarted --restarted --restarted --restarted --restarted --restarted --restarted --restarted --restarted -

        Patrick Dupre Universite du Littoral, FR Dunkirk