【问题标题】:Error when installing bife package on Mac: RcppArmadillo在 Mac 上安装 bife 包时出错:RcppArmadillo
【发布时间】:2020-07-13 14:37:30
【问题描述】:

我正在尝试使用 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++ 编译器上。我已经尝试了here 提供的解决方案,并按照link 中的步骤操作,但我仍然收到错误消息。我对终端的东西不满意,我只是将建议复制并粘贴到终端上。我正在使用 Rstudio 版本 1.1.456 和 R 版本 3.6.2。我的 macOS Catalina 是 10.15.4 版本。我真的无法安装或更新任何 R 包。感谢任何帮助。

【问题讨论】:

  • 嗨,新手,你能提供你的~/.R/Makevars 文件的内容吗?您可以在 R 中使用 system("cat ~/.R/Makevars") 轻松获取它。
  • 嗨@IanCampbell,这里是内容:CFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk CCFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk CXXFLAGS =-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk CPPFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include SHLIB_CXXLDFLAGS+=-Wl,-rpath,${R_HOME }/lib ${R_HOME}/lib/libc++abi.1.dylib SHLIB_CXX14LDFLAGS+=-Wl,-rpath,${R_HOME}/lib ${R_HOME}/lib/libc++abi.1.dylib

标签: r macos installation-package rcpparmadillo


【解决方案1】:

花了两天的时间寻找解决方案,我终于下载了最新版本的Rstudio(1.2.5033)并修复了问题。现在我可以毫无问题地安装任何 R 包。不确定解决方案的知识渊博,但只是想报告问题已得到解决。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-13
    • 2018-09-10
    • 2018-05-03
    • 2016-03-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多