mannau / h5

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

installation failure when anaconda python is installed #49

Closed maverickg closed 7 years ago

maverickg commented 7 years ago

See the following output

Selection: 1
trying URL 'https://cloud.r-project.org/src/contrib/h5_0.9.8.tar.gz'
Content type 'application/x-gzip' length 393742 bytes (384 KB)
==================================================
downloaded 384 KB

* installing *source* package ‘h5’ ...
** package ‘h5’ successfully unpacked and MD5 sums checked
checking for h5c++... /home/foo/anaconda3/bin/h5c++
checking for ggrep... /bin/grep
checking whether /bin/grep accepts -o... yes
checking for ggrep... (cached) /bin/grep
checking whether /bin/grep accepts -o... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/home/foo/anaconda3/include  -I"/home/foo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Attribute.cpp -o Attribute.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/home/foo/anaconda3/include  -I"/home/foo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Dataset.cpp -o Dataset.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/home/foo/anaconda3/include  -I"/home/foo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Dataspace.cpp -o Dataspace.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/home/foo/anaconda3/include  -I"/home/foo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c File.cpp -o File.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/home/foo/anaconda3/include  -I"/home/foo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Group.cpp -o Group.o
Group.cpp: In function ‘herr_t dset_info(hid_t, const char*, const H5L_info_t*, void*)’:
Group.cpp:107:20: warning: comparison between ‘const enum H5L_type_t’ and ‘enum H5O_type_t’ [-Wenum-compare]
   if(info->type == H5O_TYPE_DATASET) {
                    ^
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/home/foo/anaconda3/include  -I"/home/foo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Helpers.cpp -o Helpers.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I/home/foo/anaconda3/include  -I"/home/foo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o h5.so Attribute.o Dataset.o Dataspace.o File.o Group.o Helpers.o RcppExports.o -L/home/foo/anaconda3/lib -L. -lhdf5_cpp -lhdf5 -lz -lm -L/usr/lib/R/lib -lR
installing to /home/foo/R/x86_64-pc-linux-gnu-library/3.4/h5/libs
** R
** inst
** 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/foo/R/x86_64-pc-linux-gnu-library/3.4/h5/libs/h5.so':
  libhdf5_cpp.so.12: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/foo/R/x86_64-pc-linux-gnu-library/3.4/h5’
* restoring previous ‘/home/foo/R/x86_64-pc-linux-gnu-library/3.4/h5’

The downloaded source packages are in
        ‘/tmp/RtmpusYerx/downloaded_packages’
Warning message:
In install.packages("h5") :
  installation of package ‘h5’ had non-zero exit status

After some digging, I realized that the installation depends on which hd5c++ to find the library of hdf5. So in the case of having an anaconda python, the library in the python distribution instead of the system one would be used during compiling and linking. The problem is that it cannot be loaded later.

mannau commented 7 years ago

duplicated, see https://github.com/mannau/h5/issues/44