Problem loading raster package on Rstudio server (Supercomputer clusters)

This is my first time using Rstudio server on a supercomputer hosted by my University.
I do have an issue loading the 'raster' package.

The error message:

Error: package or namespace load failed for ‘raster’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/panfs/jay/groups/8/mulla003/lachg001/R/x86_64-pc-linux-gnu-library/4.1/terra/libs/': cannot open shared object file: No such file or directory

I loaded all raster's system dependencies to install the raster packages (e.i gsl/2.5, udunits/, proj/4.9.3, gdal/2.3.2, geos/3.7.1).

Please note this error pops up only for the 'raster' package.
I appreciate your help


I'm not sure, but the message looks like something e.g. terra has to be installed on system level. I could be wrong.

Download — GDAL documentation

IMHO the problem is that the installed terra package - or more to the point its shared library - cannot find which usually is supplied by the gdal/2.3.2 module.

Wondering if you loaded the modules before starting the R code execution ?

For further debugging, can you please do the following: Load all the required modules as you specified and then run ldd /panfs/jay/groups/8/mulla003/lachg001/R/x86_64-pc-linux-gnu-library/4.1/terra/libs/ Check the output to see if is resolved.

If it does not resolve, please check LD_LIBRARY_PATH (e.g. via. echo LD_LIBRARY_PATH) This should contain a lib folder that points to the gdal/2.3.2 software. Check if can be found in this folder.

If you're still stuck, please report back with a quick summary on how you are launching your R computation on the supercomputer, especially how (and in which order) you submit a job, load the modules, start R and run the calculation. should be provided by. the gdal/2.3.2 module that @AbiMow is using so IMHO no need to install this again.

Yes, No need to install gdal since it was loaded in my environment (gdal/2.3.2)

I had just to load these required modules (gdal/2.3.2, proj/4.9.3, geos/3.7.1) into my environment so the "raster" package can be loaded successfully into my Rstudio session. The order matters.

Sincerely yours

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.