2. Installation and Build Workflows
Build prerequisites
Minimum baseline:
CMake 3.20+
C++20 compiler
Optional dependencies by feature:
MPI implementation for multi-rank execution
CUDA/HIP/NCCL for GPU-accelerated paths
Python and pybind11 for Python bindings
Fortran compiler for Fortran module
Standard CMake configuration
From repo root:
cmake -S . -B build \
-DDTL_ENABLE_MPI=OFF \
-DDTL_BUILD_TESTS=ON
cmake --build build -j6
Common build profiles
Core C++ usage
cmake -S . -B build-core \
-DDTL_ENABLE_MPI=OFF \
-DDTL_BUILD_TESTS=ON
cmake --build build-core -j6
MPI-enabled profile
cmake -S . -B build-mpi \
-DDTL_ENABLE_MPI=ON \
-DDTL_BUILD_TESTS=ON
cmake --build build-mpi -j6
Full binding profile (C + Python + Fortran)
cmake -S . -B build-bindings \
-DDTL_ENABLE_MPI=OFF \
-DDTL_BUILD_C_BINDINGS=ON \
-DDTL_BUILD_PYTHON=ON \
-DDTL_BUILD_FORTRAN=ON \
-DDTL_BUILD_TESTS=ON
cmake --build build-bindings -j6
Feature flags to know
DTL_ENABLE_MPIDTL_ENABLE_CUDADTL_ENABLE_HIPDTL_ENABLE_NCCLDTL_BUILD_C_BINDINGSDTL_BUILD_PYTHONDTL_BUILD_FORTRANDTL_BUILD_DOCS
Installation and packaging notes
use CMake install/export if packaging into other projects
use
spack repo add ./spackto expose the bundled Spack packagealign runtime/backend flags with deployment environment
avoid enabling optional backends you cannot provision at runtime
Verification checklist
configure succeeds with expected backend summary
build succeeds with
-j6run at least smoke tests before adopting the build output
Next step
Proceed to Chapter 3 for runtime initialization and backend handling.