make: *** [surfaceArea.o] Error 1 ERROR: compilation failed for package ‘sp’ * removing ‘/share/work/biosoft/R/R-v4.2.2/lib64/R/library/sp’ * installing *source* package ‘Rcpp’ ... ** package ‘Rcpp’ successfully unpacked and MD5 sums checked ** using staged installation ** libs g++ -std=gnu++14 -I"/share/work/biosoft/R/R-v4.2.2/lib64/R/include" -DNDEBUG -I../inst/include/ -I/share/work/biosoft/zlib/include -I/share/work/biosoft/bzip2/bzip2-v1.0.6/include/ -I/share/work/biosoft/xz/xz-v5.2.3/include -I/share/work/biosoft/pcre/pcre2-v10.36/include -I/share/work/biosoft/curl/curl-v7.47.1/include -fpic -g -O2 -c api.cpp -o api.o g++: error: unrecognized command line option ‘-std=gnu++14’ make: *** [api.o] Error 1 ERROR: compilation failed for package ‘Rcpp’ * removing ‘/share/work/biosoft/R/R-v4.2.2/lib64/R/library/Rcpp’ ERROR: dependency ‘Rcpp’ is not available for package ‘RcppArmadillo’ * removing ‘/share/work/biosoft/R/R-v4.2.2/lib64/R/library/RcppArmadillo’ ERROR: dependencies ‘sp’, ‘Rcpp’, ‘RcppArmadillo’ are not available for package ‘ade4’ * removing ‘/share/work/biosoft/R/R-v4.2.2/lib64/R/library/ade4’ ERROR: dependency ‘ade4’ is not available for package ‘seqinr’ * removing ‘/share/work/biosoft/R/R-v4.2.2/lib64/R/library/seqinr’
有些R包是高版本c编译过来的,就需要你计算机上有对应版本以上的编译器,如我这里报错‘-std=gnu++14’,
这个换算过来大概需要g++11以上,可是我当然是有这个版本的编译器的,却仍然报错,为什么呢?
因为默认的mark文件设置没对,这个文件位置如下
R-v4.2.2/lib64/R/etc/Makeconf
这个目录结构用R的应该都能看懂
这就是文件的样子,画红框的两地方是需要修改的
CC是gcc,cxx是g++,都改成绝对路径就行
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!