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

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?

Related

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.

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.

Can't install R package FIRM

I tried to install R packages FIRM, but I couldn't.
When I run devtools::has_devel(), I get:
Your system is ready to build packages!
But then when I run this:
Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS="true")
install_github("mingjingsi/FIRM")
install.packages("/var/folders/vl/d_5p06kj57l85m1zbkkjvffr0000gn/T/RtmpKh4Jry/filee1a07189e395/FIRM_0.1.0.tar.gz",
type="source",
repos=NULL,
dependencies=TRUE)
The same error occurs.
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: *** [FIRM.so]
Error 1 ERROR: compilation failed for package ‘FIRM’
removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/FIRM’
Warning message: In i.p(...) : installation of package
‘/var/folders/vl/d_5p06kj57l85m1zbkkjvffr0000gn/T//RtmpHZeXAx/file10e6410d4b6b0/FIRM_0.1.0.tar.gz’
had non-zero exit status

Forecast package not installing R Studio Mac

I'm trying to download the 'forecast' package in my R-Studio and I keep getting the following error. Can someone please explains to me what all this means?
The first warning I get is :-
updateTBATSMatrices.cpp:38:10: warning: unused variable 'gammaVector' [-Wunused-variable]
double *gammaVector;
^
1 warning generated.
The second warning I get is :-
ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [forecast.so] Error 1
ERROR: compilation failed for package 'forecast'

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

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.

Resources