rocker-org / rocker-versioned

Run current & prior versions of R using docker
https://hub.docker.com/r/rocker/r-ver
GNU General Public License v2.0
297 stars 169 forks source link

rocker/rstudio package loading error: cannot open shared object file #261

Closed ktmbiome closed 3 years ago

ktmbiome commented 3 years ago

I'm using rocker/rstudio:4.0.5 on an HPC using the docker container through singularity. I have attached everything in such a way that most packages are accessible, with the exception of (maybe?) Bioconductor packages, or at least they comprise a majority of them. For those, I get an error related to what appears to be compiler issues, but I can't say for sure and am unsure how to really resolve them. I am wondering if there is a bind in my Singularity call that I'm maybe missing?

Below is the output of trying to load three packages that fail in rocker/rstudio, and two packages that succeed:

> library(DESeq2, quiet=T)
Error: package or namespace load failed for ‘GenomeInfoDb’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object 'packagepath/RCurl/libs/RCurl.so':
  libxml2.so.2: cannot open shared object file: No such file or directory
Error: package ‘GenomeInfoDb’ could not be loaded
> library(phyloseq)
Error: package or namespace load failed for ‘phyloseq’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object 'packagepath/ade4/libs/ade4.so':
  libRlapack.so: cannot open shared object file: No such file or directory
> library(dada2)
Error: package or namespace load failed for ‘dada2’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object 'packagepath/RCurl/libs/RCurl.so':
  libxml2.so.2: cannot open shared object file: No such file or directory
> library(ggplot2)
> library(parallel)

When I run these same library loads in my local R-4.0.5 installation, all load fine.

Thanks so much for any thoughts you may have.

cboettig commented 3 years ago

Many R packages bind to shared system libraries that must be installed separately, (like libxml2-dev in this case) so you'll need to install those on the image yourself or just use an image with system libraries you need already installed, like rocker/verse. (I recommend just going with rocker/verse for starters, as it has many more of these already included, but you'll still find cases where you need to apt-get install something as root from a bash terminal before it works. This isn't rocker-specific, you should be able to find help on this in standard forums; just note that rocker is built on Ubuntu-20.04 so look for instructions related to Ubuntu or Debian Linux.

eddelbuettel commented 3 years ago

(Technically it is RSPM issue as the package comes made but cannot guarantee its system libraries. There are accessor there to help but I am more in what you may call "camp BSPM" here.... -- see our draft paper. I also once wrote a mini package to check for such missing shared libraries but it has not seen much use, mostly because RSPM covers most and, well, I use BSPM myself; see the GitHub repo if interested. )