Search code examples
shared-librarieslibrarieshdf5

Can't find libGLU.so.1 when trying to run VisIt


General Problem

I have been trying to run multiple programs (VisIt and Athena) and am having similar issues on both - an inability to find shared libraries, although they do exist in a different spot.

Code Output/Errors

Trying to run Athena gives me

[~athena/working]$ ~/athena/bin/athena -i athinput.blast >log
/nethome/myname/athena/bin/athena: error while loading shared libraries: libhdf5.so.103

or, when running VisIt

[~/local/visit/bin]$ ./visit
Running: gui3.0.2
/localdata/myname/visit/3.0.2/linux-x86_64/bin/gui: error while loading shared libraries: libGLU.so.1: cannot open shared object file: No such file or directory

What I've attempted

If I use find -iname I can find both of these libraries

[~/local/anaconda2]$ find -iname 'libhdf5.so.103'
./lib/libhdf5.so.103
./pkgs/hdf5-1.10.4-nompi_h3c11f04_1106/lib/libhdf5.so.103
./pkgs/hdf5-1.10.4-hb1b8bf9_0/lib/libhdf5.so.103

and

[~/local/anaconda2]$ find -iname 'libGLU.so.1'
./lib/libGLU.so.1
./pkgs/libglu-9.0.0-hf484d3e_1/lib/libGLU.so.1

What do I need to do to point to them. I've tried updating my compiler path using export CPATH and I've tried adding LDLIBS := -L/nethome/sferrel6/local/anaconda2/lib -lhdf5 to the Athena Makefile (which earlier helped me find the hdf5 library)


Solution

  • What do I need to do to point to them

    Since these libraries are not installed in the default system location(s), you must tell the dynamic loader where to find them. See man ld.so on your system.

    Assuming you are on Linux, here are the ways you could do it:

    1. export LD_LIBRARY_PATH=$HOME/local/anaconda2/lib
    2. Re-link athena binary with -Wl,-rpath=$HOME/local/anaconda2/lib
    3. (Requires root access). Edit /etc/ld.so.conf, add $HOME/local/anaconda2/lib to it, run /sbin/ldconfig to update /etc/ld.so.cache.