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!

Does this fix also apply to the following error message when on an interactive salloc node?

Error: package or namespace load failed for ‘SummarizedExperiment’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/home1/michandr/R/x86_64-pc-linux-gnu-library/4.3/Matrix/libs/Matrix.so’:
libgfortran.so.3: cannot open shared object file: No such file or directory
Error: package ‘SummarizedExperiment’ could not be loaded

^I tried a copy-paste application of the export CC, export LD_PRELOAD fix, but I suspect I’m misapplying it or not adjusting it to my situation

I’m attempting to use the R package dryR. Initially I tried to run this on my local computer, and got the following error message upon use of the package:
Error in h(simpleError(msg, call)) :
error in evaluating the argument ‘args’ in selecting a method for function ‘do.call’: error writing to connection

Then I tried on a login node with export OPENBLAS_NUM_THREADS=1, but I kept getting the following error message upon use of the package:
libgomp: Thread creation failed: Resource temporarily unavailable

Then I tried the interactive node, but I couldn’t even load the package, getting the “unable to load shared object” message above.

Assuming that you’re using the software modules, it should not be linking to libgfortran.so.3. Try reinstalling the package from source.

The dryR package?

salloc --time=01:00:00 --ntasks=8
module purge
module load gcc/11.3.0
module load openblas/0.3.20
module load r/4.3.2
R
options(HTTPUserAgent = sprintf(“R/%s R (%s)”, getRversion(), paste(getRversion(), R.version[“platform”], R.version[“arch”], R.version[“os”])))
options(repos = “https://packagemanager.rstudio.com/all/__linux__/centos7/latest”)
install.packages(“devtools”)
devtools::install_github(“naef-lab/dryR”,force=TRUE)

I get:
Downloading GitHub repo naef-lab/dryR@HEAD
– R CMD build ----------------------------------------------------------------------------------------------------------------------------------------------
v checking for file ‘/tmp/SLURM_19377922/RtmpTnuNbv/remotes6d494fec2f79/naef-lab-dryR-9078026/DESCRIPTION’ …

  • preparing ‘dryR’:
    v checking DESCRIPTION meta-information …
  • excluding invalid files
    Subdirectory ‘man’ contains invalid file names:
    ‘logo.png’
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
  • building ‘dryR_1.0.0.tar.gz’
    Warning: invalid uid value replaced by that for user ‘nobody’

Installing package into ‘/home1/michandr/R/x86_64-pc-linux-gnu-library/4.3’
(as ‘lib’ is unspecified)

  • installing source package ‘dryR’ …
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** byte-compile and prepare package for lazy loading
    Error: package or namespace load failed for ‘SummarizedExperiment’ in dyn.load(file, DLLpath = DLLpath, …):
    unable to load shared object ‘/home1/michandr/R/x86_64-pc-linux-gnu-library/4.3/Matrix/libs/Matrix.so’:
    libgfortran.so.3: cannot open shared object file: No such file or directory
    Execution halted
    ERROR: lazy loading failed for package ‘dryR’
  • removing ‘/home1/michandr/R/x86_64-pc-linux-gnu-library/4.3/dryR’
  • restoring previous ‘/home1/michandr/R/x86_64-pc-linux-gnu-library/4.3/dryR’
    Warning message:
    In i.p(…) :
    installation of package ‘/tmp/SLURM_19377922/RtmpTnuNbv/file6d49467974d3/dryR_1.0.0.tar.gz’ had non-zero exit status

I mean the Matrix package. And don’t use the RSPM repo (exclude the options lines that set the repos); that’s actually the cause of the issue. Use the default CRAN repo instead.

Thanks! I think that did the trick.