Seurat: Issue with "hdf5r" for Seurat installation

Created on 25 Jul 2018  Â·  3Comments  Â·  Source: satijalab/seurat

I've been getting an error on trying to do install.packages("Seurat")

This is what I got:

Installing package into ‘/home/ahmedmar/Rlibrary/3.4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.r-project.org/src/contrib/Seurat_2.3.4.tar.gz'
Content type 'application/x-gzip' length 861959 bytes (841 KB)


downloaded 841 KB

* installing *source* package ‘Seurat’ ...
** package ‘Seurat’ successfully unpacked and MD5 sums checked
** libs
g++ -std=gnu++11 -I/sw/arcts/centos7/R/3.4.1/lib64/R/include -DNDEBUG  -I"/home/ahmedmar/Rlibrary/3.4.1/Rcpp/include" -I"/home/ahmedmar/Rlibrary/3.4.1/RcppEigen/include" -I"/home/ahmedmar/Rlibrary/3.4.1/RcppProgress/include" -I/usr/local/include   -fpic  -g -O2 -c ModularityOptimizer.cpp -o ModularityOptimizer.o
g++ -std=gnu++11 -I/sw/arcts/centos7/R/3.4.1/lib64/R/include -DNDEBUG  -I"/home/ahmedmar/Rlibrary/3.4.1/Rcpp/include" -I"/home/ahmedmar/Rlibrary/3.4.1/RcppEigen/include" -I"/home/ahmedmar/Rlibrary/3.4.1/RcppProgress/include" -I/usr/local/include   -fpic  -g -O2 -c RModularityOptimizer.cpp -o RModularityOptimizer.o
g++ -std=gnu++11 -I/sw/arcts/centos7/R/3.4.1/lib64/R/include -DNDEBUG  -I"/home/ahmedmar/Rlibrary/3.4.1/Rcpp/include" -I"/home/ahmedmar/Rlibrary/3.4.1/RcppEigen/include" -I"/home/ahmedmar/Rlibrary/3.4.1/RcppProgress/include" -I/usr/local/include   -fpic  -g -O2 -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I/sw/arcts/centos7/R/3.4.1/lib64/R/include -DNDEBUG  -I"/home/ahmedmar/Rlibrary/3.4.1/Rcpp/include" -I"/home/ahmedmar/Rlibrary/3.4.1/RcppEigen/include" -I"/home/ahmedmar/Rlibrary/3.4.1/RcppProgress/include" -I/usr/local/include   -fpic  -g -O2 -c data_manipulation.cpp -o data_manipulation.o
g++ -std=gnu++11 -I/sw/arcts/centos7/R/3.4.1/lib64/R/include -DNDEBUG  -I"/home/ahmedmar/Rlibrary/3.4.1/Rcpp/include" -I"/home/ahmedmar/Rlibrary/3.4.1/RcppEigen/include" -I"/home/ahmedmar/Rlibrary/3.4.1/RcppProgress/include" -I/usr/local/include   -fpic  -g -O2 -c snn.cpp -o snn.o
g++ -std=gnu++11 -shared -L/sw/arcts/centos7/R/3.4.1/lib64/R/lib -L/usr/local/lib64 -o Seurat.so ModularityOptimizer.o RModularityOptimizer.o RcppExports.o data_manipulation.o snn.o -L/sw/arcts/centos7/R/3.4.1/lib64/R/lib -lR
installing to /home/ahmedmar/Rlibrary/3.4.1/Seurat/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/home/ahmedmar/Rlibrary/3.4.1/hdf5r/libs/hdf5r.so':
  /home/ahmedmar/Rlibrary/3.4.1/hdf5r/libs/hdf5r.so: invalid ELF header
ERROR: lazy loading failed for package ‘Seurat’
* removing ‘/home/ahmedmar/Rlibrary/3.4.1/Seurat’

The downloaded source packages are in
    ‘/tmp/RtmpXkgxMp/downloaded_packages’
Warning message:
In install.packages("Seurat", repos = "https://cran.r-project.org") :
  installation of package ‘Seurat’ had non-zero exit status

Most helpful comment

A few points here:

  1. As this is related to the hdf5 installation, its a bit upstream of Seurat. Given that your particular issue seems to be related to file locations, I might recommend upgrading R to 3.5 and reinstalling - which would reinstall all packages and likely alleviate this.

  2. In future versions, we will make hdf5 optional to avoid similar problems.

  3. I am enjoying @evolvedmicrobe 's HDF5 analogies enormously.

All 3 comments

Your problem doesn't seem to be with the Seurat package but rather with the hdf5r package Seurat takes as a dependency. In particular, Seurat loads the hdf5r package, and when attempting to load this, it is telling you that the ELF header in that library is incorrect, which may indicate that the code for that package was compiled for a different platform.

By analogy, say Seurat on a Unix installation speaks Italian, but on a MacOS installation it speaks German. When running on Unix, the Italian speaking Seurat goes looking for a book called hdf5r written in Italian, but instead finds a German copy of the book, and is helpless because it can't speak German, but gives an error message saying, "Hey, this isn't Italian!"

This kind of thing can happen if you copy R or R library files between different operating systems. Was the file located at '/home/ahmedmar/Rlibrary/3.4.1/hdf5r/libs/hdf5r.so' compiled and created by the same operating system you tried to install Seurat on, or was it copied from somewhere else?

A few points here:

  1. As this is related to the hdf5 installation, its a bit upstream of Seurat. Given that your particular issue seems to be related to file locations, I might recommend upgrading R to 3.5 and reinstalling - which would reinstall all packages and likely alleviate this.

  2. In future versions, we will make hdf5 optional to avoid similar problems.

  3. I am enjoying @evolvedmicrobe 's HDF5 analogies enormously.

Also see a quite clever solution from Henrik on issue #622

Was this page helpful?
0 / 5 - 0 ratings