首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >R包h5r配置:错误:找不到HDF5

R包h5r配置:错误:找不到HDF5
EN

Ask Ubuntu用户
提问于 2018-02-28 14:44:42
回答 1查看 805关注 0票数 4

我正在尝试安装R的R-pbh-5包,这需要h5r。当我尝试用h5r安装install_version("h5r", "1.4.7")时,会收到以下错误:

代码语言:javascript
复制
[...]
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-10libhdf5-devhdf5-toolspbh5tools。它似乎也被正确安装:

代码语言:javascript
复制
$ whereis hdf5
hdf5: /usr/include/hdf5

我只是花了最后几个小时搜索,但我不知道我在这里错过了什么。有什么建议吗?

代码语言:javascript
复制
> 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

更新1:

按照评论中的建议,我更进一步了一步。当我跑步时:

代码语言:javascript
复制
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'"

我现在收到以下错误:

代码语言:javascript
复制
-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’
EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2018-03-05 09:48:26

我设法做到了,虽然有点混乱。我使用sudo cp -rs /usr/include/hdf5/serial/* /usr/share/R/include创建指向R/include文件夹中所有hdf5文件的链接,默认情况下该链接包含在构建中。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1010676

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档