lindblad targets modern C++23 toolchains.
- Windows: MSVC (Visual Studio 2022/26 recommended)
- Linux: GCC or Clang
- CMake: 3.20+
OpenMP support is expected and linked in lindblad_core.
From repository root:
cmake -S . -B build -DCMAKE_BUILD_TYPE=ReleaseImportant CMake options:
LINDBLAD_BUILD_BENCHMARKS(defaultON)LINDBLAD_BUILD_PYTHON(defaultOFF)
Example with options:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLINDBLAD_BUILD_BENCHMARKS=ON -DLINDBLAD_BUILD_PYTHON=OFFcmake --build build -jcmake --build build --config Release -jcmake --build build -j$(nproc)Run all discovered tests:
ctest --test-dir build --output-on-failureFor multi-config builds, specify configuration:
ctest --test-dir build -C Release --output-on-failureIf LINDBLAD_BUILD_BENCHMARKS=ON, benchmark executables are generated from:
benchmarks/bench_gates.cppbenchmarks/bench_statevector.cppbenchmarks/bench_maqaoa.cpp
Run from the build output directory, for example:
.\bench_gates
.\bench_statevector
.\bench_maqaoaEnable bindings:
cmake -S . -B build -DLINDBLAD_BUILD_PYTHON=ON
cmake --build build -jThis builds a lindblad Python extension module via pybind11.
- Ensure outbound network access for CMake FetchContent Git repositories.
- Remove stale build directory and reconfigure:
Remove-Item -Recurse -Force build
cmake -S . -B build- Confirm compiler OpenMP support is installed/enabled.
- On MSVC, use a Visual Studio toolchain with OpenMP components.
- Verify
enable_testing()andgtest_discover_tests()completed during configure. - Re-run CMake configure before running CTest.