liunx 安装RcppArmadillo时:Only g++ version 4.7.2 or greater can be used with RcppArmadillo

install.packages('RcppArmadillo')
trying URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/RcppArmadillo_0.8.400.0.0.tar.gz'
Content type 'application/octet-stream' length 1332745 bytes (1.3 MB)
==================================================
downloaded 1.3 MB


* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking whether g++ version is sufficient... no
configure: WARNING: Only g++ version 4.7.2 or greater can be used with RcppArmadillo.
configure: error: Please use a different compiler.
ERROR: configuration failed for package ‘RcppArmadillo’
* removing ‘/home/cheng/R/R-3.3.1/lib64/R/library/RcppArmadillo’


The downloaded source packages are in
‘/tmp/RtmphDefkB/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("RcppArmadillo") :

  installation of package ‘RcppArmadillo’ had non-zero exit status

解决方法:

安装低版本的包

install.packages("https://cran.r-project.org/src/contrib/Archive/RcppArmadillo/RcppArmadillo_0.3.930.1.tar.gz", repos=NULL)

成功:

installing to /home/cheng/R/R-3.3.1/lib64/R/library/RcppArmadillo/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (RcppArmadillo)

> library('RcppArmadillo')


猜你喜欢

转载自blog.csdn.net/c1z2w3456789/article/details/79789539
今日推荐