R包安装:installation of package 'phangorn' had non-zero exit status

一、安装错误:installation of package 'phangorn' had non-zero exit status

在Ubuntu中,R包安装的过程中出现:installation of package 'phangorn' had non-zero exit status
'phangorn'是包名,其它的包出现这个错误时,解决办法类似。
这是一个比较概括性的错误,导致错误的根本原因在前面的安装过程中有详细的说明。
我在安装 'phangorn'包时,报的错是在安装第一个依赖ape时出现:

/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -llapack

二、/usr/bin/ld: cannot find -lxxx 解决方法

/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -llapack

-lxxx:l 代表 lib,xxx代表库名
在 /usr/lib 中相应的库的命名规则:lib+库名+.so

出现这个错误的原因可能有以下三种:
1、系统中没有安装相应的 lib
2、相应的 lib的版本不对
3、lib 的symbolic link不正确,没有连接到正确的函式库文件

解决方法:
1、先判断 /usr/lib 下的相应的函式库文件(.so)的symbolic link是否正确。
      ln -s libxxx.so.x libxxx.so
2、若不是第3点原因,就在系统中安装相应的 lib 即可。
      apt-get install libxxx-dev

在我的系统中,导致错误的是lib 的symbolic link不正确。我的做法是:

cd /usr/lib
ln -s libblas.so.12 libblas.so
发布了54 篇原创文章 · 获赞 66 · 访问量 10万+

猜你喜欢

转载自blog.csdn.net/qq_29837161/article/details/90599430