作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在尝试许多不同的方法来安装 RcppArmadillo,但我没有让它工作
install.packages(c('Rcpp'))
Sys.setenv("PKG_CXXFLAGS"="-std=c++11")
install.packages(c('RcppArmadillo'),type = "source")
它给我这个错误:
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
ld: library not found for -lquadmath
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [RcppArmadillo.so] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo’
很明显,我没有x86_64-apple-darwin18/8.2.0
,因为我安装了gfortran for the apple silicon architecture .
苹果版:
macOS Big Sur
11.2.3
Apple M1
R 版:
version
_
platform x86_64-apple-darwin17.0
arch x86_64
os darwin17.0
system x86_64, darwin17.0
status
major 4
minor 0.4
year 2021
month 02
day 15
svn rev 80002
language R
version.string R version 4.0.4 (2021-02-15)
nickname Lost Library Book
最佳答案
我想我发现了一个问题。首先,我遵循本教程:R COMPILER TOOLS FOR RCPP ON MACOS
完成后,它给了我几乎与您在帖子中提到的相同的错误:
ld: warning: directory not found for option '-L/opt/R/arm64/gfortran/.....'
ld: library not found for -lgfortran clang: error: linker command failed
with exit code 1 (use -v to see invocation)
看来,R 正在/opt/R/arm64
文件夹中寻找gfortran。
在教程中,它表明 gfortran 安装在 /usr/local/gfortran
文件夹中。
我在 /opt/R/arm64
中创建了一个符号链接(symbolic link),它使用命令
引用/usr/local/gfortran
ln -s/usr/local/gfortran/opt/R/arm64
关于r - 如何在 Apple Silicon (M1) Mac 上安装 RcppArmadillo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66817276/
我是一名优秀的程序员,十分优秀!