红联Linux门户
Linux帮助

Redhat Linux安装R包RcppArmadillo时报错

发布时间:2016-09-30 15:29:30来源:linux网站作者:常飞梦
错误描述:
在安装forecast包时需要安装RcppArmadillo依赖包,但在安装RcppArmadillo包时报下面的错误:
../inst/include/RcppArmadilloForward.h:37, from ../inst/include/RcppArmadillo.h:30, from RcppArmadillo.cpp:22: 
../inst/include/armadillo_bits/compiler_setup.hpp:119:6: error: #error "*** Need a newer compiler ***"
/picb/molsysbio/usr/liudenghui/software/R/lib/Rcpp/include/Rcpp/Date.h: In member function ‘void Rcpp::Date::update_tm()’:
/picb/molsysbio/usr/liudenghui/software/R/lib/Rcpp/include/Rcpp/Date.h:108: warning: converting to ‘time_t’ from ‘double’
/picb/molsysbio/usr/liudenghui/software/R/lib/Rcpp/include/Rcpp/Date.h: In function ‘Rcpp::Date Rcpp::operator+(const Rcpp::Date&, int)’:
/picb/molsysbio/usr/liudenghui/software/R/lib/Rcpp/include/Rcpp/Date.h:139: warning: converting to ‘time_t’ from ‘double’
make: *** [RcppArmadillo.o] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/picb/molsysbio/usr/liudenghui/software/R/lib/RcppArmadillo’
The downloaded source packages are in
‘/tmp/RtmpxYrB2A/downloaded_packages’
Warning message:
In install.packages("RcppArmadillo") :
installation of package ‘RcppArmadillo’ had non-zero exit status
 
原因:
在使用install.packages("forecast")安装包时,R会搜索最新的相关的安装包进行安装,如果操作系统的版本较低与R包不兼容,就会出现编译等错误。
 
解决办法:
升级系统版本或是安装较低版本的R包
下载低版本R包:
http://cran.r-project.org/src/contrib/Archive/RcppArmadillo/
Redhat Linux安装R包RcppArmadillo时报错
http://cran.r-project.org/src/contrib/Archive/forecast/
Redhat Linux安装R包RcppArmadillo时报错
手动安装R包:
# R CMD INSTALL -l /usr/lib64/R/library RcppArmadillo_0.3.930.1.tar.gz
# R CMD INSTALL -l /usr/lib64/R/library forecast_5.0.tar.gz
 
本文永久更新地址:http://www.linuxdiyf.com/linux/24624.html