我正在尝试在 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", repos = "http://cran.us.r-project.org", :
installation of package ‘slam’ had non-zero exit status
2: In install.packages("RcppArmadillo", repos = "http://cran.us.r-project.org", :
installation of package ‘RcppArmadillo’ had non-zero exit status