1

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!

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
user3553260
  • 691
  • 2
  • 9
  • 21
  • There is no Rcpp bug here, so I plan to remove the tag. Requirements for where to install Rtools on Windows are well documented, but it seems you simple did not follow them. Ie read [this guide](https://thecoatlessprofessor.com/programming/installing-rtools-for-compiled-code-via-rcpp/) and note point 8. The same is said in a number of other places. (And yes, it is silly that Rtools does not do that by default but there is also little you and I can do about that....) – Dirk Eddelbuettel Jun 16 '19 at 12:49
  • Please drop the attitude. There is no need to remove a tag if it is relevant. It is not a “bug” tag, it is merely a tag. I had already went through that entire link. I have my bins in order. Do you know what the problem is? – user3553260 Jun 16 '19 at 12:59
  • You misunderstand. Rcpp has no bearing on where Rtools is installed. As such, it simply is not an Rcpp issue. It is all between you, R and Rtools. This simply calls `R CMD INSTALL ...` and friends and Rcpp has *no influence over chosen paths*. Also see the Rcpp FAQ. And please calm downl. I do this for free in my spare time -- if you'd prefer that I don't help you that is easy for me to do. – Dirk Eddelbuettel Jun 16 '19 at 13:24
  • Have you tried changing your PATH to include Rtool‘s bin-directory? – Ralf Stubner Jun 16 '19 at 13:32
  • 1
    Can you create a file in the directory mentioned here: `Cannot create temporary file in C:\Users\mat\AppData\Local\Temp\: Permission denied` ? – Dirk Eddelbuettel Jun 16 '19 at 13:42
  • 1
    Also: Upload your package to win-builder just to convince yourself that it is not the package. Then figure out how/where your local setup differs. – Dirk Eddelbuettel Jun 16 '19 at 13:43
  • @DirkEddelbuettel yes, I can make a new file in that folder. I tried to unclick "Read-only" before, but that doesn't seem viable. I will try the win-builder, but I need to try the manual way first. I did follow everybody's regular install though. – user3553260 Jun 16 '19 at 14:10
  • @DirkEddelbuettel What I am getting is: `> install.Rtools()` No need to install Rtools - You've got the relevant version of Rtools installed but I deleted it already, so I am confused. `Rcpp::evalCpp("2+2")` Warning message: In system(cmd) : 'make' not found. Then it started to downlowd Rtoolsbuild in the C drive after prompt window. – user3553260 Jun 16 '19 at 14:16
  • `Rcpp::evalCpp("2+2")` C:/RBuildTools/3.5/mingw_64/bin/g++ -I"C:/PROGRA~1/R/R-36~1.0/include" -DNDEBUG -I"C:/Users/mat/Documents/R/win-library/3.6/Rcpp/include" -I"C:/Users/mat/AppData/Local/Temp/Rtmp8oGA6i/sourceCpp-x86_64-w64-mingw32-1.0.1" -O2 -Wall -mtune=generic -c file26f01b2c3aae.cpp -o file26f01b2c3aae.o Cannot create temporary file in C:\Users\mat\AppData\Local\Temp\: Permission denied make: *** [C:/PROGRA~1/R/R-36~1.0/etc/x64/Makeconf:215: file26f01b2c3aae.o] Error 3 Error in sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir = cacheDir, : Error 1. – user3553260 Jun 16 '19 at 14:21
  • That is my point: if `Rcpp::eval("2+2")` fails, it is *all* on you. Hence no Rcpp issue. Step back, have a cup of joe and review and available help on Rtools -- which is given to all of us by R Core and we just have to accept any and all quirks. – Dirk Eddelbuettel Jun 16 '19 at 14:59
  • @DirkEddelbuettel still do not think the tag needs to be off. It is related to R and C++.I am thinking it has to do with some sort of access configuration or something to do with updating the C++ libraries from Microsoft. The error is at file26f01b2c3aae.cpp. It says can’t access but I can make new file in that directory. Might have to try another computer. – user3553260 Jun 16 '19 at 20:26
  • 1
    You are still wrong. Failing to provided documented requirements -- again, Rcpp cannot install or govern Rtools -- is not a bug in a package, even if that package is used when the bug is encountered. You are stuck _by an R installation issue on Windows_ and are encountering an Rcpp shortcoming. Hence no Rcpp tag. – Dirk Eddelbuettel Jun 16 '19 at 20:27

0 Answers0