0
votes

I want to use a program called Stan within R. To do so I need to install Rtools to get the C++ compiler. According to the Stan website, I am to check the box for editing path upon installation of Rtools.

For some reason R can't seem to find the compiler.

Sys.getenv("PATH") [1] "c:\Rtools\bin;c:\Rtools\mingw_64\bin;c:\Rtools\bin;c:\MiKTeX\miktex\bin;c:\R\R-3.2\bin\i386;c:\windows;c:\windows\system32;C:\Users\a3988\AppData\Local\Microsoft\WindowsApps;"

system('g++ -v') Warning message: running command 'g++ -v' had status 127

Sys.which("g++") g++ "c:\Rtools\mingw_64\bin\G__~1.EXE"

Can anybody help? I am using R-version: 3.4.2 Rtools34 Windows10

1
What do you get when you type gcc --help in the terminal?user 123342
...in other words, are the gcc compilers installed on your computer?user 123342
Have a look at this answer linkuser 123342
I get:Error: object 'gcc' not found. Isn't the gcc part of the Rtools?Kristin Windsland

1 Answers

0
votes

You first need to install the gcc compilers and then you can install Rtools: https://github.com/stan-dev/rstan/wiki/Install-Rtools-for-Windows.