Dependencies

Stanc3 is programmed in OCaml and built with dune.

Build Dependencies

We rely on the following packages. Note that because of the requirements for Cross Compilation for Windows, these versions are exactly pinned.

These are automatically installed through the scripts/install_ocaml.sh and scripts/install_build_deps.sh scripts provided in the stanc3 repository.

For the JavaScript interface to stanc3 we also use the following, installed via scripts/install_js_deps.sh

The stancjs executable can be built with

dune build src/stancjs

Development Dependencies

There are several packages which are useful for development but not required for building stanc3. These can be installed with scripts/install_dev_deps.sh, or (alongside the above build requirements) with scripts/setup_dev_env.sh. Versioning of these dependencies is less strict, though some (like ocamlformat) are used to ensure a standard format across developers and must use the same version.

Cross Compilation for Windows

To support Windows binaries, we use versions of OCaml and all our dependencies which are available on opam-cross-windows. This allows us to build Windows-compatible versions on non-Windows machines.

For more information on cross-compilation, see the dune docs.

To build Windows binaries, the above build requirements must have their opam-cross-windows equivalents installed. This can be done by executing scripts/install_build_deps_windows.sh.

Then, the command

dune build -x windows

will build a Windows binary.