r-windows / rtools-installer

Builds the rtools40 installer
https://cran.r-project.org/bin/windows/Rtools/
27 stars 2 forks source link

Cant find Rtools over PATH, BINPREF, BINPREF64 #25

Open Toniiiio opened 1 year ago

Toniiiio commented 1 year ago

Problem: Installation of package from source fails because rtools is not found.

Context: We work in a company setting, where Rtools had to be installed in a non-standard location.

The fix so far was to set BINPREF, BINPREF64 and/or PATH variable, but that does not seem to Be the variables R is looking for?

Question: Which environmental variables have to be set in order for Rtools to be found?

Environment: R version 4.0.3 (Cant be updated very regulary - "company restrictions")

Log:

install.packages("rlang", type = "source")
Installing package into ‘C:/R’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/rlang_1.1.1.tar.gz'
Content type 'application/x-gzip' length 762533 bytes (744 KB)
downloaded 744 KB

* installing *source* package 'rlang' ...
** package 'rlang' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
C:/PROGRA~1/R/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I./rlang/ -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c capture.c -o capture.o
sh: C:/PROGRA~1/R/Rtools/mingw_64/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.3/etc/i386/Makeconf:222: capture.o] Error 127
ERROR: compilation failed for package 'rlang'
* removing 'C:/R/rlang'
* restoring previous 'C:/R/rlang'
Warning in install.packages :
installation of package ‘rlang’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\lunzc\AppData\Local\Temp\RtmpOM7Ysz\downloaded_packages’
> Sys.getenv(BINPREF)
Error in Sys.getenv(BINPREF) : object 'BINPREF' not found
> Sys.getenv("BINPREF")
[1] "C:/PROGRA~1/R/rtools40/mingw64/bin/"
> Sys.getenv("BINPREF64")
[1] "C:/PROGRA~1/R/rtools40/mingw64/bin/"
> Sys.getenv("PATH")
[1] "C:\\Program Files\\R\\R-4.0.3\\bin\\x64;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;c:\\oracle\\product\\11.2.0\\client_1\\bin;C:\\oracle\\product\\11.2.0\\client_64\\bin;C:\\oracle\\product\\19.0.0\\client_32\\bin;C:\\oracle\\product\\19.0.0\\client_64\\bin;C:\\oracle\\product\\11.2.0\\client_1\\BIN;C:\\oracle\\product\\11.2.0\\client_64\\BIN;C:\\Windows\\System32;C:\\Windows;C:\\Windows\\System32\\wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\PROGRA~1\\R\\R-40~1.3\\bin\\x64;C:\\PROGRA~1\\R\\rtools40\\mingw64\\bin;C:\\Program Files (x86)\\Microsoft SQL Server\\150\\DTS\\Binn\\;C:\\Program Files\\Azure Data Studio\\