我正在尝试安装R的R-pbh-5包,这需要h5r。当我尝试用h5r安装install_version("h5r", "1.4.7")时,会收到以下错误:
[...]
checking for library containing inflate... -lz
checking for library containing H5open... no
configure: error: Can't find HDF5
ERROR: configuration failed for package ‘h5r’我搜索了HDF5的Ubuntu包索引,并安装了库libhdf5-10、libhdf5-dev、hdf5-tools和pbh5tools。它似乎也被正确安装:
$ whereis hdf5
hdf5: /usr/include/hdf5我只是花了最后几个小时搜索,但我不知道我在这里错过了什么。有什么建议吗?
> sessionInfo()
R Under development (unstable) (2018-02-12 r74246)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.4 LTS
Matrix products: default
BLAS: /opt/R/3.5.0/lib/R/lib/libRblas.so
LAPACK: /opt/R/3.5.0/lib/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=de_DE.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=de_DE.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=de_DE.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.5.0 tools_3.5.0 yaml_2.1.17 Rhdf5lib_1.1.5按照评论中的建议,我更进一步了一步。当我跑步时:
R CMD INSTALL h5r_1.4.7.tar.gz --configure-vars="LDFLAGS='-L/usr/lib/x86_64-linux-gnu/hdf5/serial/' CPPFLAGS='-I/usr/include/hdf5/serial'"我现在收到以下错误:
-I/usr/include/hdf5/serial
-L/usr/lib/x86_64-linux-gnu/hdf5/serial/
checking for library containing inflate... -lz
checking for library containing H5open... -lhdf5
checking for sufficiently new HDF5... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c h5_debug.c -o h5_debug.o
h5_debug.c:4:18: fatal error: hdf5.h: No such file or directory
compilation terminated.
/usr/lib/R/etc/Makeconf:159: recipe for target 'h5_debug.o' failed
make: *** [h5_debug.o] Error 1
ERROR: compilation failed for package ‘h5r’发布于 2018-03-05 09:48:26
我设法做到了,虽然有点混乱。我使用sudo cp -rs /usr/include/hdf5/serial/* /usr/share/R/include创建指向R/include文件夹中所有hdf5文件的链接,默认情况下该链接包含在构建中。
https://askubuntu.com/questions/1010676
复制相似问题