error while installing quadprog package in R for MAC - r

I'm trying to install the quadprog package in R in mac but it keeps showing this massage:
installing source package ‘quadprog’ ...
** package ‘quadprog’ successfully unpacked and MD5 sums checked
** libs
gfortran-4.8 -fPIC -g -O2 -c aind.f -o aind.o
make: gfortran-4.8: No such file or directory
make: *** [aind.o] Error 1
ERROR: compilation failed for package ‘quadprog’
removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/quadprog’
Anybody know what I should do to have it installed?

Related

Installing packages from source in renv

I need to install a package from source in renv. I can install packages from binaries in renv no problem. I can also install packages from both source & binary outside renv no problem. I am doing this within Rstudio
The error (below) makes me think it cant find the compiler. Digging around I found a thread about this that says renv cant find Rtools and then you need to run renv:::renv_scope_rtools() to resolve this but this just gives the message FAIL and the problem remains. Can anyone help?
thanks
install.packages("xfun")
Retrieving 'https://cloud.r-project.org/src/contrib/xfun_0.37.tar.gz' ...
OK [file is up to date]
Installing xfun [0.37] ...
FAILED
Error installing package 'xfun':
================================
* installing *source* package 'xfun' ...
** package 'xfun' successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c base64.c -o base64.o
sh: line 1: gcc: command not found
make: *** [C:/PROGRA~1/R/R-42~1.2/etc/x64/Makeconf:253: base64.o] Error 127
ERROR: compilation failed for package 'xfun'
* removing 'D:/Dropbox/project X/renv/staging/3/xfun'

RStudio learnr package error "ERROR: compilation failed for package 'backports'"

First question on StackOverflow. I will try to be clear.
I just installed
R 4.0.1 for Windows 10
RStudio (RStudio 1.3.959) for Windows 10
I tried to install learnr package, which required many other packages. The console prints toward the end:
installing source package 'backports' ...
** package 'backports' successfully unpacked and MD5 sums checked
** using staged installation
** libs
"c:/rtools40/mingw64/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c dotsElt.c -o dotsElt.o
/bin/sh: c:/rtools40/mingw64/bin/gcc: No such file or directory
make: *** [dotsElt.o] Error 127
ERROR: compilation failed for package 'backports'
removing 'C:/Users/micha/Documents/R/win-library/4.0/backports'
Warning in install.packages :
installation of package ‘backports’ had non-zero exit status
installing source package 'isoband' ...
** package 'isoband' successfully unpacked and MD5 sums checked
** using staged installation
** libs
"c:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.1/include" -DNDEBUG -I'C:/Users/micha/Documents/R/win-library/4.0/testthat/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c clip-lines.cpp -o clip-lines.o
/bin/sh: c:/rtools40/mingw64/bin/g++: No such file or directory
make: *** [clip-lines.o] Error 127
ERROR: compilation failed for package 'isoband'
removing 'C:/Users/micha/Documents/R/win-library/4.0/isoband'
Warning in install.packages :
installation of package ‘isoband’ had non-zero exit status
ERROR: dependency 'isoband' is not available for package 'ggplot2'
removing 'C:/Users/micha/Documents/R/win-library/4.0/ggplot2'
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
Is it an internal issue, or a problem with the packages? Should I contact the package maintainer for 'backports', 'isoband', 'ggplot2', re-install R and/or RStudio, or something else?
It seems that you run that on Windows and want to install learnr from the source (it means that you have to compile these packages). However, some packages need additional tools to compile on Windows. These tools are provided in official RTools for Windows, so install that first and try again.
And sometimes you can install the binary versions of the packages rather than the source. Then you don't need to compile:
install.packages("learnr", type = "binary")

Installing packages in R gives the following errors

