Unfortunately it’s pretty hard right now to get it working with R 3.6 on Mac. It seems to require installing a bunch of packages from source (probably at least Rcpp, StanHeaders, RStan) and I’m not even sure what Makevars settings are required. @bgoodri do you know?
By far the easiest solution is to install the latest version of R (probably a good idea anyway) and use the following lines in the Makevars file:
# use file.edit(file.path(Sys.getenv("HOME"), ".R", "Makevars"))
# to edit the file and give it these contents:
CXX14FLAGS=-O3 -march=native -mtune=native
CXX14FLAGS += -arch x86_64 -ftemplate-depth-256
I haven’t seen any examples where R 4.0.2 combined with that Makevars file fails on Mac (unless you get an error like Some models run without problems, but more complex give error: Error in unserialize(socklist[[n]]) : error reading/writing from connection, in which case @torkar mentioned that removing -march=native
can solve that on Mac).