1

I am trying to install the package 'bife' using Rstudio but get the following error message:

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

It seems the issue is with some kind of C++ compiler. I have tried the solution provided here and followed steps in this link, but I am still getting the error. I am not comfortable with the terminal stuff and all and I just copied and pasted the suggestions on to the terminal. I am using Rstudio version 1.1.456 and R version 3.6.2. My macOS Catalina is version 10.15.4. I am really stuck not being able to install or update any R packages. Appreciate any help.

Rnovice
  • 333
  • 1
  • 5
  • 18
  • Hi Rnovice, can you provide the contents of your `~/.R/Makevars` file? You can get it easily from within R with `system("cat ~/.R/Makevars")`. – Ian Campbell Apr 01 '20 at 18:26
  • Hi @IanCampbell, here is the content: 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 – Rnovice Apr 01 '20 at 18:29

1 Answers1

0

After spending two days searching for solutions, I finally downloaded the latest version of Rstudio (1.2.5033) and fixed the problem. Now I am able to install any R package without issues. Not sure how knowledgeable the solution is, but just wanted to report that the problem has been fixed.

Rnovice
  • 333
  • 1
  • 5
  • 18