Redhat Linux 5.9 安装R包RcppArmadillo时报错

来源:互联网 发布:淘宝2016年韩版羽绒服 编辑:程序博客网 时间:2024/05/29 17:24

错误描述:

在安装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/
http://cran.r-project.org/src/contrib/Archive/forecast/


手动安装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://stackoverflow.com/questions/23921158/rcpparmadillo-compilation-error
http://www.cnblogs.com/xianghang123/archive/2011/12/06/2277644.html
0 0