美文网首页
R包hdf5r安装报错-load filed

R包hdf5r安装报错-load filed

作者: 一只孢子 | 来源:发表于2020-12-16 09:41 被阅读0次

问题

在linux上安装R包Seurat的依赖包 hdf5r
hdf5r是R中读取hdf5格式文件的包

报错信息

error.png

> install.packages('hdf5r')
...
configure: WARNING: hdf5.h: proceeding with the compiler's result
configure: WARNING: ## --------------------------------- ##
configure: WARNING: ## Report this to hhoeflin@gmail.com ##
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... /home/usr/anaconda3/bin/h5fc
...
** testing if installed package can be loaded
Error: package or namespace load failed for ‘hdf5r’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/usr/R/x86_64-pc-linux-gnu-library/3.4/hdf5r/libs/hdf5r.so':
libhdf5_hl.so.100: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/fux/R/x86_64-pc-linux-gnu-library/3.4/hdf5r’
* restoring previous ‘/home/fux/R/x86_64-pc-linux-gnu-library/3.4/hdf5r’
The downloaded source packages are in ‘/tmp/RtmpGAvcWv/downloaded_packages’
Warning message:
In install.packages("hdf5r") :
installation of package ‘hdf5r’ had non-zero exit status

环境

操作系统版本
Linux version 3.13.0-161-generic (buildd@lcy01-amd64-003) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4) )
R版本
R version 3.4.4

解决方案

查看系统上是否有 libhdf5_hl.so.100
locate libhdf5_hl.so.100
在R中查看库路径环境变量
Sys.getenv("LD_LIBRARY_PATH")
.bashrc中添加 libhdf5_hl.so.100 的库路径
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/usr/anaconda/lib
重启终端

Warning

虽然可以安装成功,前面有一堆warnings,主要是hdf5.h的问题,不知道是为什么。在发生了load filed报错后,还做过一些其他的尝试,解决动态库的问题。对R的配置,使用配置文件.Renviron.Rprofile

相关文章

网友评论

      本文标题:R包hdf5r安装报错-load filed

      本文链接:https://www.haomeiwen.com/subject/ilcwgktx.html