CMake options#

When configuring Einsums, you can set a variety of options to allow CMake to generate your specific makefiles/project files. This section includes the comprehensive list of CMake options.

Variables that influence how Einsums is built#

The options are split into these categories:

Generic options#

EINSUMS_FFT_LIBRARY:STRING#

FFT library

EINSUMS_WITH_CXX_STANDARD:STRING#

C++ standard to use for compiling einsums (default: 20)

Build Targets options#

BUILD_SHARED_LIBS:BOOL#

Build using shared libraries (default: ON)

EINSUMS_INSTALL_PYMODDIR:STRING#

Location within CMAKE_INSTALL_PREFIX to which the Python module is installed. ‘naive’ places in CMAKE_INSTALL_LIBDIR. ‘prefix’ queries the Python interpreter (still w/i PREFIX). Anything else is used directly (untested) (default: naive).

EINSUMS_PYBIND_NUM_TU:STRING#

Split every module’s generated pybind TU across this many translation units, overriding the per-module PYBIND_NUM_TU. 0 (default) leaves each module’s own choice alone; 1 forces a single TU. Raise it on a build whose memory allowance is tighter than a developer machine’s - the generated ComputeGraph bindings peak near 7.5 GB as one TU and around 4.7 GB split eight ways.

EINSUMS_SIMD_NATIVE_ARCH:BOOL#

Compile SIMD-using TUs with -mcpu=native / -march=native. Unlocks every SIMD feature the host CPU supports at the cost of binary portability.

EINSUMS_SIMD_TARGET_CPU:STRING#

Pin SIMD-using TUs to a specific CPU model, such as ‘apple-m4’, ‘znver4’ or ‘sapphirerapids’. Empty (default) defers to EINSUMS_SIMD_NATIVE_ARCH or the toolchain baseline.

EINSUMS_WITH_BINARY_DIR:PATH#

Root directory for libraries and executables for the build. This does not affect the installed location of libraries and executables.

EINSUMS_WITH_CCACHE:BOOL#

Route C and C++ compiles through ccache when it is installed (default: ON)

EINSUMS_WITH_CUDA:BOOL#

Enable support for CUDA (default: OFF)

EINSUMS_WITH_DOCS_IN_ALL:BOOL#

Build the documentation as part of the default target rather than only on request (default OFF).

EINSUMS_WITH_DOCUMENTATION:BOOL#

Build the Einsums documentation (default OFF).

EINSUMS_WITH_EXAMPLES:BOOL#

Build examples (default: ON)

EINSUMS_WITH_EXPERIMENTAL:BOOL#

If true, build experimental Einsums modules (default: OFF)

EINSUMS_WITH_FULL_RPATH:BOOL#

Build and link libraries and executables with full RPATHs (default: ON)

EINSUMS_WITH_GPU_MOCK_DISCRETE:BOOL#

Make the mock GPU backend imitate a discrete device (no unified memory, poisoned device pointers). Testing aid; requires no GPU.

EINSUMS_WITH_HIDDEN_VISIBILITY:BOOL#

Use -fvisibility=hidden for builds on platforms which support it (default: ON)

EINSUMS_WITH_MPI:BOOL#

Enable MPI distributed computing (default: OFF) WIP

EINSUMS_WITH_MPS:BOOL#

Enable Metal Performance Shaders GPU backend

EINSUMS_WITH_SIMD_DISPATCH:BOOL#

Compile SIMD kernel TUs once per instruction-set rung (x86-64 baseline/v2/v3/v4, aarch64 sme) and pick the best at runtime. One portable binary, full speed on newer CPUs. OFF compiles a single TU at the toolchain baseline. Automatically treated as OFF when EINSUMS_SIMD_NATIVE_ARCH or EINSUMS_SIMD_TARGET_CPU pins the build.

EINSUMS_WITH_TESTS:BOOL#

Build tests (default: ON)

EINSUMS_WITH_TESTS_BENCHMARKS:BOOL#

Build benchmark tests (default: ON)

EINSUMS_WITH_TESTS_DLPNO_TRIPLES:BOOL#

Run the DLPNO (T0) and iterative (T) example suites, which hang or return a wrong energy nondeterministically on some platforms (default: OFF)

EINSUMS_WITH_TESTS_EXAMPLES:BOOL#

Add examples as tests (default: ON)

EINSUMS_WITH_TESTS_HEADERS:BOOL#

Build header tests (default: ON)

EINSUMS_WITH_TESTS_UNIT:BOOL#

Build unit tests (default: ON)

Profiling options#

EINSUMS_WITH_PROFILER:BOOL#

Enable Einsums profiling. (Default: ON)

EINSUMS_WITH_PROFILER_INTERNAL:BOOL#

Enable profiling internal Einsums code. (Default: OFF)

Debugging options#

EINSUMS_WITH_BACKTRACES:BOOL#

Attach backtraces to einsums exceptions (default: ON)

EINSUMS_WITH_COMPILER_WARNINGS:BOOL#

Enable compiler warnings (default: OFF)

EINSUMS_WITH_COMPILER_WARNINGS_AS_ERROR:BOOL#

Turn compiler warnings into error (default: OFF)

EINSUMS_WITH_COVERAGE:BOOL#

Enable code coverage generation

EINSUMS_WITH_DEPRECATION_WARNINGS:BOOL#

Enable warnings for deprecated facilities. (default: ON)

EINSUMS_WITH_SANITIZERS:STRING#

Configure with sanitizer instrumentation support.

EINSUMS_WITH_TESTS_VALGRIND:BOOL#

Run selected tests with valgrind.

EINSUMS_WITH_TESTS_VALGRIND_OPTIONS:STRING#

Use these options when running tests under valgrind.

EINSUMS_WITH_THREAD_BACKTRACE_DEPTH:STRING#

Thread stack back trace depth being captured (default: 20)