rpackagefailed-installation

Installing R package from CRAN archive has non-zero exit status


I need to install fwildclusterboot, a package that has been removed from CRAN.

I tried installing it as follows:

library(devtools)
install_url("https://cran.r-project.org/src/contrib/Archive/fwildclusterboot/fwildclusterboot_0.9.tar.gz")

However, I end up getting the following error message at the end of the installation process (I have a MacBook, MacOS Monterey 12.5.1, and my RStudio is version 2022.07.1):

ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [fwildclusterboot.so] Error 1
ERROR: compilation failed for package ‘fwildclusterboot’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/fwildclusterboot’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/1n/m1g55_416rj6m4w3v6v9x2340000gn/T//RtmppWJnds/fileaae0dc5e6aa/fwildclusterboot_0.9.tar.gz’ had non-zero exit status

How can I solve this?


Solution

  • I had the same problem some months before, this is the easy way, Go to: https://github.com/fxcoudert/gfortran-for-macOS/releases an you'll find the lastest version for Monterey with an easy installer (.dmg), select depending if you have an ARM or Intel based computer.