For those interested, the answer to this problem was to give up on Rstan and use CmdStanR. Thanks to @jonah I followed:
and then follow the instructions in
This worked generally without any real hitches (a number of packages did not install on the first pass, and I had to set the path but otherwise this took 1/20th of the time I spent just to get stuck on my Makevars file).
Hi @lizzieinvancouver thanks for sharing. I’m wondering whether you followed only the instructions in 1.2.1.2 MacOS: clang++ and make or whether any of the other instructions in 1 CmdStan Installation applied?
I’m only following these instructions so that I can eventually install brms, which requires installation of Rstan, so I’m really hoping this works.
According to @bgoodri the error that happens with the Mac toolchain is a false positive. That is, there’s a message that says it failed but in many cases you can proceed as if it succeeded and rstan will work. I haven’t been able to verify this myself because I don’t have the right setup on my computer yet.
@mcraft it’s now possible to use brms with cmdstanr as the backend instead of rstan (I think rstan will still be installed but brms won’t require that you can successfully compile models with rstan if you use backend="cmdstanr").
@lizzieinvancouver one thing you can do is convert a model fit using cmdstanr to a stanfit object from rstan. That way you can use the post-processing stuff from rstan if you prefer it. There’s an example at Getting started with CmdStanR • cmdstanr. This requires the rstan package be installed but does not require that you can successfully compile models with rstan.
Quick update (@mcraft):
Based on @jonah recommendations I just went back and followed the instructions here again. The installer failed again, but as @bgoodri suggested it may be a false positive as my test model compiled in the end. Happy chains.