grimbough / rhdf5

Package providing an interface between HDF5 and R
http://bioconductor.org/packages/rhdf5
59 stars 22 forks source link

comfuse with compile error 'No such file or directory' #108

Open picsaver opened 2 years ago

picsaver commented 2 years ago

Hi there,please help! I tried to install rhdf5 in my R-3.6, so I installed with rhdf5 archive file in root permission as following:

> install.packages( "https://www.bioconductor.org/packages/3.9/bioc/src/contrib/Archive/rhdf5/rhdf5_2.28.0.tar.gz", type = 'source', repos=NULL)

Installing package into ‘/usr/lib64/R/library’
* installing *source* package ‘rhdf5’ ...
** using staged installation
** libs
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG  -I"/usr/lib64/R/library/Rhdf5lib/include" -I/usr/local/include  -fpic  -O2 -g -pipe -Wall-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c H5.c -o H5.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG  -I"/usr/lib64/R/library/Rhdf5lib/include" -I/usr/local/include  -fpic  -O2 -g -pipe -Wall-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c H5A.c -o H5A.o
...
...
...
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG  -I"/usr/lib64/R/library/Rhdf5lib/include" -I/usr/local/include  -fpic  -O2 -g -pipe -Wall-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c wrap.c -o wrap.o
g++ -m64 -std=gnu++11 -shared -L/usr/lib64/R/lib -Wl,-z,relro -o rhdf5.so H5.o H5A.o H5D.o H5E.o H5F.o H5G.o H5I.o H5L.o H5O.o H5P.o H5S.oH5T.o H5Z.o H5constants.o HandleList.o HandleListWrap.o h5dump.o h5ls.o h5testLock.o h5writeDataFrame.o printdatatype.o wrap.o "/usr/lib64/R/library/Rhdf5lib/lib/libhdf5_cpp.a" "/usr/lib64/R/library/Rhdf5lib/lib/libhdf5.a" "/usr/lib64/R/library/Rhdf5lib/lib/libsz.a" -lz -L/usr/lib64/R/lib -lR
g++:  error:"/usr/lib64/R/library/Rhdf5lib/lib/libhdf5_cpp.a":No such file or directory
g++:  error:"/usr/lib64/R/library/Rhdf5lib/lib/libhdf5.a":No such file or directory
g++:  error:"/usr/lib64/R/library/Rhdf5lib/lib/libsz.a":No such file or directory
make: *** [rhdf5.so] Error 1
ERROR: compilation failed for package ‘rhdf5’
* removing ‘/usr/lib64/R/library/rhdf5’

However, I had installed Rhdf5lib-1.8.0 in /usr/lib64/R/library/Rhdf5lib, and those .a files indeed in the path!

# ls -l /usr/lib64/R/library/Rhdf5lib/lib/*.a
-rw-r--r--. 1 root root 26273624 Feb  28 10:58 /usr/lib64/R/library/Rhdf5lib/lib/libhdf5.a
-rw-r--r--. 1 root root  4888632 Feb  28 10:58 /usr/lib64/R/library/Rhdf5lib/lib/libhdf5_cpp.a
-rw-r--r--. 1 root root   935818 Feb  28 10:58 /usr/lib64/R/library/Rhdf5lib/lib/libhdf5_hl.a
-rw-r--r--. 1 root root    67502 Feb  28 10:58 /usr/lib64/R/library/Rhdf5lib/lib/libhdf5_hl_cpp.a
-rw-r--r--. 1 root root    59826 Feb  28 10:58 /usr/lib64/R/library/Rhdf5lib/lib/libsz.a

R sessionInfo as following

> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.6.0 tools_3.6.0

Regards !

grimbough commented 2 years ago

I'm afraid I don't have much insight here. As you say, the linking looks fine and if the files exist I don't know why it wouldn't work.

There are a lot of compiler flags in your output that I'm not familiar with, so possibly one of them is causing behaviour I've not seen before.

I'll also point out that R 3.6.0 and the corresponding versions of Bioconductor are now quite old. I'm not able to update the version of rhdf5 that corresponds to that R version even if we figure out what the problem is.

Jorges1000 commented 2 years ago

I have the same problem but with the recent version of R: ─ Session info ─────── version R version 4.2.0 (2022-04-22) os Ubuntu 18.04.6 LTS system x86_64, linux-gnu ui RStudio

same using either BiocManager::install (1.30.17) and devtools::install_github (2.4.3):

devtools::install_github('grimbough/rhdf5') Downloading GitHub repo grimbough/rhdf5@HEAD ✔ checking for file ‘/tmp/RtmprZpRxG/remotes44076eee0636/grimbough-rhdf5-7fdd4e2/DESCRIPTION’ ... ─ preparing ‘rhdf5’: ✔ checking DESCRIPTION meta-information ... ─ cleaning src ─ running ‘cleanup’ ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘rhdf5_2.39.6.tar.gz’

Installing package into '/shared/apps/R/4.2.0/Library' (as 'lib' is unspecified) [1] "/shared/apps/R/4.2.0/Library" "/usr/local/lib/R/site-library"

grimbough commented 2 years ago

@Jorges1000 Thanks for the report. Although they're similar error message I don't think the root cause is the same, so I've open a separate issue at #110. We can track your problem there.