Unable to install hdf5r package - MacOS, R 4.1
Hello, I recently upgraded R to version 4.1 and am no longer able to install hdf5r (Warning in install.packages installation of package 'hdf5r' had non-zero exit status). If I install from source, I get the following error: Error: package or namespace load failed for 'hdf5r' in dyn.load. I've also tried to install from brew (Terminal); however, R does not seem to recognize that it is installed. Any help would be appreciated.
This might help. https://github.com/hhoeflin/hdf5r/issues/171#issuecomment-891367729
On an M1 Mac the comment from above allowed R to find hdf5 but still could not install. :(
* installing *source* package ‘hdf5r’ ...
** package ‘hdf5r’ successfully unpacked and MD5 sums checked
** using staged installation
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking for grep that handles long lines and -e... /usr/bin/grep
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking Using provided HDF5 C wrapper... ~/miniforge3/bin/h5cc
checking for HDF5 libraries... yes (version 1.12.1)
checking hdf5.h usability... no
checking hdf5.h presence... yes
configure: WARNING: hdf5.h: present but cannot be compiled
configure: WARNING: hdf5.h: check for missing prerequisite headers?
configure: WARNING: hdf5.h: see the Autoconf documentation
configure: WARNING: hdf5.h: section "Present But Cannot Be Compiled"
configure: WARNING: hdf5.h: proceeding with the compiler's result
configure: WARNING: ## --------------------------------- ##
configure: WARNING: ## Report this to [email protected] ##
configure: WARNING: ## --------------------------------- ##
checking for hdf5.h... no
checking for H5Fcreate in -lhdf5... no
configure: WARNING: Unable to compile HDF5 test program
checking for hdf5_hl.h... no
checking for H5LTpath_valid in -lhdf5_hl... no
configure: WARNING: Unable to compile HDF5_HL test program
checking for main in -lhdf5_hl... no
checking for matching HDF5 Fortran wrapper... no
Found hdf5 with version: 1.12.1
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
I've managed to install hdf5r 1.3.2; however, I am now getting this error. Any ideas on how to fix this?
Error: package or namespace load failed for ‘hdf5r’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/hdf5r/libs/hdf5r.so': dlopen(/Library/Frameworks/R.framework/Versions/4.1/Resources/library/hdf5r/libs/hdf5r.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib Referenced from: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/hdf5r/libs/hdf5r.so Reason: image not found
I was wondering if I can get the result of the following scripts?
Open R, run
sessionInfo()
R.version
Then open your terminal, type
h5cc --version
If h5cc is not found, try /opt/homebrew/bin/h5cc --version
Thanks
https://github.com/hhoeflin/hdf5r/issues/171#issuecomment-891367729 this worked for me after I just upgraded to newest version of R (ARM). Thank you @dipterix !
> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Big Sur 11.5.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.1.1 tools_4.1.1
> R.version
_
platform aarch64-apple-darwin20
arch aarch64
os darwin20
system aarch64, darwin20
status
major 4
minor 1.1
year 2021
month 08
day 10
svn rev 80725
language R
version.string R version 4.1.1 (2021-08-10)
nickname Kick Things
/opt/homebrew/bin/h5cc --version
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: arm64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin