Rtools not properly detected in R3.6.0 under Windows 10

Dear stan users,

I had problems installing rstan (2.18.2) under R 3.6.0 on a Windows 10 machine by following the default instructions.

The problem was with Rtools3.5. Although the line:

pkgbuild::has_build_tools(debug = TRUE)

returned TRUE as it should, the tool chain was not working.

After some foul language, some googling and a few hours lost I found and fixed the problem. In order to save other people from losing time I thought I just post my solution in one place.

  1. Unlike indicated in the installing instructions, Rtools needs to be included in the system path like so:

  2. The Makevars.win file need to include the line

CXX14=$(BINPREF)g++ -O2 -march=native -mtune=native

That’s all, hope it helps.



This fix almost deserves a PSA.

Sorry for the headache and thanks for sharing the fix that worked for you.

I don’t have Windows so can’t check for myself, maybe @bgoodri or @paul.buerkner can confirm? We definitely need to change the instructions if this is not some weird special case.

We just need to get a new rstan onto CRAN.

Thanks! One question: In (1), you write about “sys_path”, but this does not seem to be the full line you added to the system path, right?

Thanks for all the responses. As for the system path vars, I manually added:

Actually these might be added automatically by ticking a box in one of the installer windows:path

Had the exact same problem - solved it for me as well. Many thanks, Seb.

It took me HOURS to get to a solution - what is the problem with R 3.6, Rtools, and Stan not playing well with each other? I’d like to try and avoid these issues at work in the future, as it caused considerable downtime for my team.

1 Like

I’ve been fighting with conflicts resulting from updating to R 3.6 for days now. Specifically, when fitting models using brms that include group variables, my R just dies without a message. rstanarm functions seem to work fine, though.

Just tried this, and it still isn’t working properly for me, unfortunately. It seems a lot of people are having this 3.6/rstan/Windows 10 conflict.