Skip to content

Add make/local as a dependency of the pre-compiled header file #757

Description

@rok-cesnovar

Summary:

If you run make build without CXXFLAGS += -DSTAN_THREADS and then build your model with CXXFLAGS += -DSTAN_THREADS you get the following message

/usr/bin/ld: _ZN4stan4math22AutodiffStackSingletonINS0_4variENS0_15chainable_allocEE9instance_E: TLS definition in examples/bernoulli/bernoulli.o section .tbss._ZN4stan4math22AutodiffStackSingletonINS0_4variENS0_15chainable_allocEE9instance_E[_ZN4stan4math22AutodiffStackSingletonINS0_4variENS0_15chainable_allocEE9instance_E] mismatches non-TLS reference in src/cmdstan/main.o
src/cmdstan/main.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make/program:41: recipe for target 'examples/bernoulli/bernoulli' failed

A similar issue arises vice-versa, if make build is done with the flag and the model is built without it. I know this issue eill go away once threading is the norm which hopefully comes sooner rather than later.

Can we somehow flag (a stan_threads file in make/ folder idk?) if cmdstan was built with STAN_THREADS and then use that to force a make clean-all and a rebuild if compiling a model with a different setting?

Reproducible Steps:

See above.

Additional Information:

Provide any additional information here.

Current Version:

v2.20.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions