Setup.csh complains about LD LIBRARY PATH

From BRTT

Jump to: navigation, search
Question
Question:

When I source $ANTELOPE/setup.csh, it complains about LD_LIBRARY_PATH.


Warning: The environment variable LD_LIBRARY_PATH is set to                 
  /path1:/path2:/path3  
This may cause the Antelope software to fail.  

What's wrong with this?

Answer:

You should not set LD_LIBRARY_PATH because it forces the autoloader to resolve libraries along $LD_LIBRARY_PATH before the path which is built into the Antelope executables. If a library with a conflicting name or a routine with a conflicting name is found before the expected library or routine, the program will fail, often in a mysterious way.


For some corroborating viewpoints on LD_LIBRARY_PATH, please see:

If you use some (non Antelope) executable which requires setting LD_LIBRARY_PATH, you can resolve the problem in one of the following ways:

  • relink your executables, (specifying -R/path1:/path2:/path3 in the link line), so they do not need LD_LIBRARY_PATH.
  • Wrap the offending executables in a script like this:


#!/bin/sh
LD_LIBRARY_PATH=/path1:/path2:/path3 
export LD_LIBRARY_PATH
exec offender