我正在尝试使用 Rstudio 安装包“bife”,但收到以下错误消息:
install.packages("bife")
also installing the dependency ‘RcppArmadillo’
trying URL 'https://cran.rstudio.com/src/contrib/RcppArmadillo_0.9.850.1.0.tar.gz' Content type 'application/x-gzip' length 1381269 bytes (1.3 MB)
================================================== downloaded 1.3 MB
trying URL 'https://cran.rstudio.com/src/contrib/bife_0.7.tar.gz' Content type 'application/x-gzip' length 119523 bytes (116 KB)
================================================== downloaded 116 KB
* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
** using staged installation 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... configure: error: in `/private/var/folders/z0/k6tlg2lj31ng3lhl1rgxdlqc0000gn/T/Rtmp310YLn/R.INSTALLb74e72b400c9/RcppArmadillo': configure: error: cannot run C++ compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details ERROR: configuration failed for package ‘RcppArmadillo’
* removing ‘/Users/myname/opt/anaconda3/lib/R/library/RcppArmadillo’ Warning in install.packages : installation of package ‘RcppArmadillo’ had non-zero exit status ERROR: dependency ‘RcppArmadillo’ is not available for package ‘bife’
* removing ‘/Users/myname/opt/anaconda3/lib/R/library/bife’ Warning in install.packages : installation of package ‘bife’ had non-zero exit status
The downloaded source packages are in ‘/private/var/folders/z0/k6tlg2lj31ng3lhl1rgxdlqc0000gn/T/Rtmp3EVGll/downloaded_packages’ Updating HTML index of packages in '.Library' Making 'packages.html' ... done
似乎问题出在某种 C++ 编译器上。我已经尝试了此处提供的解决方案并按照此链接中的步骤操作,但我仍然收到错误消息。我对终端的东西不满意,我只是将建议复制并粘贴到终端上。我正在使用 Rstudio 版本 1.1.456 和 R 版本 3.6.2。我的 macOS Catalina 是 10.15.4 版本。我真的无法安装或更新任何 R 包。感谢任何帮助。