I needed to install Rtools in a non-default directory because the Windows system that I'm using restores the C drive to an original image after a reboot. This image includes R 3.3 and R studio.
After setting the PATH environment variable without admin privileges using the setx /M PATH "%PATH%;foo/bar/bin;foo/bar/compiler/bin"
command, I tested whether the compiler was accessible in R using: system('g++ -v')
. This worked - success!
... except, when I compile a Stan model using the brms
package in R I get the following error:
Compilation ERROR, function(s)/method(s) not created! c:/Rtools/mingw_64/bin/g++: not found
I can get the model to compile if I copy the mingw_64 directory to a c:/Rtools directory, but this is a large folder and takes some time (~4 mins). Unfortunately I can't simply create a shortcut or symbolic link to the Rtools directory because I don't have admin privileges.
Is this default directory hardcoded into Stan? I had a brief look at the code on GitHub and couldn't see anything to that effect.
Are there other environment variables ect. that I need to set? Alternatively, do you have other ideas for a workaround?