On Windows 10 Education 64bit, I am running R version 3.6.0 with Rtools 3.5.0 in RStudio Version 1.2.1335. I receive the following error when I try to install devtools::install_github("RcppCore/Rcpp")
> devtools::install_github("RcppCore/Rcpp")
Downloading GitHub repo RcppCore/Rcpp@master
√ checking for file 'C:\Users\mat\AppData\Local\Temp\RtmpCSoh75\remotesb542b002bf2\RcppCore-Rcpp-6062d56/DESCRIPTION' (856ms)
- preparing 'Rcpp': (5.8s)
√ checking DESCRIPTION meta-information
- cleaning src
- checking for LF line-endings in source and make files and shell scripts (822ms)
- checking for empty or unneeded directories (4.8s)
- building 'Rcpp_1.0.1.3.tar.gz' (389ms)
Warning: file 'Rcpp/cleanup' did not have execute permissions: corrected
Installing package into ‘C:/Users/mat/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'Rcpp' ...
** using staged installation
** libs
*** arch - i386
C:/Rtools/bin/g++ -I"C:/PROGRA~1/R/R-36~1.0/include" -DNDEBUG -I../inst/include/ -O2 -Wall -mtune=generic -c api.cpp -o api.o
sh: C:/Rtools/bin/g++: No such file or directory
make: *** [C:/PROGRA~1/R/R-36~1.0/etc/i386/Makeconf:215: api.o] Error 127
ERROR: compilation failed for package 'Rcpp'
* removing 'C:/Users/mat/Documents/R/win-library/3.6/Rcpp'
* restoring previous 'C:/Users/mat/Documents/R/win-library/3.6/Rcpp'
To reproduce this code:
>install.packages("devtools")
>library("devtools")
>options(buildtools.check = NULL)
>install.packages("Rcpp", dep = TRUE)
>devtools::install_github("RcppCore/Rcpp")
My system path starts out like this:
>Sys.getenv()['PATH']
PATH
C:\Program
Files\R\R-3.6.0\bin\x64;C:\Rtools\bin;C:\Rtools\mingw_32\bin;C:\Rtools\mingw_64\bin;
and there is a space between Program and Files
As admin I changed the Makeconf
through Notepad in both the 32 and 64 bit folders to: BINPREF ?= D:/Rtools/mingw_32/bin/
and
BINPREF ?= D:/Rtools/mingw_64/bin/
I tried this link to fix the Makeconf file: Rcpp Rtools installed but error message g++ not found
For Rcpp compiling issues, this linked seemed helpful: Cannot compile from source with Rcpp on Windows 7
Does this have something to do with commenting out rpp tags or changing some variables in Makevars or Makeconf? If not, why does the code devtools::install_github("RcppCore/Rcpp")
look for g++ in the wrong bin? It looks for it in
C:/Rtools/bin/g++
as you can see.
After copying and pasting g++.exe into > C:/Rtools/bin/g++ I get another error:
>devtools::install_github("RcppCore/Rcpp")
Downloading GitHub repo RcppCore/Rcpp@master
√ checking for file 'C:\Users\mat\AppData\Local\Temp\RtmpCSoh75\remotesb54764929a4\RcppCore-Rcpp-6062d56/DESCRIPTION' (916ms)
- preparing 'Rcpp': (5.7s)
√ checking DESCRIPTION meta-information ...
- cleaning src
- checking for LF line-endings in source and make files and shell scripts (986ms)
- checking for empty or unneeded directories (3.8s)
- building 'Rcpp_1.0.1.3.tar.gz' (352ms)
Warning: file 'Rcpp/cleanup' did not have execute permissions: corrected
Installing package into ‘C:/Users/mat/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'Rcpp' ...
** using staged installation
** libs
*** arch - i386
C:/Rtools/bin/g++ -I"C:/PROGRA~1/R/R-36~1.0/include" -DNDEBUG -I../inst/include/ -O2 -Wall -mtune=generic -c api.cpp -o api.o
Cannot create temporary file in C:\Users\mat\AppData\Local\Temp\: Permission denied
make: *** [C:/PROGRA~1/R/R-36~1.0/etc/i386/Makeconf:215: api.o] Error 3
ERROR: compilation failed for package 'Rcpp'
* removing 'C:/Users/mat/Documents/R/win-library/3.6/Rcpp'
* restoring previous 'C:/Users/mat/Documents/R/win-library/3.6/Rcpp'
I do not think copying g++.exe is the proper way to go about it. However, it was worth a try and may be leading to the right answer. Please help. (If you run devtools::install_github("RcppCore/Rcpp")
consecutively you need to delete the lock folder (00LOCK-Rcpp) in ~/R/win-library/3.6 to avoid the ERROR: failed to lock directory
) Thanks!