Paul, I was afraid someone would ask that question, and I don’t have a great answer.
If I do C-x d ~/
in Emacs, which I think should get me my HOME directory, I get c:/Users/myusername/AppData/Roaming
, which does not seem to be the correct directory.
If I open https://mc-stan.org, select Installation, Rstan, and then the RStan Quick Start Guide, I see a section called Configuration of the C++ Toolchain. That has R code that creates a Makevars.win
file in the appropriate directory.
The first thing to draw from that is the command file.path(Sys.getenv("HOME"), ".R")
tells me where R thinks my HOME directory is, and that seems to work for me.
The second thing to draw from that is that what it puts in the file and what I’m using are different. Meichun found what I’m now using somewhere on Discourse, but I don’t have a link to give you. What’s worse, since I’m not a C++ programmer, nor do I have the time right now to become one, I can’t really make any arguments about why my file works or should work or why it should be better or worse than that recommended on the rstan Installation page.
If it makes you feel any better, I found this in a separate discussion:
“Calling install.packages(“rstan”, dependencies = TRUE) has rarely thrown an error and then doing library(rstan) allows it to sample from models that have already been compiled. Nor do the toolchain installers fail to install a toolchain. The primary problem has been the configuration step to use an installed toolchain among people who have never compiled code before, and even that is largely confined to Windows.” (emphasis mine)
I think that’s where my problem was, and I don’t know why it happened now; I seem to recall earlier installations working without incident.