Forecast package not installing R Studio Mac - r

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'

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

R Archived Package "OC" (Optimal Classification) Installation Failed Due to gcc Issues

EDIT: My OS is 10.15.4 and R is 4.0.0 and Xcode 11.4.1
I tried to install an archived package "OC" (Optimal Classification). I downloaded the file from here (oc_1.01.tar.gz) first and store it on my desktop. I have tried to install this through install.packages("oc_1.01.tar.gz", repo=NULL, type="source") or install_version("oc", version = "1.01", repos = "https://cran.r-project.org/") and it always failed with warnings as:
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: 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: *** [oc.so] Error 1
ERROR: compilation failed for package ‘oc’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/oc’
Error: Failed to install 'unknown package' from URL:
(converted from warning) installation of package ‘/var/folders/yv/gzy_ljk971d4jnlntnfvht_40000gn/T//Rtmpr8pJmf/remotes1e1745dfa9dc/oc’ had non-zero exit status
I have tried several solutions similar to this to download gcc or gcc#8 through Homebrew and made changes on the file Makeconf. However, as long as I made changes (even I restored the original codes), installation still fails and returns warnings as:
R clang: error: no such file or directory: 'SHLIB_LIBADD'
R clang: error: no such file or directory: '='
If I changed CC, CXX (including all CXX related such as CXX17), and FLIBS to gcc-8 or gcc-9, the returned warnings become:
R gcc-8: error: no such file or directory: 'SHLIB_LIBADD'
R gcc-8: error: no such file or directory: '='
I appreciate any help.

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