r-error:installation of package ‘irlba’ had non-zero exit status - r

I started using R and when used the following code ,I got the error stating Error in library("recommenderlab") :
there is no package called ‘recommenderlab’
Execution halted
and when i tried to install using install.packages("recommenderlab")
I got
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'irlba.so' failed
make: *** [irlba.so] Error 1
ERROR: compilation failed for package ‘irlba’
* removing ‘/home/senbagaraman/R/x86_64-pc-linux-gnu-library/3.3/irlba’
ERROR: dependency ‘irlba’ is not available for package ‘recommenderlab’
* removing ‘/home/senbagaraman/R/x86_64-pc-linux-gnu-library/3.3/recommenderlab’
The downloaded source packages are in
‘/tmp/Rtmp82yJWk/downloaded_packages’
Warning messages:
1: In install.packages("recommenderlab") :
installation of package ‘irlba’ had non-zero exit status
2: In install.packages("recommenderlab") :
installation of package ‘recommenderlab’ had non-zero exit status

I'm using ubuntu 14.04 and I had just this error:
/usr/bin/ld: cannot find -lgfortran
I searched a little, and find out that the gfortran version and g++ version had to be the same.
lgfortran not found
So I downgrade the g++ version to the gfortran version using the steps available in the link above.
https://askubuntu.com/questions/26498/choose-gcc-and-g-version
Hope this works for you too.

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

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?
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.

Package fracdiff of R fails to install in Linux Mint

I am installing the package forecast. However, I get a persistent error because the package fracdiff fails with this error:
/usr/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'fracdiff.so' failed
make: *** [fracdiff.so] Error 1
ERROR: compilation failed for package ‘fracdiff’
* removing ‘/home/mario/R/x86_64-pc-linux-gnu-library/3.4/fracdiff’
Warning in install.packages :
installation of package ‘fracdiff’ had non-zero exit status
Normally, when I see had non-zero exit status, it is for me a clue telling me that I should go to Synaptic and search for the library r-cran-fracdiff. However, this library is not present in my repositories, and don't really know how to solve this issue.
Any idea?
"/usr/bin/ld: cannot find -lXXX" tells you that you should be looking for a library named something like "libXXX-dev".
In this case I would install libblas-dev and perhaps also liblapack-dev, as explained here.

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?

How to install package 'coin' in R 3.1.3

I am using R 3.1.3 and I need to install the package coin to be able to extract z values from the outout of the wilcoxon test, as explained here.
I tried installing the coin library, but I got the following error:
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [coin.so] Error 1
ERROR: compilation failed for package ‘coin’
* removing ‘/home/hlabbeg1/R/i486-pc-linux-gnu-library/3.1/coin’
Warning in install.packages :
installation of package ‘coin’ had non-zero exit status
I tried installing the packages lblas and lgfortran but in both cases I get a message saying the packages are not available for R version 3.1.3. I couldn't even find them on the cran repositories.
Trying to install the package directly gives me the following error:
Error in rawToChar(block[seq_len(ns)]) :
embedded nul in string: 'PK\003\004\n\0\0\0\0\0\xb1\004\x8fF\0\0\0\0\0\0\0\0\0\0\0\0\005\0\0\0coin/PK\003\004\024\0\002\0\b\0\xae\004\x8fF\xce\xe2\x91\xcb6\002\0\0:\006\0\0\r\0\0\0coin/CITATION\xad\x93Qo\xda0\020ǟɧ8\xf9)Hi\xa0\xa0\xb1\b\xa9\017'
Any idea oh how to install these packages so I can get coin?
Thanks.

Resources