This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: libgfortran.so.3: cannot open shared object file
RadSurfer schrieb:
> [RadSurfer@centos fortran]$ export
> LD_LIBRARY_PATH="/usr/local/gfortran/lib:$LD_LIBRARY_PATH"
> [RadSurfer@centos fortran]$ echo ${LD_LIBRARY_PATH}
> /usr/local/gfortran/lib:
> (this is safe in any event, whether L_L_P already exists or not :-)
>
<pedantic>
No this is not "safe" (in the sense of security):
LD_LIBRARY_PATH="/usr/local/gfortran/lib"
searches in /usr/local/gfortran/lib and the default paths
(/etc/ld.so.conf, /etc/ld.so.conf.d/*) whereas
LD_LIBRARY_PATH="/usr/local/gfortran/lib:"
searches also in the current working directory before using the default
path. That way the wrong file might be found and if you are in "/tmp/"
on a multi-user system this has security implications as any other user
could put a compromised *.so file there.
None the less, on most systems it should be "safe" (in the sense that it
works without breaking anything without having a problem with malicious
other users).
</pedantic>
For a safe [both sense] (Ba)sh and a (t)csh solution, see bottom of
http://gcc.gnu.org/wiki/GFortranBinaries64Linux
(For Bash one could also use
LD_LIBRARY_PATH="/usr/local/gfortran/lib${LD_LIBRARY_PATH+:LD_LIBRARY_PATH}")
Tobias