【发布时间】:2017-12-30 17:22:47
【问题描述】:
我使用的是 R 版本 3.4.0
我正在尝试在 linux 机器上安装 tseries 包:
install.packages('https://cran.cnr.berkeley.edu/src/contrib/tseries_0.10-42.tar.gz',dependencies = TRUE,repos = NULL,type ="source")
It gives error:
ERROR: compilation failed for package 'xts'
* removing '/usr/lib64/R/library/xts'
ERROR: dependency 'xts' is not available for package 'TTR'
* removing '/usr/lib64/R/library/TTR'
ERROR: dependencies 'xts', 'TTR' are not available for package 'quantmod'
* removing '/usr/lib64/R/library/quantmod'
ERROR: dependencies 'quadprog', 'quantmod' are not available for package 'tseries'
* removing '/usr/lib64/R/library/tseries'
1: In install.packages("tseries", dependencies = TRUE) :
installation of package 'quadprog' had non-zero exit status
2: In install.packages("tseries", dependencies = TRUE) :
installation of package 'xts' had non-zero exit status
3: In install.packages("tseries", dependencies = TRUE) :
installation of package 'TTR' had non-zero exit status
4: In install.packages("tseries", dependencies = TRUE) :
installation of package 'quantmod' had non-zero exit status
5: In install.packages("tseries", dependencies = TRUE) :
installation of package 'tseries' had non-zero exit status
然后我尝试使用以下方法安装 quadprog:
install.packages('https://cran.cnr.berkeley.edu/src/contrib/quadprog_1.5-5.tar.gz',dependencies = TRUE,repos = NULL,type ="source")
它给出了错误:
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [quadprog.so] Error 1
ERROR: compilation failed for package 'quadprog'
* removing '/usr/lib64/R/library/quadprog'
请帮助我该怎么办。我在安装这些软件包时遇到了困难。
我已经安装了 R 使用:
sudo yum -y install R-core R-devel
我尝试安装 gfortran 使用:yum install gcc-gfortran
它说:包 gcc-gfortran-4.4.7-18.el6.x86_64 已经安装和最新版本 无事可做
【问题讨论】:
-
只需阅读错误消息:
cannot find -lgfortran。所以安装一个 Fortran 编译器,大概是与gcc和g++二进制文件相同版本的gfortran。 -
如何安装,请告知。我有 gcc (GCC) 4.7.2 20121015 (Red Hat 4.7.2-5)
-
请检查编辑。我尝试安装 gfortran
-
这样你就有了 Fortran 编译器。您仍然需要 Fortran
-dev包,提供您未能链接到的 Fortran 库。我不知道 RedHat/CentOS 怎么称呼它——在 Debian 下它会是libgfortran-6-devforgcc-6等等。 -
请帮我为 RedHat/CentOS 找到它。没找到
标签: r linux yum install.packages