I just attempted an install RStan without admin rights on very locked down Windows Server 2012 R2. I tried various work-arounds, but could not get things to work. In particular, with directories on M: in my path for RTools, the tools attempt to invoke programs on c:.
I installed RTools to a local directory (that I could write to) and checked the option to modify the environment variables. But the installer/OS gave an error that it could not write to the variable. I told it to ignore the error and continue.
Since I neglected to note the exact paths, I guessed later about 2 bin directories in R Tools. I added this line to my .Rprofile:
(basically the procedure in Windows Install without Admin Rights). However, RStudio seemed insensitive to this, since when I restarted it and did Sys.getenv(“Path”) the new values weren’t there.
I inserted them in the session; system(“g++ -v”) worked OK, but the final test failed:
 “M:\Rtools\bin;M:\Rtools\mingw_64\bin;C:\Program Files\R\R-3.4.0\bin\x64;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Dell\SysMgt\oma\bin;C:\Program Files\Dell\SysMgt\shared\bin;C:\Program Files\Dell\SysMgt\idrac;C:\Program Files\SASHome\SASFoundation\9.4\ets\sasexe;C:\Program Files\SASHome\Secure\ccme4;C:\Program Files\SASHome\x86\Secure\ccme4”
fx <- inline::cxxfunction( signature(x = “integer”, y = “numeric” ) , ’
- return ScalarReal( INTEGER(x) * REAL(y) ) ;
c:/Rtools/mingw_64/bin/g++: not found`
Actually, the error seems to be right there: my path says to use M:\Rtools, but it’s trying to run C:\Rtools…
The log continues:
make: *** [filed7dc2ec2644b.o] Error 127
running command ‘make -f “C:/PROGRA~1/R/R-34~1.0/etc/x64/Makeconf” -f “C:/PROGRA~1/R/R-34~1.0/share/make/winshlib.mk” -f “C:/Users/RoBoylan/Documents/.R/Makevars” SHLIB_LDFLAGS=’(SHLIB_CXXLDFLAGS)' SHLIB_LD='(SHLIB_CXXLD)’ SHLIB=“filed7dc2ec2644b.dll” WIN=64 TCLBIN=64 OBJECTS=“filed7dc2ec2644b.o”’ had status 2
ERROR(s) during compilation: source code errors or compiler configuration errors!
BTW, the MS Windows user profile editor does let me edit the environment variables. I tried adding Path in the user-specific area (it already appears, greyed out, in the system area), but even after I logged off and back in it didn’t seem to matter. That is, when I started a command prompt and did echo %Path% I only got the system values.
For now, I switched the Linux, and seem to have got a working installation there.