cmdstanpy
cmdstanpy copied to clipboard
Setting `CXXFLAGS` breaks compilation
Summary:
>>> stan_file = os.path.join(cmdstan_path(), 'examples', 'bernoulli', 'bernoulli.stan')
>>> model = CmdStanModel(stan_file=stan_file, force_compile=True, cpp_options={"CXXFLAGS":"-march=native"})
Description:
We invoke this like make CXXFLAGS=-march=native bernoulli, but it seems the way CmdStan's makefiles are set up, this means none of the default flags are set up.
Using += doesn't make it work, either.
On the command line,
make CXXFLAGS=-march=native examples/bernoulli/bernoulli does not work
CXXFLAGS+=-march=native make examples/bernoulli/bernoulli works
A workaround seems to be using CXXFLAGS_PROGRAM instead. This is handled by cmdstan's makefiles differently.
Additional Information:
Current Version:
1.2, CmdStan 2.34