美文网首页R语言问题集锦
CentOS上由libgfortran.so.4引起的R包igr

CentOS上由libgfortran.so.4引起的R包igr

作者: xuzhougeng | 来源:发表于2019-10-14 17:30 被阅读0次

在R发布了3.6.1之后,我在我的CentOS服务器上编译了这个版本的R语言,随后就是开始安装各种R包。在安装clusterProfiler时,其中的一个R包igraph安装出现了如下报错

Error: package or namespace load failed for ‘igraph’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/opt/sysoft/R-3.6.1/lib64/R/library/00LOCK-igraph/00new/igraph/libs/igraph.so':
  libgfortran.so.4: cannot open shared object file: No such file or directory

根据我多年的debug经验,推测出应该是gfortran这个工具没有安装好, 我检索了/usr/lib64下的动态库,发现果然没有

ls /usr/lib64/ | grep fortran
gfortran
libgfortran.so.1
libgfortran.so.1.0.0
libgfortran.so.3
libgfortran.so.3.0.0
libhdf5_fortran.so.8
libhdf5_fortran.so.8.0.1
libhdf5hl_fortran.so.8
libhdf5hl_fortran.so.8.0.1

于是用yum search gfortran搜索是不是能够直接用YUM安装

compat-libgfortran-41-debuginfo.x86_64 : Debug information for package compat-libgfortran-41
compat-gcc-44-gfortran.x86_64 : Fortran support for compatibility compiler
compat-libgfortran-41.x86_64 : Compatibility Fortran 95 runtime library version 4.1.2
compat-libgfortran-41.i686 : Compatibility Fortran 95 runtime library version 4.1.2
gcc-gfortran.x86_64 : Fortran support
libgfortran.x86_64 : Fortran runtime
libgfortran.i686 : Fortran runtime
libgfortran-static.i686 : Static Fortran libraries
libgfortran-static.x86_64 : Static Fortran libraries
libgfortran4.i686 : Fortran runtime v4
libgfortran4.x86_64 : Fortran runtime v4
libgfortran5.i686 : Fortran runtime v5
libgfortran5.x86_64 : Fortran runtime v5
mingw32-gcc-gfortran.x86_64 : MinGW Windows cross-compiler for FORTRAN for the win32 target
mingw64-gcc-gfortran.x86_64 : MinGW Windows cross-compiler for FORTRAN for the win64 target

使用yum install libgfortran4安装即可,之后便能找到该动态库

ls /usr/lib64/ | grep fortran
gfortran
libgfortran.so.1
libgfortran.so.1.0.0
libgfortran.so.3
libgfortran.so.3.0.0
libgfortran.so.4
libgfortran.so.4.0.0
libhdf5_fortran.so.8
libhdf5_fortran.so.8.0.1
libhdf5hl_fortran.so.8
libhdf5hl_fortran.so.8.0.1

后续就能顺利安装了

假如你没有root权限,那么可以参考下面两篇进行解决

相关文章

网友评论

    本文标题:CentOS上由libgfortran.so.4引起的R包igr

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