I am new to learning R and i get the following error while installing the package called 'hemp'. Its a package which is used in psychometric analysis. Can anyone tell me what causes this errror?
Downloading GitHub repo cddesja/hemp#master
Installing 1 packages: nloptr
Installing package into ‘C:/Users/UJJWAL/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
There is a binary version available but the
source version is later:
binary source needs_compilation
nloptr 1.2.2.1 1.2.2.2 TRUE
installing the source package ‘nloptr’
trying URL 'https://cran.rstudio.com/src/contrib/nloptr_1.2.2.2.tar.gz'
Content type 'application/x-gzip' length 2450931 bytes (2.3 MB)
downloaded 2.3 MB
* installing *source* package 'nloptr' ...
** package 'nloptr' successfully unpacked and MD5 sums checked
** using staged installation
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** libs
*** arch - i386
/mingw32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-4.0.2/include" -DNDEBUG -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c dummy.cpp -o dummy.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.0.2/include" -DNDEBUG -I"/i386/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c init_nloptr.c -o init_nloptr.o
init_nloptr.c:35:10: fatal error: nlopt.h: No such file or directory
#include "nlopt.h"
^~~~~~~~~
compilation terminated.
make: *** [C:/PROGRA~1/R/R-4.0.2/etc/i386/Makeconf:222: init_nloptr.o] Error 1
ERROR: compilation failed for package 'nloptr'
* removing 'C:/Users/UJJWAL/Documents/R/win-library/4.0/nloptr'
Error: Failed to install 'hemp' from GitHub:
(converted from warning) installation of package ‘nloptr’ had non-zero exit status
Seems that it wouldbe a little harder to install nloptr on Windows. It require nlopt to be installed first. See this for more info: https://www.r-project.org/nosvn/pandoc/nloptr.html
Related
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'
I'm trying to install "randomForest" on R 3.6.3 as below:
urlPackage <- "https://cran.r-project.org/src/contrib/Archive/randomForest/randomForest_4.6-14.tar.gz"
install.packages(urlPackage, repos=NULL, type="source")
(install.packages('randomForest') throws the error: package 'randomForest' is not available (for R version 3.6.3))
The lines above, however, give me the following error:
trying URL 'https://cran.r-project.org/src/contrib/Archive/randomForest/randomForest_4.6-14.tar.gz'
Content type 'application/x-gzip' length 80074 bytes (78 KB)
==================================================
downloaded 78 KB
* installing *source* package ‘randomForest’ ...
** package ‘randomForest’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -mtune=native -g -O2 -Wall -pedantic -Wconversion -c classTree.c -o classTree.o
/bin/sh: gcc-8: command not found
make: *** [classTree.o] Error 127
ERROR: compilation failed for package ‘randomForest’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/randomForest’
Warning in install.packages :
installation of package ‘/var/folders/66/3s4r17rx7ln0b1p8tyrmws780000gn/T//RtmpDOHynP/downloaded_packages/randomForest_4.6-14.tar.gz’ had non-zero exit status
Does anyone have any idea how to solve this? I'm on macOS Catalina (ver 10.15.7)
You should install the gcc8 tool:
sudo port install gcc8
Related Links
MacPorts - GCC8
YouTube - Install GCC 8 with Homebrew on macOS
When installing Swirl using R Studio on Windows 10 (64-bit), the Swirl package installs but the running library (swirl) cannot be found. The system gives an error that rlang gets removed while installing Swirl:
Error in rlang() : could not find function "rlang"
install.packages("rlang")
Installing package into ‘C:/Users/***/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
There is a binary version available but the source
version is later:
binary source needs_compilation
rlang 0.3.2 0.3.3 TRUE
installing the source package ‘rlang’
trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.3.3.tar.gz'
Content type 'application/x-gzip' length 859027 bytes (838 KB)
downloaded 838 KB
installing source package 'rlang' ...
** package 'rlang' successfully unpacked and MD5 sums checked
** libs
C:/PROGRA~1/R/R-35~1.3/etc/x64/Makeconf:230: warning: overriding recipe for target '.m.o'
C:/PROGRA~1/R/R-35~1.3/etc/x64/Makeconf:223: warning: ignoring old recipe for target '.m.o'
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-35~1.3/include" -DNDEBUG -I./lib/ -O2 -Wall -std=gnu99 -mtune=generic -c capture.c -o capture.o
process_begin: CreateProcess(NULL, c:/Rtools/mingw_64/bin/gcc -IC:/PROGRA~1/R/R-35~1.3/include -DNDEBUG -I./lib/ -O2 -Wall -std=gnu99 -mtune=generic -c capture.c -o capture.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [C:/PROGRA~1/R/R-35~1.3/etc/x64/Makeconf:208: capture.o] Error 2
ERROR: compilation failed for package 'rlang'
I'm trying to install the R package gtools from the Linux Mint command line. After choosing the closest CRAN mirror, I'm getting the error message that no such file or directory was found and that installation of the package had a non-zero exit status. More specifically:
> install.packages('gtools')
Installing package into ‘/home/lizi/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cloud.r-
project.org/src/contrib/gtools_3.5.0.tar.gz'
Content type 'application/x-gzip' length 64855 bytes (63 KB)
==================================================
downloaded 63 KB
* installing *source* package ‘gtools’ ...
** package ‘gtools’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c roman2int.c -o roman2int.o
In file included from roman2int.c:1:0:
/usr/share/R/include/R.h:55:80: fatal error: stdlib.h: No such file or
directory
compilation terminated.
/usr/lib/R/etc/Makeconf:159: recipe for target 'roman2int.o' failed
make: *** [roman2int.o] Error 1
ERROR: compilation failed for package ‘gtools’
* removing ‘/home/lizi/R/x86_64-pc-linux-gnu-library/3.4/gtools’
The downloaded source packages are in
‘/tmp/Rtmp0z5PS6/downloaded_packages’
Warning message:
In install.packages("gtools") :
installation of package ‘gtools’ had non-zero exit status
The package has no dependencies, and I was under the impression that install.packages was straightforward. What am I doing wrong?
I'm new to R and cassandra, I'm trying to install the rcassandra package. On the rforge.net site, it says to do:
> install.packages('RCassandra',,'http://www.rforge.net/')
Warning: unable to access index for repository http://www.rforge.net/src/contrib
Warning message:
package ‘RCassandra’ is not available (for R version 3.1.0)
Trying a different repository
> install.packages('RCassandra',repo='http://cran.cnr.Berkeley.edu/')
Installing package into ‘/home/as/R/x86_64-redhat-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://cran.cnr.Berkeley.edu/src/contrib/
Warning message:
package ‘RCassandra’ is not available (for R version 3.1.0)
I tried installing from command line, but that does'nt seem to work either:
> sudo R CMD INSTALL RCassandra_0.1\-3.tar.gz
* installing to library ‘/home/as/R/x86_64-redhat-linux-gnu-library/3.1’
* installing *source* package ‘RCassandra’ ...
** package ‘RCassandra’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c cass.c -o cass.o
cass.c:1: sorry, unimplemented: 64-bit mode not compiled in
make: *** [cass.o] Error 1
ERROR: compilation failed for package ‘RCassandra’
* removing ‘/home/as/R/x86_64-redhat-linux-gnu-library/3.1/RCassandra
So how do I install the package? I can see the package on the web sites