This guide describes two ways to install DDC:
- Quick start build → fastest way to compile the core features.
- Spack installation → recommended for reproducible builds and HPC environments.
This method compiles DDC with all optional components disabled.
git clone --recurse-submodules --jobs 4 https://github.com/CExA-project/ddc.git
cmake -D DDC_BUILD_KERNELS_FFT=OFF \
-D DDC_BUILD_KERNELS_SPLINES=OFF \
-D DDC_BUILD_PDI_WRAPPER=OFF \
-B ddc/build \
-S ddc
cmake --build ddc/build --parallel 4
ctest --test-dir ddc/build
cmake --install ddc/build --prefix $HOME/.local/ddc\note Replace $HOME/.local/ddc with your preferred installation path.
To use DDC in your CMake project, point CMake to the installation prefix:
cmake -D DDC_ROOT=$HOME/.local/ddc <your_project>Then in your CMakeLists.txt:
find_package(DDC REQUIRED)
target_link_libraries(myapp PRIVATE DDC::core)This method leverages the Spack package manager for reproducible builds and dependency management. It is recommended on HPC systems or if you want an isolated environment.
Download and extract Spack:
wget https://github.com/spack/spack/releases/download/v1.1.0/spack-1.1.0.tar.gz
tar -xvf spack-1.1.0.tar.gz
rm spack-1.1.0.tar.gz\note If you already have a Spack installation, the DDC package is available starting from builtin packages v2025.11.0.
Spack must be activated before use:
. spack-1.1.0/share/spack/setup-env.sh\note Add this line to your ~/.bashrc or ~/.zshrc to avoid reactivating in each new shell.
To avoid polluting other Spack setups, create a dedicated environment:
spack env create ddc-envAdd and install DDC with default variants:
spack --env ddc-env add ddc
spack --env ddc-env install --jobs 1\note Installation can take a while since Spack builds dependencies from source. Use the --jobs option to run builds in parallel, but avoid setting it too high to prevent running out of memory.
Activate the environment:
spack env activate ddc-envNow any CMake project can find DDC automatically:
find_package(DDC REQUIRED)
target_link_libraries(myapp PRIVATE DDC::core)To discover available build variants:
spack info ddcIf you encounter issues with the Spack recipe, please open an issue on the spack-packages repository.
✅ You now have DDC installed and ready to use!