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

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?

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.

Related

Unable to install package "quanteda.textstats" in R under Ubuntu 22.04.1 LTS

I am trying to install the package quanteda.textstats in R under Ubuntu Version 22.04.1 LTS.
I initially ran:
install.packages("quanteda.textstats")
where I got an error message saying it could not install the dependency proxyC. I was able to install that, but I still get an error message when running the above code.
/usr/bin/ld: cannot find -llapack: No such file or directory
/usr/bin/ld: cannot find -lblas: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:10: quanteda.textstats.so] Error 1
ERROR: compilation failed for package ‘quanteda.textstats’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/4.2/quanteda.textstats’
Warning in install.packages :
installation of package ‘quanteda.textstats’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpuUtAq1/downloaded_packages’
I would guess I am missing certain dependencies, but I am unable to figure out what -llapack and -lblas stands for.
I also tried running the github install (option 3):
remotes::install_github("quanteda/quanteda.textstats")
but there as well I get a similar error:
/usr/bin/ld: cannot find -llapack: No such file or directory
/usr/bin/ld: cannot find -lblas: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:10: quanteda.textstats.so] Error 1
ERROR: compilation failed for package ‘quanteda.textstats’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/4.2/quanteda.textstats’
Warning message:
In i.p(...) :
installation of package ‘/tmp/RtmpuUtAq1/file17581cc7f39c/quanteda.textstats_0.96.tar.gz’ had non-zero exit status
Can anybody help please?
Your are trying to compile the package which requires to have certain system dependencies installed, in this case lblas and llapack. This is not the recommended way to install R packages on Ubuntu. Instead you should install them as PPAs as described on CRAN.
If you insist on compiling the package yourself, install the dependencies via apt in the system terminal:
sudo apt-get install libblas-dev liblapack-dev

How can I download R package APE

I am using this code to download ape on R version 3.6.0:
install.packages("ape", dependencies = T)
and I am finding the following errors:
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.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: *** [ape.so] Error 1
ERROR: compilation failed for package ‘ape’
I have attempted to download using the terminal too and this has also failed. I have checked the R version and APE is compatible with Rv3.6. Any ideas why this package cannot be downloaded?
check your R version, because i intalled 1 min ago and i'm not have problem.

How to install edgeR package using R4.2.0, BiocManager?

I tried to install edgeR with the following:
if (!require("BiocManager", quietly = TRUE)); install.packages("BiocManager"; BiocManager::install("edgeR")
This is the message I got
Bioconductor version 3.15 (BiocManager 1.30.18), R 4.2.0 (2022-04-22)
Installing package(s) 'edgeR' Warning: unable to access index for
repository
https://bioconductor.org/packages/3.15/bioc/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/bioc/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Warning: unable to access index for repository
https://bioconductor.org/packages/3.15/data/annotation/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/data/annotation/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Warning: unable to access index for repository
https://bioconductor.org/packages/3.15/data/experiment/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/data/experiment/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Warning: unable to access index for repository
https://bioconductor.org/packages/3.15/workflows/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/workflows/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Warning: unable to access index for repository
https://bioconductor.org/packages/3.15/books/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/books/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘edgeR’
Do you want to attempt to install these from sources? (Yes/no/cancel)
so I pressed yes, then,i got the warning message
ld: warning: directory not found for option
'-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1'
ld: warning: directory not found for option
'-L/opt/R/arm64/gfortran/lib' ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see
invocation) make: *** [edgeR.so] Error 1 ERROR: compilation failed for
package ‘edgeR’
removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/edgeR’
The downloaded source packages are in
‘/private/var/folders/kt/6_fbqvnx7p94hxygb7x6qbnc0000gr/T/RtmpG39FBI/downloaded_packages’
Warning message: In install.packages(...) : installation of package
‘edgeR’ had non-zero exit status
Please advise on what I should to fix this problem.
As a Macbook pro (Monterey) M1 user, I re-installed R package (R-4.2.0.pkg), and removed the old package (R-4.2.0-arm64.pkg). This allowed me to use BiocManager to install other packages.
I'm also on an Apple Silicon Mac. I had assorted previous R installs via homebrew and others. Removing all existing R installations (check via Terminal with 'which R') then reinstalling from a fresh download of the arm64 build did the trick.

Installing rJava - ld: library not found for -lomp clang-4.0: error: linker command failed with exit code 1

I've been trying to troubleshoot installation of rJava in R (3.4.2) on my Mac OS Sierra 10.12.6. I've followed the advice I've found about OpenMP issues (http://thecoatlessprofessor.com/programming/openmp-in-r-on-os-x/). The error I'm getting now, though, identifies the library not found as '-lomp' instead of '-fopenmp.' I'm not sure how to proceed from here.
Here's what it looks like when it hits the error:
ld: library not found for -lomp
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libjri.jnilib] Error 1
make[1]: *** [src/JRI.jar] Error 2
make: *** [jri] Error 2
ERROR: compilation failed for package ‘rJava’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava’
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/y_/0bm1vdx95dn4m8x_xtctp2gh0000gn/T/RtmpfslTnc/downloaded_packages’
I had the same issue, and fixed it by creating a link to the library (libomp.dylib) in a directory where it can be found (/usr/local/lib/), as explained here.
Take a look here for full description of how to compile most recent Java inside OSX.
Note that you need clang with omp support - it is not available directly from Apple: http://www.owsiak.org/r-3-4-rjava-macos-and-even-more-mess/
You need to:
get clang from llvm page
configure R to use JDK of your choice
compile rJava from sources

Compilation fails when trying to install "pcalg" for R on El Capitan

When trying to install the pcalg package, I am getting the following error:
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: *** [pcalg.so] Error 1
ERROR: compilation failed for package ‘pcalg’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/pcalg’
The downloaded source packages are in
‘/private/var/folders/54/nwpr9hkn49b1m4h3hjmwph6r0000gn/T/RtmpREqD5T/downloaded_packages’
Warning message:
In install.packages("pcalg") :
installation of package ‘pcalg’ had non-zero exit status
I'm assuming this is because the gfortan package now in gcc, but I don't know how to point it to the right place. Does anybody know how to fix this?

Resources