On 12/4/21 11:40 AM, Thomas Koenig wrote:
> OK, what I have now is
> 
> tkoenig@gcc-fortran:~$ echo $PATH
> /home/tkoenig/bin:/opt/at15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
> tkoenig@gcc-fortran:~$ echo $LD_LIBRARY_PATH
> /home/tkoenig/lib64
> 
> I generally use LD_LIBRARY_PATH to point to where the shared
> libgfortran and other libraries is installed.
> 
> However, this breaks man (and I don't know what else):

So LD_LIBRARY_PATH is searched before the directories in ld.so.cache,
so you end up picking up some "new" libs from /home/tkoenig/lib64
and some of these rely on the newer libs in AT15.  However, man and
some of the other system binaries use the system dynamic linker, so
they search first through LD_LIBRARY_PATH an dnot finding something,
they fall back to /etc/ld.so.cache and that doesn't have the newer
AT15 libs, so you hit errors.

Instead of setting LD_LIBRARY_PATH=/home/tkoenig/lib64 could you try
setting it to LD_LIBRARY_PATH='$ORIGIN/lib64' instead?  This would
allow the other system binaries to not find your /home/tkoenig/lib64
directory so they'd behave normally.  However, any binary that was
compiled in a directory where your lib64/ exists would find your
new libs and use them.  I'm not sure if that cramps your testing
or not, to limit yourself to compiling your tests in that one directory.

If that doesn't work, could you instead not set LD_LIBRARY_PATH and
instead compile using -L/home/bergner/lib64 -R/home/bergner/lib64 ?

Peter



Reply via email to