When trying to install some packages such Rcmdr or factoextra while on R in terminal (after upgrade to R 4.0.0 on Archlabs) the following errors shows up:
* installing *source* package ‘SparseM’ ...
** package ‘SparseM’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fno-optimize-sibling-calls -fpic -g -O2 -c bckslv.f -o bckslv.o
/usr/local/bin/gfortran: /usr/local/bin/gfortran: cannot execute binary file
make: *** [/usr/lib64/R/etc/Makeconf:190: bckslv.o] Error 126
ERROR: compilation failed for package ‘SparseM’
* removing ‘/usr/lib/R/library/SparseM’
and this one :
* installing *source* package ‘readr’ ...
** package ‘readr’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++11 -I"/usr/include/R/" -DNDEBUG -I'/usr/lib/R/library/Rcpp/include' -I'/usr/lib/R/library/BH/include' -D_FORTIFY_SOURCE=2 -I. -Ircon -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -c Collector.cpp -o Collector.o
In file included from /usr/lib/R/library/Rcpp/include/Rcpp.h:77,
from Collector.cpp:1:
/usr/lib/R/library/Rcpp/include/Rcpp/Rmath.h: In function ‘double R::pythag(double, double)’:
/usr/lib/R/library/Rcpp/include/Rcpp/Rmath.h:222:57: error: ‘::Rf_pythag’ has not been declared; did you mean ‘pythag’?
222 | inline double pythag(double a, double b) { return ::Rf_pythag(a, b); }
| ^~~~~~~~~
| pythag
make: *** [/usr/lib64/R/etc/Makeconf:176: Collector.o] Error 1
then followed by a bunch of
ERROR: dependencies ‘dendextend’, ‘FactoMineR’, ‘ggpubr’, ‘ggrepel’, ‘tidyr’ are not available for package ‘factoextra’
* removing ‘/usr/lib/R/library/factoextra’
following each dependencies produces the same errors with different new dependencies.
P.S: I'm a normie so please bear with me.
I had a similar error while installing 'ape'. For me it worked to reinstall the current version of the 'Rcpp' package:
install.packages('Rcpp')
Hope it works for you too !

Problems to install zoo package, Error: sh: c:/Rtools/mingw_32/bin/gcc: No such file or directory

I tried to install the zoo package via the R package installer:
install.packages("C:/Users/srues/Downloads/zoo_1.8-8.tar.gz", repos = NULL, type = "source")
but I get the following error
Installing package into ‘C:/Users/srues/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'zoo' ...
** Paket 'zoo' erfolgreich entpackt und MD5 Summen überprüft
** using staged installation
** libs
*** arch - i386
c:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -I../inst/include -O3 -Wall -std=gnu99 -mtune=generic -c coredata.c -o coredata.o
sh: c:/Rtools/mingw_32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-36~1.1/etc/i386/Makeconf:208: coredata.o] Error 127
ERROR: compilation failed for package 'zoo'
* removing 'C:/Users/srues/Documents/R/win-library/3.6/zoo'
* restoring previous 'C:/Users/srues/Documents/R/win-library/3.6/zoo'
Warning in install.packages :
installation of package ‘C:/Users/srues/Downloads/zoo_1.8-8.tar.gz’ had non-zero exit status
the line
sh: c:/Rtools/mingw_32/bin/gcc: No such file or directory
says it miss the directory or file. What I have to do to find this file or directory? Or can I install the zoo package over Rtool40?

R error: make: llvm-gcc-4.2: No such file or directory

I have RStudio 1.1.419 running on a Mac OS El Capitan. I am trying to install the dplyr package. The installation first attempts to install package utf8. The following is the text I get back:
installing source package ‘utf8’ ...
** package ‘utf8’ successfully unpacked and MD5 sums checked
** libs
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -Iutf8lite/src -fPIC -mtune=core2 -g -O2 -c as_utf8.c -o as_utf8.o
make: llvm-gcc-4.2: No such file or directory
make: *** [as_utf8.o] Error 1
ERROR: compilation failed for package ‘utf8’
removing ‘/Users/andrewdkilmer/Library/R/3.2/library/utf8’
Warning in install.packages :
installation of package ‘utf8’ had non-zero exit status
Since utf8 failed to install, dplyr cannot install either. Why am I getting this 'No such file or directory' error?
Never mind, updated to R version 3.4 and it is working.

Resources