Installing kernlab package from sources on Mac - r

I am on mavericks 10.9.2 and running R 3.0.2:
20:35:19/Spectral $R
R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin10.8.0 (64-bit)
Let us try to install the kernlab package from source (not doing from source had worse errors)
install.packages("kernlab", type="source")
We get pretty far in compiling but at the end the linker fails:
-Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64'
ld: warning: directory not found for option '-L/usr/local/lib/x86_64'
ld: warning: directory not found for option '-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [kernlab.so] Error 1
ERROR: compilation failed for package ‘kernlab’
* removing ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/kernlab’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/kernlab’
The downloaded source packages are in
‘/private/var/folders/k4/l5ww32y14svd5wmkgzzftl9m0000gn/T/RtmpyBfij3/downloaded_packages’
Warning message:
In install.packages("kernlab", type = "source") :
installation of package ‘kernlab’ had non-zero exit status
UPDATE
Per Comments I updated to latest (3.12) R. I also did a
brew install gfortran
which was successful
But compiling R from source still has issues with -lgfortran:
install.packages("kernlab", type="source")
..
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: *** [kernlab.so] Error 1
ERROR: compilation failed for package ‘kernlab’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/kernlab’
The downloaded source packages are in
‘/private/var/folders/k4/l5ww32y14svd5wmkgzzftl9m0000gn/T/RtmpugQtXD/downloaded_packages’
The XCode is 5.1.1 (updated just now - that is newest available for 10.9.2)
Here is info on command line tools:
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 6.1.0.0.1.1413057044
volume: /
location: /
install-time: 1415295324
groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group com.apple.DevToolsNonRelocatableShared.pkg-group
Here is gfortran info:
09:54:46/spectral $gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gfortran/4.8.2/gfortran/libexec/gcc/x86_64-apple-darwin13.0.0/4.8.2/lto-wrapper
Target: x86_64-apple-darwin13.0.0
Configured with: ../configure --prefix=/usr/local/Cellar/gfortran/4.8.2/gfortran --datarootdir=/usr/local/Cellar/gfortran/4.8.2/share --bindir=/usr/local/Cellar/gfortran/4.8.2/bin --enable-languages=fortran --with-system-zlib --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-cloog=/usr/local/opt/cloog --with-isl=/usr/local/opt/isl --disable-cloog-version-check --disable-isl-version-check --enable-checking=release --disable-stage1-checking --disable-libstdcxx --enable-lto --disable-nls --disable-multilib
Thread model: posix
gcc version 4.8.2 (GCC)

The installation worked when performed directly through RStudio. It is not clear why that would make the difference, but the problem is resolved.

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.

Unable to install GDINA on Microsoft R [MRAN] 4.0.2 on Ubuntu 18.04

I am trying to install GDINA on MRAN 4.0.2 on Ubuntu 18.04 server and I am getting below error. Please advise how may I do the installation. GDINA is installing on previous version of MRAN and R 4.0.3 on this same machine but failing on MRAN 4.0.2.
Microsoft R Open 4.0.2
The enhanced R distribution from Microsoft
Microsoft packages Copyright (C) 2020 Microsoft Corporation
Using the Intel MKL for parallel mathematical computing (using 1 cores).
Default CRAN mirror snapshot taken on 2020-07-16.
See: https://mran.microsoft.com/.
* installing *source* package ‘GDINA’ ...
** package ‘GDINA’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
...
. _<removing some g++ compilation outputs>_
g++ -shared -L/opt/microsoft/ropen/4.0.2/lib64/R/lib -o GDINA.so Lik.o Lik2.o LouisC.o Mord.o Mstep.o NgRg.o RcppExports.o SE.o aggregateCol.o fitstats.o scorep.o sequP.o util.o varsigma.o Microsoft R Open 4.0.2 The enhanced R distribution from Microsoft Microsoft packages Copyright (C) 2020 Microsoft Corporation Using the Intel MKL for parallel mathematical computing (using 1 cores). Default CRAN mirror snapshot taken on 2020-07-16. See: https://mran.microsoft.com/. -L/opt/microsoft/ropen/4.0.2/lib64/R/lib -lRlapack -L/opt/microsoft/ropen/4.0.2/lib64/R/lib -lRblas -lgfortran -lm -L/opt/microsoft/ropen/4.0.2/lib64/R/lib -lR
g++: error: Microsoft: No such file or directory
g++: error: R: No such file or directory
g++: error: Open: No such file or directory
g++: error: 4.0.2: No such file or directory
...
g++: error: 2020-07-16.: No such file or directory
g++: error: See:: No such file or directory
g++: error: https://mran.microsoft.com/.: No such file or directory
/opt/microsoft/ropen/4.0.2/lib64/R/share/make/shlib.mk:6: recipe for target 'GDINA.so' failed
make: *** [GDINA.so] Error 1
ERROR: compilation failed for package ‘GDINA’
* removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/4.0/GDINA’
Warning in install.packages :
installation of package ‘GDINA’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpTrbkOd/downloaded_packages’

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.

How to install xps package for R 3.0.3

I am trying to install the xps package from http://www.bioconductor.org/packages/release/bioc/html/xps.html
for R 3.0.3 on Windows 8.1 x64.
When I try:
source("http://bioconductor.org/biocLite.R")
biocLite("xps")
I get the following messages:
BioC_mirror: http://bioconductor.org
Using Bioconductor version 2.13 (BiocInstaller 1.12.0), R version 3.0.3.
Installing package(s) 'xps'
package ‘xps’ is available as a source package but not as a binary
Warning message:
package ‘xps’ is not available (for R version 3.0.3)
So I try installing by downloading the package source for xps
When I try to install it I get the following message:
* installing *source* package 'xps' ...
testing for presence of ROOT...
perl: not found
found of ROOT in directory C:\root\/bin...OK
** libs
running 'src/Makefile.win' ...
Syntax error: Unterminated quoted string
Syntax error: Unterminated quoted string
g++ -pipe -mwindows -I/include -include w32pragma.h -O2 -DWIN32 -c TMLMath.cxx
cc1plus.exe: fatal error: w32pragma.h: No such file or directory
compilation terminated.
make: *** [TMLMath.o] Error 1
Warning: running command 'make --no-print-directory -f "Makefile.win"' had status 2
ERROR: compilation failed for package 'xps'
* removing 'D:/Program Files/R/R-3.0.3/library/xps'
The xps landing page says that xps is not available for 64-bit windows. If you run 32-bit R you'll be able to install the binary with biocLite.

Resources