Building stanc3 binaries - now simplified

Hi all,

we have added a new and simplified way of building stanc3 binaries for Windows/macOS/Linux for everyone, not just those with write permissions to the stanc3 repository.

Why would anyone need to build stanc3 binaries for all OS?

Building stanc3 binaries is not something every user will require. But it is useful at least for the following reasons:

  • custom stanc3 binaries to accompany papers

For example the code that accompanies the paper on Laplace approximation for latent Gaussian models by @charlesm93 et al.

  • testing new PRs, features or stanc3 branches

If you find some stanc3 PR or branch interesting and you want to try it out without building OCaml code locally or you made a stanc3 branch and you want to share binaries with your colleagues. Like for example the new closures PR by @nhuurre.

  • maintaining your own custom version of cmdstan/rstan

If you want to maintain your own custom version of cmdstan/rstan you will need to supply either the binaries or your own version of stanc.js (for rstan). An example of this is Torsten, maintained by @yizhang et al.

How to build binaries if you do not have write permissions to the stan-dev/stanc3 repo

  1. Fork stan-dev/stanc3

  2. Open the Actions tab on your new fork and enable Github Actions

  3. Select Build binaries

  4. Click Run workflow and under “Branch to use for building binaries” write the name of the branch to build (or a git hash).

  5. Download the built binaries. Example of a finished run:

The build runs for 40 minutes if it has not been run for a week. If it has been run in the last 7 days the dependencies will be cached and the build will run for ~5 minutes.

How to build binaries if you have write permissions to the stan-dev/stanc3 repo

Start the above from step 3 on stan-dev/stanc3 and that is it.

Just wanted to let everyone know we have this option. Tagging a few people that might be interested in this apart from those I already tagged: @seantalts @bbbales2 @rybern

Let me or @serban-nicusor know if something brakes or you have a suggestion to improve it.


Wow very cool!

1 Like

Kudos to @rok_cesnovar saving me & @billg from reinventing the wheel!