Configuration Options

This document lists the options available for compiling Cantera with SCons. This list is for the development version of Cantera. For the current release, see this list.

The default values are operating-system dependent. To see the defaults for your current operating system, run the command:

scons help

from the command prompt.

The following options can be passed to SCons to customize the Cantera build process. They should be given in the form:

scons build option1=value1 option2=value2

Variables set in this way will be stored in the cantera.conf file and reused automatically on subsequent invocations of SCons. Alternatively, the configuration options can be entered directly into cantera.conf before running scons build. The format of this file is:

option1 = 'value1'
option2 = 'value2'

Options List

  • msvc_version: [ string ] Version of Visual Studio to use. The default is the newest installed version. Specify 12.0 for Visual Studio 2013, 14.0 for Visual Studio 2015, 14.1 (14.1x) Visual Studio 2017, or 14.2 (14.2x) for Visual Studio 2019. For version numbers in parentheses, x is a placeholder for a minor version number. Windows MSVC only.

    • default: ''

  • target_arch: [ 'amd64' | 'x86' ] Target architecture. The default is the same architecture as the installed version of Python. Windows only.

    • default: platform dependent

      • Windows: 'amd64'

  • toolchain: [ 'msvc' | 'mingw' | 'intel' ] The preferred compiler toolchain. If MSVC is not on the path but g++ is on the path, mingw is used as a backup. Windows only.

    • default: platform dependent

      • Windows: 'msvc'

  • CXX: [ string ] The C++ compiler to use.

    • default: '${CXX}'

  • cxx_flags: [ string ] Compiler flags passed to the C++ compiler only. Separate multiple options with spaces, for example, "cxx_flags='-g -Wextra -O3 --std=c++11'"

    • default: compiler dependent

      • If using MSVC: '/EHsc'

      • If using Cygwin: '-std=gnu++11'

      • Otherwise: '-std=c++11'

  • CC: [ string ] The C compiler to use. This is only used to compile CVODE.

    • default: '${CC}'

  • cc_flags: [ string ] Compiler flags passed to both the C and C++ compilers, regardless of optimization level.

    • default: compiler dependent

      • If using MSVC: '/MD /nologo /D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS'

      • If using ICC: '-vec-report0 -diag-disable 1478'

      • If using Clang: '-fcolor-diagnostics'

      • Otherwise: ''

  • prefix: [ path/to/prefix ] Set this to the directory where Cantera should be installed. On Windows systems, $ProgramFiles typically refers to "C:\Program Files".

    • default: platform dependent

      • Windows: '$ProgramFiles\Cantera'

      • Otherwise: '/usr/local'

  • libdirname: [ path/to/libdirname ] Set this to the directory where Cantera libraries should be installed. Some distributions (for example, Fedora/RHEL) use lib64 instead of lib on 64-bit systems or could use some other library directory name instead of lib, depending on architecture and profile (for example, Gentoo libx32 on x32 profile). If the user didn't set the libdirname configuration variable, set it to the default value lib

    • default: 'lib'

  • python_package: [ 'n' | 'y' | 'full' | 'minimal' | 'none' | 'default' ] If you plan to work in Python, then you need the full Cantera Python package. If, on the other hand, you will only use Cantera from some other language (for example, MATLAB or Fortran 90/95) and only need Python to process YAML files, then you only need a minimal subset of the package and Cython and NumPy are not necessary. The none option doesn't install any components of the Python interface. The default behavior is to build the full Python module for whichever version of Python is running SCons if the required prerequisites (NumPy and Cython) are installed. Note: y is a synonym for full and n is a synonym for none.

    • default: 'default'

  • python_sdist: [ 'yes' | 'no' ] Setting this option to True builds the Python sdist.

    • default: 'no'

  • python_cmd: [ path/to/python_cmd ] Cantera needs to know where to find the Python interpreter. If PYTHON_CMD is not set, then the configuration process will use the same Python interpreter being used by SCons.

    • default: '${PYTHON_CMD}'

  • python_prefix: [ path/to/python_prefix ] Use this option if you want to install the Cantera Python package to an alternate location. On Unix-like systems, the default is the same as the prefix option. If the python_prefix option is set to the empty string or the prefix option is not set, then the package will be installed to the system default site-packages directory. To install to the current user's site-packages directory, use python_prefix=USER.

    • default: platform dependent

      • Windows: ''

      • Otherwise: '$prefix'

  • matlab_toolbox: [ 'n' | 'y' | 'default' ] This variable controls whether the MATLAB toolbox will be built. If set to y, you will also need to set the value of the matlab_path variable. If set to default, the MATLAB toolbox will be built if matlab_path is set.

    • default: 'default'

  • matlab_path: [ path/to/matlab_path ] Path to the MATLAB install directory. This should be the directory containing the extern, bin, etc. subdirectories. Typical values are: "C:\Program Files\MATLAB\R2021a" on Windows, "/Applications/MATLAB_R2021a.app" on macOS, or "/opt/MATLAB/R2021a" on Linux.

    • default: ''

  • f90_interface: [ 'n' | 'y' | 'default' ] This variable controls whether the Fortran 90/95 interface will be built. If set to default, the builder will look for a compatible Fortran compiler in the PATH environment variable, and compile the Fortran 90 interface if one is found.

    • default: 'default'

  • FORTRAN: [ path/to/FORTRAN ] The Fortran (90) compiler. If unspecified, the builder will look for a compatible compiler (pgfortran, gfortran, ifort, g95) in the PATH environment variable. Used only for compiling the Fortran 90 interface.

    • default: ''

  • FORTRANFLAGS: [ string ] Compilation options for the Fortran (90) compiler.

    • default: '-O3'

  • coverage: [ 'yes' | 'no' ] Enable collection of code coverage information with gcov. Available only when compiling with gcc.

    • default: 'no'

  • doxygen_docs: [ 'yes' | 'no' ] Build HTML documentation for the C++ interface using Doxygen.

    • default: 'no'

  • sphinx_docs: [ 'yes' | 'no' ] Build HTML documentation for Cantera using Sphinx.

    • default: 'no'

  • sphinx_cmd: [ path/to/sphinx_cmd ] Command to use for building the Sphinx documentation.

    • default: 'sphinx-build'

  • sphinx_options: [ string ] Options passed to the sphinx_cmd command line. Separate multiple options with spaces, for example, "-W --keep-going".

    • default: '-W --keep-going'

  • system_eigen: [ 'n' | 'y' | 'default' ] Select whether to use Eigen from a system installation (y), from a Git submodule (n), or to decide automatically (default). If Eigen is not installed directly into a system include directory, for example, it is installed in /opt/include/eigen3/Eigen, then you will need to add /opt/include/eigen3 to extra_inc_dirs.

    • default: 'default'

  • system_fmt: [ 'n' | 'y' | 'default' ] Select whether to use the fmt library from a system installation (y), from a Git submodule (n), or to decide automatically (default). If you do not want to use the Git submodule and fmt is not installed directly into system include and library directories, then you will need to add those directories to extra_inc_dirs and extra_lib_dirs. This installation of fmt must include the shared version of the library, for example, libfmt.so.

    • default: 'default'

  • system_yamlcpp: [ 'n' | 'y' | 'default' ] Select whether to use the yaml-cpp library from a system installation (y), from a Git submodule (n), or to decide automatically (default). If yaml-cpp is not installed directly into system include and library directories, then you will need to add those directories to extra_inc_dirs and extra_lib_dirs.

    • default: 'default'

  • system_sundials: [ 'n' | 'y' | 'default' ] Select whether to use SUNDIALS from a system installation (y), from a Git submodule (n), or to decide automatically (default). Specifying sundials_include or sundials_libdir changes the default to y.

    • default: 'default'

  • sundials_include: [ path/to/sundials_include ] The directory where the SUNDIALS header files are installed. This should be the directory that contains the "cvodes", "nvector", etc. subdirectories. Not needed if the headers are installed in a standard location, for example, /usr/include.

    • default: ''

  • sundials_libdir: [ path/to/sundials_libdir ] The directory where the SUNDIALS static libraries are installed. Not needed if the libraries are installed in a standard location, for example, /usr/lib.

    • default: ''

  • blas_lapack_libs: [ string ] Cantera can use BLAS and LAPACK libraries available on your system if you have optimized versions available (for example, Intel MKL). Otherwise, Cantera will use Eigen for linear algebra support. To use BLAS and LAPACK, set blas_lapack_libs to the the list of libraries that should be passed to the linker, separated by commas, for example, "lapack,blas" or "lapack,f77blas,cblas,atlas". Eigen is required whether or not BLAS/LAPACK are used.

    • default: ''

  • blas_lapack_dir: [ path/to/blas_lapack_dir ] Directory containing the libraries specified by blas_lapack_libs. Not needed if the libraries are installed in a standard location, for example, /usr/lib.

    • default: ''

  • lapack_names: [ 'lower' | 'upper' ] Set depending on whether the procedure names in the specified libraries are lowercase or uppercase. If you don't know, run 'nm' on the library file (for example, "nm libblas.a").

    • default: 'lower'

  • lapack_ftn_trailing_underscore: [ 'yes' | 'no' ] Controls whether the LAPACK functions have a trailing underscore in the Fortran libraries.

    • default: 'yes'

  • lapack_ftn_string_len_at_end: [ 'yes' | 'no' ] Controls whether the LAPACK functions have the string length argument at the end of the argument list (yes) or after each argument (no) in the Fortran libraries.

    • default: 'yes'

  • googletest: [ 'default' | 'system' | 'submodule' | 'none' ] Select whether to use gtest/gmock from system installation (system), from a Git submodule (submodule), to decide automatically (default) or don't look for gtest/gmock (none) and don't run tests that depend on gtest/gmock.

    • default: 'default'

  • env_vars: [ string ] Environment variables to propagate through to SCons. Either the string all or a comma separated list of variable names, for example, LD_LIBRARY_PATH,HOME.

    • default: 'PATH,LD_LIBRARY_PATH,PYTHONPATH'

  • use_pch: [ 'yes' | 'no' ] Use a precompiled-header to speed up compilation

    • default: compiler dependent

      • If using ICC: 'no'

      • Otherwise: 'yes'

  • pch_flags: [ string ] Compiler flags when using precompiled-header.

    • default: compiler dependent

      • If using MSVC: '/FIpch/system.h'

      • If using GCC: '-include src/pch/system.h'

      • If using Clang: '-include-pch src/pch/system.h.gch'

      • Otherwise: ''

  • thread_flags: [ string ] Compiler and linker flags for POSIX multithreading support.

    • default: platform dependent

      • Windows: ''

      • macOS: ''

      • Otherwise: '-pthread'

  • optimize: [ 'yes' | 'no' ] Enable extra compiler optimizations specified by the optimize_flags variable, instead of the flags specified by the no_optimize_flags variable.

    • default: 'yes'

  • optimize_flags: [ string ] Additional compiler flags passed to the C/C++ compiler when optimize=yes.

    • default: compiler dependent

      • If using MSVC: '/O2'

      • If using GCC: '-O3 -Wno-inline'

      • Otherwise: '-O3'

  • no_optimize_flags: [ string ] Additional compiler flags passed to the C/C++ compiler when optimize=no.

    • default: compiler dependent

      • If using MSVC: '/Od /Ob0'

      • Otherwise: '-O0'

  • debug: [ 'yes' | 'no' ] Enable compiler debugging symbols.

    • default: 'yes'

  • debug_flags: [ string ] Additional compiler flags passed to the C/C++ compiler when debug=yes.

    • default: compiler dependent

      • If using MSVC: '/Zi /Fd${TARGET}.pdb'

      • Otherwise: '-g'

  • no_debug_flags: [ string ] Additional compiler flags passed to the C/C++ compiler when debug=no.

    • default: ''

  • debug_linker_flags: [ string ] Additional options passed to the linker when debug=yes.

    • default: compiler dependent

      • If using MSVC: '/DEBUG'

      • Otherwise: ''

  • no_debug_linker_flags: [ string ] Additional options passed to the linker when debug=no.

    • default: ''

  • warning_flags: [ string ] Additional compiler flags passed to the C/C++ compiler to enable extra warnings. Used only when compiling source code that is part of Cantera (for example, excluding code in the ext directory).

    • default: compiler dependent

      • If using MSVC: '/W3'

      • If using ICC: '-Wcheck'

      • Otherwise: '-Wall'

  • extra_inc_dirs: [ string ] Additional directories to search for header files, with multiple directories separated by colons (*nix, macOS) or semicolons (Windows)

    • default: ''

  • extra_lib_dirs: [ string ] Additional directories to search for libraries, with multiple directories separated by colons (*nix, macOS) or semicolons (Windows)

    • default: ''

  • boost_inc_dir: [ path/to/boost_inc_dir ] Location of the Boost header files. Not needed if the headers are installed in a standard location, for example, /usr/include.

    • default: ''

  • stage_dir: [ path/to/stage_dir ] Directory relative to the Cantera source directory to be used as a staging area for building for example, a Debian package. If specified, 'scons install' will install files to stage_dir/prefix/....

    • default: ''

  • VERBOSE: [ 'yes' | 'no' ] Create verbose output about what SCons is doing.

    • default: 'no'

  • gtest_flags: [ string ] Additional options passed to each GTest test suite, for example, --gtest_filter=*pattern*. Separate multiple options with spaces.

    • default: ''

  • renamed_shared_libraries: [ 'yes' | 'no' ] If this option is turned on, the shared libraries that are created will be renamed to have a _shared extension added to their base name. If not, the base names will be the same as the static libraries. In some cases this simplifies subsequent linking environments with static libraries and avoids a bug with using valgrind with the -static linking flag.

    • default: 'yes'

  • versioned_shared_library: [ 'yes' | 'no' ] If enabled, create a versioned shared library, with symlinks to the more generic library name, for example, libcantera_shared.so.2.5.0 as the actual library and libcantera_shared.so and libcantera_shared.so.2 as symlinks.

    • default: toolchain dependent

      • If using mingw: 'no'

      • Otherwise: 'yes'

  • use_rpath_linkage: [ 'yes' | 'no' ] If enabled, link to all shared libraries using rpath, i.e., a fixed run-time search path for dynamic library loading.

    • default: 'yes'

  • openmp_flag: [ string ] Compiler flags used for multiprocessing (only used to generate sample build scripts).

    • default: compiler dependent

      • If using MSVC: '/openmp'

      • If using ICC: 'openmp'

      • If using apple-clang: '-Xpreprocessor -fopenmp'

      • Otherwise: '-fopenmp'

  • layout: [ 'standard' | 'compact' | 'debian' ] The layout of the directory structure. standard installs files to several subdirectories under 'prefix', for example, prefix/bin, prefix/include/cantera, prefix/lib etc. This layout is best used in conjunction with "prefix='/usr/local'". compact puts all installed files in the subdirectory defined by 'prefix'. This layout is best with a prefix like /opt/cantera. debian installs to the stage directory in a layout used for generating Debian packages.

    • default: platform dependent

      • Windows: 'compact'

      • Otherwise: 'standard'

  • fast_fail_tests: [ 'yes' | 'no' ] If enabled, tests will exit at the first failure.

    • default: 'no'

  • skip_slow_tests: [ 'yes' | 'no' ] If enabled, skip a subset of tests that are known to have long runtimes. Skipping these may be desirable when running with options that cause tests to run slowly, like disabling optimization or activating code profiling.

    • default: 'no'

  • show_long_tests: [ 'yes' | 'no' ] If enabled, duration of slowest tests will be shown.

    • default: 'no'

  • verbose_tests: [ 'yes' | 'no' ] If enabled, verbose test output will be shown.

    • default: 'no'

  • legacy_rate_constants: [ 'yes' | 'no' ] If enabled, rate constant calculations include third-body concentrations for three-body reactions, which corresponds to the legacy implementation. For Cantera 2.6, the option remains enabled (no change compared to past behavior). After Cantera 2.6, the default will be to disable this option, and rate constant calculations will be consistent with conventional definitions (see Eq. 9.75 in Kee, Coltrin and Glarborg, 'Chemically Reacting Flow', Wiley Interscience, 2003).

    • default: 'yes'