grimbough / rhdf5

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

g++: error: [1]: No such file or directory #110

Closed grimbough closed 1 year ago

grimbough 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"

Originally posted by @Jorges1000 in https://github.com/grimbough/rhdf5/issues/108#issuecomment-1125552342

grimbough commented 2 years ago

I made some changes to Rhdf5lib yesterday which I think might affect this. Can you try installing both Rhdf5lib and rhdf5 from Github e.g.

devtools::install_github('grimbough/Rhdf5lib')
devtools::install_github('grimbough/rhdf5')
Jorges1000 commented 2 years ago

Hi, thanks for your reply. Rhdf5Lib installed fine but same error for rhdf5

gcc -I"/usr/share/R/include" -DNDEBUG -I'/shared/apps/R/4.2.0/Library/Rhdf5lib/include' -fpic -g -O2 -fdebug-prefix-map=/build/r-base-kt0bjq/r-base-4.2.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c wrap.c -o wrap.o g++ -std=gnu++14 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -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 H5R.o H5S.o H5S_extras.o H5T.o H5Z.o H5constants.o HandleList.o HandleListWrap.o bit64conversion.o external_filters.o h5dump.o h5ls.o h5testLock.o h5writeDataFrame.o printdatatype.o utils.o wrap.o [1] /shared/apps/R/4.2.0/Library /usr/local/lib/R/site-library /shared/apps/R/4.2.0/Library/Rhdf5lib/lib/libhdf5.a -lcrypto -lcurl -lsz -laec -lz -ldl -lm -L/usr/lib/R/lib -lR g++: error: [1]: No such file or directory /usr/share/R/share/make/shlib.mk:10: recipe for target 'rhdf5.so' failed make: *** [rhdf5.so] Error 1 ERROR: compilation failed for package ‘rhdf5’

grimbough commented 2 years ago

I just realised there's a [1] in the line before the error, which I think is the problem.

If you run this command in a shell, what does it output?

Rscript -e 'Rhdf5lib::pkgconfig("PKG_C_LIBS")'
Jorges1000 commented 2 years ago

I get this: [1] "/shared/apps/R/4.2.0/lib/R/library" "/shared/apps/R/4.2.0/lib/R/library/Rhdf5lib/lib/libhdf5.a" -lcrypto -lcurl -lsz -laec -lz -ldl -lm jsepulveda@ip-XXX-XX-XX-XX:~$

grimbough commented 2 years ago

Ok, so the problem is that first line. That's being printed by R as it starts and is being inserted into the compiler commands, which aren't expecting it and causing the problem.

I suspect it's coming from an entry in your .Rprofile file. Maybe you have a good reason for the line to be printed, but I would try stopping that and then trying to reinstall rhdf5.