Make compile(..., cpp_options()) consistent with makefile options
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 160
- Forks
- 69
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 15
Description
Several things about enabling TBB and OpenCL are incredibly confusing and documented nowhere:
- If STAN_OPENCL or STAN_THREADS are set, they will be enabled regardless of the cpp_options in the compile() function. (I believe this even holds true when they are set to anything (true or false) in the makefile, but am not 100% firm on that.)
- The CmdStanModel$cpp_options() returns STAN_OPENCL and STAN_THREADS set to TRUE no matter what is set in the makefile. The actual cpp_options in the compile() function do not change the reported values, although they do work for changing the actual application of either option.
- When the cpp_options are changed, the model is not recompiled automatically via the same mechanism that recompiles if the model file changed.
I'm mostly sure that this is the actual behavior on my machine, but I may have forgotten to recompile the model at some point.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the behavior through CmdStanModel$compile(..., cpp_options()) and inspect CmdStanModel$cpp_options() alongside the makefile settings. Check how STAN_OPENCL and STAN_THREADS are enabled, reported, and considered when deciding whether to recompile. Done means the compile options and reported values are consistent with the makefile, and changing them triggers recompilation when needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100