The default flags for macOS are:
-fPIC -Wall -g -O2
rstan
from Installing RStan on Mac or Linux wiki page recommends:
CXXFLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -Wno-macro-redefined
“Noise” is generated due to the lack of -Wno-unused-variable -Wno-unused-function -Wno-macro-redefined
in the default flags. There is also less optimization -O2
vs. -O3
.