mannau / h5

Interface to the HDF5 Library
Other
70 stars 22 forks source link

Install fails at "testing if installed package can be loaded" #55

Closed mike-lawrence closed 7 years ago

mike-lawrence commented 7 years ago

I'm on arch, installed hdf5-1.10.1 with ./configure --enable-cxx=yes --enable-static=yes --enable-shared=yes --prefix=/usr/local, and when I attempt to install h5 from the latest source I get the following output:

> devtools::install_github('mannau/h5')
Downloading GitHub repo mannau/h5@master
from URL https://api.github.com/repos/mannau/h5/zipball/master
Installing h5
'/usr/lib64/R/bin/R' --no-site-file --no-environ --no-save --no-restore  \
  --quiet CMD INSTALL  \
  '/tmp/Rtmpsud265/devtools323358c57484/mannau-h5-e01fa78'  \
  --library='/home/mike/R/x86_64-pc-linux-gnu-library/3.4' --install-tests 
* installing *source* package ‘h5’ ...
checking for h5c++... /usr/local/bin/h5c++
checking for ggrep... /usr/bin/grep
checking whether /usr/bin/grep accepts -o... yes
checking for ggrep... (cached) /usr/bin/grep
checking whether /usr/bin/grep accepts -o... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I/usr/include/R/ -DNDEBUG -I/usr/local/include  -I"/home/mike/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -c Attribute.cpp -o Attribute.o
g++ -std=gnu++11 -I/usr/include/R/ -DNDEBUG -I/usr/local/include  -I"/home/mike/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -c Dataset.cpp -o Dataset.o
g++ -std=gnu++11 -I/usr/include/R/ -DNDEBUG -I/usr/local/include  -I"/home/mike/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -c Dataspace.cpp -o Dataspace.o
g++ -std=gnu++11 -I/usr/include/R/ -DNDEBUG -I/usr/local/include  -I"/home/mike/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -c File.cpp -o File.o
g++ -std=gnu++11 -I/usr/include/R/ -DNDEBUG -I/usr/local/include  -I"/home/mike/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -c Group.cpp -o Group.o
g++ -std=gnu++11 -I/usr/include/R/ -DNDEBUG -I/usr/local/include  -I"/home/mike/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -c Helpers.cpp -o Helpers.o
g++ -std=gnu++11 -I/usr/include/R/ -DNDEBUG -I/usr/local/include  -I"/home/mike/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -shared -L/usr/lib64/R/lib -Wl,-O1,--sort-common,--as-needed,-z,relro -o h5.so Attribute.o Dataset.o Dataspace.o File.o Group.o Helpers.o RcppExports.o -L/usr/local/lib -L. -lhdf5_cpp -lhdf5 -lz -lm -L/usr/lib64/R/lib -lR
installing to /home/mike/R/x86_64-pc-linux-gnu-library/3.4/h5/libs
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘h5’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/mike/R/x86_64-pc-linux-gnu-library/3.4/h5/libs/h5.so':
  libhdf5_cpp.so.101: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/mike/R/x86_64-pc-linux-gnu-library/3.4/h5’
Installation failed: Command failed (1)
> 

I ran find / -name "libhdf5_cpp.so.101" and it is in /usr/local/lib/ as expected. Any suggestions?

mike-lawrence commented 7 years ago

Solved it! I had to set the LD_LIBRARY_PATH environment variable to /usr/local/lib. Successfully installed via:

Sys.setenv(LD_LIBRARY_PATH=paste("/usr/local/lib", Sys.getenv("LD_LIBRARY_PATH"),sep=":"))
devtools::install_github('mannau/h5')
mike-lawrence commented 7 years ago

Oops, spoke too soon. Installs fine, but on load:

> library(h5)
Error: package or namespace load failed for ‘h5’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/mike/R/x86_64-pc-linux-gnu-library/3.4/h5/libs/h5.so':
  libhdf5_cpp.so.101: cannot open shared object file: No such file or directory
mike-lawrence commented 7 years ago

Ah, fixed it. I'd actually had hdf5 installed previously without the --enable-cxx=yes, and when I re-installed it with this config flag I forgot to run ldconfig again. For anyone coming after me, after you install hdf5, you have to run:

echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf.d/hdf5.conf
sudo ldconfig