R constantly crashing after rstan install

I’m finding that R repeatedly crashes on non-rstan code, almost exactly as described here

I’m also on OSX (10.15.7) and using R 4.0.3. Rstan is from source. Have tried multiple reinstalls but the same problem reappears as soon as I install rstan. The crashes often happen when I try to install other packages (including rstanarm). R just hangs during the subsequent install. If I hit esc, the error I get is that some .tgz from the subsequent package “is not a macOS binary package”. Also the (brand new) hardware seems to run very hot.

Grateful for any suggestions as to what to do!


I don’t think you should need to install rstan from source on a Mac with R 4.x, but even still I don’t know how it would cause crashes with other packages. What is in your ~/.R/Makevars ?

Thanks for the response, I must have misread somewhere. After reinstalling R and then just installing stan normally, it (so far) all seems to run fine.

~/.R/Makevars has:
CXX14FLAGS += -O3 -mtune=native -arch x86_64 -ftemplate-depth-256