R语言 Rstudio 安装 包 报错installation of package ‘*’ had non-zero exit status

在安装r语言向量自回归包(vars)时候报错了  记录一下供其他朋友参考,有同类相似其他问题也可以联系我一起解决。

​​​​​​先贴报错信息

> install.packages("vars")
Installing package into ‘/home/lvtoo/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘urca’

试开URL’https://cloud.r-project.org/src/contrib/urca_1.3-0.tar.gz'
Content type 'application/x-gzip' length 682935 bytes (666 KB)
==================================================
downloaded 666 KB

试开URL’https://cloud.r-project.org/src/contrib/vars_1.5-3.tar.gz'
Content type 'application/x-gzip' length 694522 bytes (678 KB)
==================================================
downloaded 678 KB

* installing *source* package ‘urca’ ...
** 成功将‘urca’程序包解包并MD5和检查
** libs
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c UnitRootMacKinnon.f -o UnitRootMacKinnon.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o urca.so UnitRootMacKinnon.o -llapack -lblas -lgfortran -lm -lquadmath -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'urca.so' failed
make: *** [urca.so] Error 1
ERROR: compilation failed for package ‘urca’
* removing ‘/home/lvtoo/R/x86_64-pc-linux-gnu-library/3.4/urca’
Warning in install.packages :
  installation of package ‘urca’ had non-zero exit status
ERROR: dependency ‘urca’ is not available for package ‘vars’
* removing ‘/home/lvtoo/R/x86_64-pc-linux-gnu-library/3.4/vars’
Warning in install.packages :
  installation of package ‘vars’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/Rtmp82zuGP/downloaded_packages’
我这里系统是 Linux Mint 19.2 (Ubuntu 18.04)

R版本是3.4.4

一开始百度搜了很多,什么tc tk tc-dev包,不知道有用没有。。。

 

直到我发现报错信息的关键一行

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

少依赖了嘛

cannot find -llapack

的意思是找不到,-l 是lib的意思 -l* *是lib名字

我这里linuxmint 直接用 apt 搜索一下 

apt search blas
apt search lapack

找到很多相似的包,找名字最接近的 

apt install libclblas-dev
apt install liblapack-dev

成功!

相同问题有需要可以邮箱联系我[email protected]

 

本文有参考以下链接:

https://blog.csdn.net/qq_39584315/article/details/79724038

你可能感兴趣的:(R语言,R语言,报错解决,安装扩展包)