Hi,
I have been developing a personal package for a while on Win 7 Enterprise, Service Pack 1, with RStudio 1.2.5001 and R 3.6.1. In this system all needed to do is to download Rtools from CRAn and run the exe and install Rtools under C (C:\Rtools). After that, from RStudio project environment when I clicked Build > Install and Restart, everything worked fine.
Recently I moved to Win 10 environment, with the same setup of R 3.6.1 and RStudio 1.2.5001. I installed Rtools and ran the exe, but this did not work. Whenever I wanted to build my package RStudio cannot find the Rtools. Rtools is under C:\Rtools, same as my old system.
Here is my Sys.info():
sysname: "Windows"
release: "10 x64"
version: "build 17134"
RStudio Edition : Desktop
RStudio Version : 1.2.5001
OS Version : Windows 10
R Version : 3.6.1
I read about the PATH issues and tried all the suggestions. I added the Rtools directories under the system path, created the BINPREF variable, created a .Renviron file under Documents and included the path there, etc. Nothing worked.
As far as I can tell, the problem seems to be coming from the cpp.exe not being found or cannot be used. Here are the tests I did and results:
find_rtools()
[1] TRUE
Sys.getenv("PATH")
[1] "C:\Users\kartalcb\Documents\R\R-3.6.1\bin\x64;C:\Rtools\bin;C:\Rtools\mingw_64\bin; .... other stuff...
Sys.getenv("BINPREF")
[1] "C:\Rtools\mingw_64\bin\"
pkgbuild::find_rtools(debug = TRUE)
Scanning R CMD config CC...
cc_path: C:\Rtools\mingw_64\bin\gcc
install_path: C:/Rtools
Found compatible gcc from R CMD config CC
[1] TRUE
pkgbuild::check_rtools(debug = TRUE)
Scanning R CMD config CC...
cc_path: C:/Rtools/mingw_64/bin/gcc
install_path: C:/Rtools
Found compatible gcc from R CMD config CC
[1] TRUE
pkgbuild::rtools_path()
[1] "C:/Rtools/bin"
.Call("rs_canBuildCpp")
[1] FALSE
pkgbuild::has_build_tools()
[1] FALSE
pkgbuild::has_build_tools()
[1] FALSE
In my old system, .Call("rs_canBuildCpp") returns TRUE even though the Sys.getenv("BINPREF") returns " " (empty string).
I tried every version of the suggestions, nothing worked. I have the same permissions as my old system, I have write permission to C, the R is installed under C:\Users\kartalcb\Documents\R\R-3.6.1.
Any suggestion would be much appreciated.