You were close. This works for me:
STAN_THREADS=TRUE
STAN_NO_RANGE_CHECKS=TRUE
LDLIBS = -lblas -llapack -llapacke
CXXFLAGS += -mcpu=native -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE
LDFLAGS += -framework Accelerate -L/opt/homebrew/opt/lapack/lib
CXXFLAGS_OPTIM=-mcpu=native
CXXFLAGS_OPTIM_TBB=-mcpu=native
CXXFLAGS_OPTIM_SUNDIALS=-mcpu=native
Note that this uses the homebrew lapacke libraries which you get with brew install lapack
. The settings you posted earlier were tailored for macports (as suggested by Eigen, but homebrew seems to work just as well).
Thanks for making me aware of the Accelerate framework.
With the above settings I just compiled cmdstan 2.33.0 and the Bernoulli example…no tests yet.