Configuration Options#
This document lists the options available for compiling Cantera with SCons.
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#
AR
: [string
] The archiver to use.default:
'${AR}'
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++14'"
default:
'-std=c++17'
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:
'-fcolor-diagnostics'
prefix
: [path/to/prefix
] Set this to the directory where Cantera should be installed. If the Python executable found during compilation is managed byconda
, the installationprefix
defaults to the corresponding environment and theconda
layout will be used for installation (specifying any of the optionsprefix
,python_prefix
,python_cmd
, orlayout
will override this default). On Windows systems,$ProgramFiles
typically refers to"C:\Program Files"
.default:
'/usr/local'
libdirname
: [path/to/libdirname
] Set this to the directory where Cantera libraries should be installed. Some distributions (for example, Fedora/RHEL) uselib64
instead oflib
on 64-bit systems or could use some other library directory name instead oflib
, depending on architecture and profile (for example, Gentoolibx32
on x32 profile). If the user didn’t set thelibdirname
configuration variable, set it to the default valuelib
default:
'lib'
python_package
: ['n'
|'y'
|'full'
|'minimal'
|'none'
|'default'
] If you plan to work in Python, then you need thefull
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 aminimal
subset of the package and Cython and NumPy are not necessary. Thenone
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 forfull
andn
is a synonym fornone
.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. IfPYTHON_CMD
is not set, then the configuration process will use the same Python interpreter being used by SCons.default:
'/Users/speth/mambaforge/envs/ctdev311b/bin/python'
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 theprefix
option. If thepython_prefix
option is set to the empty string or theprefix
option is not set, then the package will be installed to the system defaultsite-packages
directory. To install to the current user’ssite-packages
directory, usepython_prefix=USER
.default:
''
matlab_toolbox
: ['n'
|'y'
|'default'
] This variable controls whether the MATLAB toolbox will be built. If set toy
, you will also need to set the value of thematlab_path
variable. If set todefault
, the MATLAB toolbox will be built ifmatlab_path
is set.default:
'default'
matlab_path
: [path/to/matlab_path
] Path to the MATLAB install directory. This should be the directory containing theextern
,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 todefault
, the builder will look for a compatible Fortran compiler in thePATH
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, ifx, g95) in thePATH
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 thesphinx_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
toextra_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 toextra_inc_dirs
andextra_lib_dirs
. This installation of fmt must include the shared version of the library, for example,libfmt.so
.default:
'default'
hdf_support
: ['n'
|'y'
|'default'
] Select whether to support HDF5 container files natively (y
), disable HDF5 support (n
), or to decide automatically based on the system configuration (default
). Native HDF5 support uses the HDF5 library as well as the header-only HighFive C++ wrapper (see optionsystem_highfive
). Specifyinghdf_include
orhdf_libdir
changes the default toy
.default:
'default'
hdf_include
: [path/to/hdf_include
] The directory where the HDF5 header files are installed. This should be the directory that contains filesH5Version.h
andH5Public.h
, amongst others. Not needed if the headers are installed in a standard location, for example,/usr/include
.default:
''
hdf_libdir
: [path/to/hdf_libdir
] The directory where the HDF5 libraries are installed. Not needed if the libraries are installed in a standard location, for example,/usr/lib
.default:
''
system_highfive
: ['n'
|'y'
|'default'
] Select whether to use HighFive from a system installation (y
), from a Git submodule (n
), or to decide automatically (default
). If HighFive is not installed directly into a system include directory, for example, it is installed in/opt/include/HighFive
, then you will need to add/opt/include/HighFive
toextra_inc_dirs
.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 toextra_inc_dirs
andextra_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
). Specifyingsundials_include
orsundials_libdir
changes the default toy
.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:
''
system_blas_lapack
: ['n'
|'y'
|'default'
] Select whether to use BLAS/LAPACK from a system installation (y
), use Eigen linear algebra support (n
), or to decide automatically based on libraries detected on the system (default
). Specifyingblas_lapack_libs
orblas_lapack_dir
changes the default toy
, whereas installing the Matlab toolbox changes the default ton
. On macOS, thedefault
option uses the Accelerate framework, whereas on other operating systems the preferred option depends on the CPU manufacturer. In general, OpenBLAS (openblas
) is prioritized over standard libraries (lapack,blas
), with Eigen being used if no suitable BLAS/LAPACK libraries are detected. On Intel CPU’s, MKL (Windows:mkl_rt
/ Linux:mkl_rt,dl
) has the highest priority, followed by the other options. Note that Eigen is required whether or not BLAS/LAPACK libraries are used.default:
'default'
blas_lapack_libs
: [string
] Cantera can use BLAS and LAPACK libraries installed on your system if you have optimized versions available (see optionsystem_blas_lapack
). To use specific versions of BLAS and LAPACK, setblas_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"
.default:
''
blas_lapack_dir
: [path/to/blas_lapack_dir
] Directory containing the libraries specified byblas_lapack_libs
. Not needed if the libraries are installed in a standard location, for example,/usr/lib
.default:
''
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 stringall
or a comma separated list of variable names, for example,LD_LIBRARY_PATH,HOME
.default:
'PATH,LD_LIBRARY_PATH,DYLD_LIBRARY_PATH,PYTHONPATH,USERPROFILE'
use_pch
: ['yes'
|'no'
] Use a precompiled-header to speed up compilationdefault:
'yes'
pch_flags
: [string
] Compiler flags when using precompiled-header.default:
'-include-pch src/pch/system.h.gch'
thread_flags
: [string
] Compiler and linker flags for POSIX multithreading support.default:
''
optimize
: ['yes'
|'no'
] Enable extra compiler optimizations specified by theoptimize_flags
variable, instead of the flags specified by theno_optimize_flags
variable.default:
'yes'
optimize_flags
: [string
] Additional compiler flags passed to the C/C++ compiler whenoptimize=yes
.default:
'-O3'
no_optimize_flags
: [string
] Additional compiler flags passed to the C/C++ compiler whenoptimize=no
.default:
'-O0'
debug
: ['yes'
|'no'
] Enable compiler debugging symbols.default:
'yes'
debug_flags
: [string
] Additional compiler flags passed to the C/C++ compiler whendebug=yes
.default:
'-g'
no_debug_flags
: [string
] Additional compiler flags passed to the C/C++ compiler whendebug=no
.default:
''
debug_linker_flags
: [string
] Additional options passed to the linker whendebug=yes
.default:
''
no_debug_linker_flags
: [string
] Additional options passed to the linker whendebug=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 theext
directory).default:
'-Wall'
extra_inc_dirs
: [string
] Additional directories to search for header files, with multiple directories separated by colons (*nix, macOS) or semicolons (Windows). If an activeconda
environment is detected, the corresponding include path is automatically added.default:
''
extra_lib_dirs
: [string
] Additional directories to search for libraries, with multiple directories separated by colons (*nix, macOS) or semicolons (Windows). If an activeconda
environment is detected, the corresponding library path is automatically added.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 tostage_dir/prefix/...
.default:
''
logging
: ['debug'
|'info'
|'warning'
|'error'
|'default'
] Select logging level for SCons output. By default, logging messages use theinfo
level for ‘scons build’ and thewarning
level for all other commands. In case the SCons option--silent
is passed, all messages below theerror
level are suppressed.default:
'default'
gtest_flags
: [string
] Additional options passed to each GTest test suite, for example,--gtest_filter=*pattern*
. Separate multiple options with spaces.default:
''
use_rpath_linkage
: ['yes'
|'no'
] If enabled, link to all shared libraries usingrpath
, that is, 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:
'-Xpreprocessor -fopenmp'
layout
: ['standard'
|'compact'
|'conda'
] 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
. If the Python executable found during compilation is managed byconda
, the layout will default toconda
irrespective of operating system. For theconda
layout, the Python package as well as all libraries and header files are installed into the activeconda
environment. Input data, samples, and other files are installed in theshared/cantera
subdirectory of the activeconda
environment.default:
'standard'
package_build
: ['yes'
|'no'
] Used in combination with packaging tools (example:conda-build
). If enabled, the installed package will be independent from host and build environments, with all external library and include paths removed. Packaged C++ and Fortran samples assume that users will compile with local SDKs, which should be backwards compatible with the tools used for the build process.default:
'no'
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'
msvc_version
: [string
] Version of Visual Studio to use. The default is the newest installed version. Note that since multiple MSVC toolsets can be installed for a single version of Visual Studio, you probably want to usemsvc_toolset_version
unless you specifically installed multiple versions of Visual Studio. Windows MSVC only.default:
''
msvc_toolset_version
: [string
] Version of the MSVC toolset to use. The default is the default version for the givenmsvc_version
. Note that the toolset selected here must be installed in the MSVC version selected bymsvc_version
. The default toolsets associated with various Visual Studio versions are:14.1
(14.1x
): Visual Studio 201714.2
(14.2x
): Visual Studio 201914.3
(14.3x
): Visual Studio 2022.
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 butg++
is on the path,mingw
is used as a backup. Windows only.default: platform dependent
Windows:
'msvc'