如何在AWS EMR版本5.29中安装RcppArmadillo

问题描述

我正在尝试在AWS EMR版本5.29中使用sparkR shell安装RcppArmadillo。

这是我的sessionInfo()-

R version 3.4.1 (2017-06-30)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Amazon Linux AMI 2018.03

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  Grdevices utils     datasets  methods   base     

other attached packages:
[1] SparkR_2.4.4

loaded via a namespace (and not attached):
[1] compiler_3.4.1 tools_3.4.1 

这是我安装此软件包的代码-

package_path <- "/home/sma/"
install.packages('RcppArmadillo',repos = "http://cran.us.r-project.org",lib=package_path,dependencies = TRUE)

这是我执行install.packages()语句时遇到的失败-

 SparkSession available as 'spark'.
* 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++ -m64 accepts -g... yes
checking how to run the C++ preprocessor... g++ -m64 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ -m64 accepts -g... (cached) yes
checking whether we have a suitable tempdir... /tmp
checking whether R CMD SHLIB can already compile programs using OpenMP... no
checking whether g++ version is sufficient... yes,with OpenMP as version 7.2.1
checking for macOS... no
checking LAPACK_LIBS... R-supplied partial LAPACK found
configure: WARNING: Some complex-valued LAPACK functions may not be available
checking for OpenMP... found and suitable
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloConfigGenerated.h
config.status: creating src/Makevars
** libs
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG  -I"/home/sma/Rcpp/include" -I/usr/local/include  -I../inst/include -fopenmp -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c RcppArmadillo.cpp -o RcppArmadillo.o
In file included from ../inst/include/RcppArmadilloForward.h:49:0,from ../inst/include/RcppArmadillo.h:31,from RcppArmadillo.cpp:22:
../inst/include/armadillo:70:12: Fatal error: omp.h: No such file or directory
   #include <omp.h>
            ^~~~~~~
compilation terminated.
make: *** [RcppArmadillo.o] Error 1
ERROR: compilation Failed for package ‘RcppArmadillo’
* removing ‘/home/sma/RcppArmadillo’

The downloaded source packages are in
    ‘/mnt/tmp/RtmpQmFZ4n/downloaded_packages’
Warning messages:
1: In install.packages("RcppArmadillo",:
  installation of package ‘slam’ had non-zero exit status
2: In install.packages("RcppArmadillo",:
  installation of package ‘RcppArmadillo’ had non-zero exit status

解决方法

您正在运行“ R版本3.4.1(2017-06-30)”,所以我建议您选择一个类似年份的RcppArmadillo版本。 archive directory at CRAN,sorted by date建议版本RcppArmadillo_0.7.960.1.0于2017年8月17日发布,或者在您拥有(古老的)R版本之后不久。

您当然可以加入现在的版本而不是过去,但是为此,我建议您使用最新的R 4.0.3以及与几年前相反的最新OS版本。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...