Skip to content

Conversation

@amas0
Copy link
Collaborator

@amas0 amas0 commented Nov 14, 2025

Submission Checklist

  • Run unit tests
  • Declare copyright holder and open-source license: see below

Summary

This adds two new boolean keyword arguments to CmdStanModel: multithreading and stanc_optimizations. These are included as a short-hand way to enable the common compilation options STAN_THREADS and O1 optimizations in stanc.

Also updates workflow documentation on model compilation to mention these new options and reflect recent removal of deprecated compile options.

Resolves #837 and #836.

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): myself

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

Copy link
Member

@WardBrian WardBrian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling! A couple minor comments:

@amas0 amas0 linked an issue Nov 14, 2025 that may be closed by this pull request
@WardBrian
Copy link
Member

Should we add these to compilation.compile_stan_model do you think? That is ultimately what gets called by the constructor, but it is also available to users.

@amas0
Copy link
Collaborator Author

amas0 commented Nov 14, 2025

I considered it when implementing this.

It'd be an easy change, but I wasn't sure I liked the idea of adding the same keyword args to both CmdStanModel and compile_stan_model every time we wanted to add a shorthand flag. I also perceived compile_stan_model to be a bit lower-level.

I don't feel that strongly about it. Happy to make the change if you think it'd be useful.

@WardBrian
Copy link
Member

Seems fair — it’s easy enough to add them later if we desire

@amas0 amas0 merged commit 56fb50d into stan-dev:develop Nov 14, 2025
16 checks passed
@amas0 amas0 deleted the add-compilation-kwargs branch November 14, 2025 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should we expose common cpp/stanc options as keyword arguments? Update user guide section on compiling

2 participants