cmdstan icon indicating copy to clipboard operation
cmdstan copied to clipboard

Expected? cmdstan considers binary up-to-date when make is run with different build args

Open katrinabrock opened this issue 1 year ago • 1 comments
trafficstars

Summary:

cmdstan does not automatically recompile a model when build args change. If this is expected, would be good to document.

Description:

Doc states

If the you call Make with target bernoulli twice in a row, without any editing bernoulli.stan or otherwise changing the system, on the second invocation, Make will determine that the executable is already newer than the Stan source file and will not recompile the program:

It's unclear whether changing a build arg such as STAN_THREADS or STAN_OPENCL constitutes "otherwise changing the system". Would be good to clarify this.

Reproducible Steps:

make examples/bernoulli/bernoulli
STAN_THREADS=true make examples/bernoulli/bernoulli

I got the same behavior editing make/local.

Current Output:

make: 'examples/bernoulli/bernoulli' is up to date.

Expected Output:

Describe what you expect the output to be. Knowing the correct behavior is also very useful.

Additional Information:

Related cmdstanr discussions: https://github.com/stan-dev/cmdstanr/issues/1019 https://github.com/stan-dev/cmdstanr/pull/1022

Current Version:

v2.35.0

katrinabrock avatar Aug 21 '24 14:08 katrinabrock

This is a known bug that is basically not fixable when using make.

There are some ways you can hack around it, and we have some half-attempts at doing so (for example, on a clean install, the example you gave should trigger a rebuild the first time...) but the "right" way to do this is to use a different build system entirely

WardBrian avatar Aug 21 '24 14:08 WardBrian