Skip to content

CmdStan makefile variables

Rok Češnovar edited this page Aug 7, 2022 · 5 revisions

TBB backend

  • STAN_THREADS - Enable threading using Intel TBB by setting to true.

MPI backend

  • STAN_MPI - Enable multiprocessing using MPI by setting to true. CXX - Set this variable to the name of the MPI wrapper of the C++ compiler, typically mpicxx
  • TBB_CXX_TYPE - Set to gcc or clang, depending on which compiler is called by the MPI wrapper. By default, set this variable to gcc on Linux and clang on MacOS.

OpenCL backend

  • STAN_OPENCL - Enable manycore processing using OpenCL by setting to true.

Optimizations at the C++ level

  • STAN_CPP_OPTIMS - Enable C++ compiler and linker optimization recommended by Stan developers by setting to true . Enabling these optimization can significantly slow down compilation.
  • STAN_NO_RANGE_CHECKS - Setting this variable to true removes range checks from the model for faster runtime. Use this flag with caution and only once the indexing has been validated. In case of any unexpected behavior remove the flag for easier debugging.

stanc3 flags

  • STANCFLAGS - Flags that are forwarded to the Stan-to-C++ compiler (stanc3).

stanc3 development

  • STANC3 - Path to the stanc3 folder. If the folder is specified, the binaries will be copied from the given folder and built if necessary.
  • STANC3_TEST_BIN_URL - URL to download stanc3 binaries from. Used if specified and the STANC3 variable is not set.
  • STANC3_VERSION - If specified, determines the stanc3 version to be downloaded when (re)building CmdStan. The default version is nightly. Can be used when using older Stan version with CmdStan. Is only used if the above two makefile variables are not specified and the release binaries are not present in the bin/folder.
Clone this wiki locally