Skip to content

STAN_CPP_OPTIMS=true in make/local results in STAN_CPP_OPTIMS=false in model info #1326

@amas0

Description

@amas0

Related to stan-dev/cmdstanpy#794.

In cmdstan directory with no make/local I run:

make examples/bernoulli/bernoulli
./examples/bernoulli/bernoulli info

this gives:

stan_version_major = 2
stan_version_minor = 36
stan_version_patch = 0
STAN_THREADS=false
STAN_MPI=false
STAN_OPENCL=false
STAN_NO_RANGE_CHECKS=false
STAN_CPP_OPTIMS=false

Now if I create a make/local with STAN_CPP_OPTIMS=true and run:

make clean-all
make examples/bernoulli/bernoulli
./examples/bernoulli/bernoulli info

again gives:

stan_version_major = 2
stan_version_minor = 36
stan_version_patch = 0
STAN_THREADS=false
STAN_MPI=false
STAN_OPENCL=false
STAN_NO_RANGE_CHECKS=false
STAN_CPP_OPTIMS=false

I have confirmed that modifying STAN_THREADS in a similar way successfully reports STAN_THREADS=true from the model info.

I compared the compilation times with/without STAN_CPP_OPTIMS=true by running

make clean-all
time make examples/bernoulli/bernoulli

four times, modifying whether STAN_CPP_OPTIMS was present in my make/local each time. This gave:

NO STAN_CPP_OPTIMS
make examples/bernoulli/bernoulli  74.15s user 3.27s system 99% cpu 1:17.63 total

WITH STAN_CPP_OPTIMS
make examples/bernoulli/bernoulli  79.18s user 3.83s system 99% cpu 1:23.26 total

WITH STAN_CPP_OPTIMS
make examples/bernoulli/bernoulli  80.16s user 3.87s system 99% cpu 1:24.28 total

NO STAN_CPP_OPTIMS
make examples/bernoulli/bernoulli  74.68s user 3.30s system 99% cpu 1:18.20 total

So it seems like the options is impacting compilation, perhaps just an issue reporting from model info?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions