As you all have noticed, there are a large number of people who are having problems with rstan 2.21.x on Windows. This thread is to try to bring those threads together.
Eliminate all -march=native
clauses from CXX14FLAGS
in the ~/.R/Makevars.win or ~/.R/Makevars files, which you can do by calling file.edit("~/.R/Makevars.win")
and file.edit("~/.R/Makevars")
. Even though the startup message says to consider adding it to Sys.setenv(LOCAL_CPPFLAGS)
, do not do that.
Note that the temporary URLs below will eventually die and I will need to regenerate / change them.
For R 3.x
If you are using R version 3.x, please do
install.packages(
"https://artifacts.r-hub.io/StanHeaders_2.21.0-6.tar.gz-6fc9f644607800c88f50865e72d8a81a/StanHeaders_2.21.0-6.zip",
repos = NULL, type = "win.binary")
install.packages(
"https://win-builder.r-project.org/EwLg0orTrr82/rstan_2.21.2.zip",
repos = NULL, type = "win.binary")
which should allow you to compile and run Stan models. However, I suspect that many of you will run into problems where the sampling fails, which we will need to follow up on.
We think you can get away with
CXX11FLAGS=-O3 -mtune=native -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2
but not -march=native
.
For R 4.x
Please do
install.packages(
"https://artifacts.r-hub.io/StanHeaders_2.21.0-6.tar.gz-d74e0af7c9e06cba7d975cd8d3dbcf87/StanHeaders_2.21.0-6.zip",
repos = NULL, type = "win.binary")
install.packages(
"https://artifacts.r-hub.io/rstan_2.21.2.tar.gz-639222303bb62625e2349320b5adb986/rstan_2.21.2.zip",
repos = NULL, type = "win.binary")
which should allow you to compile and run Stan models. However, I suspect that many of you will run into problems where the sampling fails, which we will need to follow up on.
We think you can get away with
CXX14FLAGS=-O3 -mtune=native -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2
but not -march=native
.
Stack overflow-like Problems
Your models, particularly if they are non-trivial, might crash or exhibit errors that say things like
==== C stack trace ===============================
At the moment, we are not sure if this problem still exists or how to solve it.