Installation Guide¶
Short Version¶
To build and install SeQuant, run the following commands in the source directory:
cmake -B build -S .
cmake --build build
cmake --build build --target install
Prerequisites¶
Mandatory¶
CMake 3.28 or later
Boost 1.81 or later (1.85 or later with MSVC)
Range-V3 0.12.0 or later
Eigen3 3.0 or later
Utfcpp 4.0 or later
DTL 1.12 or later - only used for unit tests
CLI11 2.0 or later - only used for external interface
spdlog - only used for external interface
nlohmann::json 3.0 or later - only used for external interface
Note
SeQuant can download and build Boost if configured with Boost_FETCH_IF_MISSING=ON, but the use of Boost provided by the system package manager is recommended. The following non-header-only Boost libraries are required, hence Boost must be configured/built:
Boost.RegexBoost.Locale
Optional¶
TiledArray - for building coupled-cluster evaluation tests
Note
If not found, SeQuant can download and build all dependencies other than CMake and the C++ compiler, provided git is available on the system.
Useful CMake Variables¶
CMake Variable |
Default |
Description |
|---|---|---|
Specifies the C++ compiler to use. |
||
This semicolon-separated list specifies search paths for dependencies (Boost, Range-V3, etc.). |
||
The installation path for SeQuant. |
||
SEQUANT_TESTS |
Enables test targets, e.g. |
|
SEQUANT_SKIP_LONG_TESTS |
OFF |
Skip long test cases within unit and integration tests. |
SEQUANT_BTAS |
OFF |
SeQuant will look for (or build) BTAS tensor library and enable its use as an evaluation backend. |
SEQUANT_TILEDARRAY |
OFF |
SeQuant will look for (or build) TiledArray tensor framework and enable its use as an evaluation backend. |
SEQUANT_TAPP |
OFF |
SeQuant will look for (or build) TAPP and enable its use as an evaluation backend. |
SEQUANT_BENCHMARKS |
ON |
Enable SeQuant benchmarks. |
SEQUANT_MIMALLOC |
OFF |
Use mimalloc for fast memory allocation. |
SEQUANT_BUILD_DOCS |
OFF |
Enables building of the documentation. See Documentation Guide for detailed information. |
SEQUANT_PYTHON |
OFF |
Enables building of Python bindings. Changes the default of |
SEQUANT_USE_SYSTEM_BOOST_HASH |
ON |
Use system Boost for hashing? Set to OFF to make hashing independent of Boost, thus value-portable |
SEQUANT_IWYU |
OFF |
Whether to use the include-what-you-use tool (if found) |
Boost_FETCH_IF_MISSING |
OFF |
If set to ON, SeQuant will download and build Boost if it is not found by |
ENABLE_TBB |
OFF |
Enable TBB as an optional prerequisite for C++’s parallel STL |
SEQUANT_CONTEXT_MANIPULATION_THREADSAFE |
ON |
If set to OFF the default context must be initialized and manipulated from single thread only (most users will want to do this). |
SEQUANT_ASSERT_BEHAVIOR |
|
Controls how assertions within SeQuant’s code are handled. Valid options are |
SEQUANT_LTO |
context-dependent — see Description |
Controls whether SeQuant will be built with link-time optimizations (LTO) in non-debug builds (CMAKE_BUILD_TYPE != Debug). Left unset, it defaults per target type: ON for static libraries if the compiler supports “fat” LTO objects, OFF otherwise; ON for other target types (shared libs, executables, etc.); OFF for all targets when SeQuant is consumed as a subproject. Set to ON or OFF explicitly to override the per-target-type default for all SeQuant targets; an explicit setting is honored regardless of whether SeQuant is the top-level project. |
Configuring and Building¶
To configure and build SeQuant, you can use various CMake variables to customize the build process. These variables can be set using the -D flag when running the cmake command. For example:
cmake -B build -S . -D<VARIABLE_NAME>=<VALUE>
Now you can build SeQuant by running the following command in the source directory:
cmake --build build
cmake --build build --target check-sequant # for testing
cmake --build build --target install
Windows¶
SeQuant needs more stack space than the 1 MB that Windows reserves per thread by default (Linux and macOS typically
provide 8 MB). SeQuant’s own executables are therefore linked with /STACK:8388608, and executables using
SeQuant must be linked with an equivalent stack reserve too, e.g. via
target_link_options(<target> PRIVATE /STACK:8388608). This reserve is the default for every thread of the
program; threads created with an explicit stack size that call into SeQuant need a comparable size.