Fail to load libgfortran.so.3

Hello!

I was trying to run a script on discovery and encounter the following error:
error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory

Is libgfortran.so.3 already installed on discovery? If yes, could someone please advise how to load it? If no, could someone please install it?

Thanks very much and much appreciated!

A libgfortran.so.3 file is located in /usr/lib64, on the login node at least. But that’s tied to the system compiler which is GCC 4.8.5. If you compiled the program from source, which compiler did you use? Using a module, the setup could be:

module purge
module load gcc/8.3.0
export CC=`which gcc` CXX=`which g++` FC=`which gfortran`
export LD_PRELOAD=/spack/apps/gcc/8.3.0/lib64/libstdc++.so.6

Or if you’re using a Makefile, you may need to specify which gfortran to use in the Makefile.

I re-installed the software with the suggested module, now it is working. Thanks very much!