Skip to main content

Custom Installation

Build docc from source if you want the latest main branch, a debug build, or to work on the compiler itself. At the end of this page, you compile the WAXPBY example with your own build.

Requirements​

  • Linux (Ubuntu 24.04 is used in CI)
  • CMake ≥ 3.16 and Ninja
  • LLVM/Clang 21.1, including the development packages
  • System libraries: GMP, zstd, ISL, nlohmann-json, Boost Graph (other Boost components are fetched automatically), curl, blas

On Ubuntu:

wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 21
sudo apt-get install -y cmake ninja-build git \
llvm-21-dev libclang-21-dev libomp-21-dev \
libgmp-dev libzstd-dev libisl-dev nlohmann-json3-dev libboost-graph-dev libcurl4-openssl-dev libblas-dev
tip

Skip the setup with the Docker images: daisytuner/docc-build-env-llvm21-ubuntu-24.04 contains all build dependencies, and the run-env images add CUDA, ROCm, and TT-Metalium.

Build​

git clone https://github.com/daisytuner/docc.git
cd docc
git submodule update --init --recursive

cmake -G Ninja -B build \
-DCMAKE_C_COMPILER=clang-21 \
-DCMAKE_CXX_COMPILER=clang++-21 \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_FRONTEND=ON \
-DLLVM_BUILD_TESTS=OFF \
-DSDFG_BUILD_TESTS=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_BENCHMARKS=OFF \
-DBUILD_BENCHMARKS_GOOGLE=OFF
ninja -C build

Use your build​

The driver in the build tree finds its plugin and runtime libraries automatically. Compile the running example with it:

./build/llvm/driver/docc -O3 -docc-tune=openmp waxpby.c -o waxpby

To install your build system-wide, create a package and install it:

cd build
cpack -G DEB
sudo apt-get install ./docc-llvm*.deb

CMake options​

OptionDefaultDescription
LLVM_BUILD_FRONTENDOFFBuild the C/C++ frontend (docc, docc-cpp, docc-ld)
PYTHON_BUILD_FRONTENDOFFBuild the Python frontend, see Python Custom Installation
DOCC_BUILD_TARGET_TENSTORRENTONBuild the Tenstorrent target
LLVM_BUILD_TESTSONBuild the tests of the C/C++ frontend
SDFG_BUILD_TESTSONBuild the tests of the core libraries
SDFG_ENABLE_SANITIZEROFFBuild with sanitizers
SDFG_SANITIZERaddressSanitizers to use: address, memory, undefined, leak, thread
SDFG_ENABLE_COVERAGEOFFBuild with coverage instrumentation
SDFG_BUILD_DOCSOFFBuild the Doxygen documentation
RELEASE_PACKAGEOFFUse the plain version number instead of appending the Git hash
PACKAGE_WITH_TOOL_DEPSOFFDetect runtime dependencies and add them to the package metadata (used for releases)

Debug builds​

For development, build with debug information, tests, and a sanitizer:

cmake -G Ninja -B build-debug \
-DCMAKE_C_COMPILER=clang-21 \
-DCMAKE_CXX_COMPILER=clang++-21 \
-DCMAKE_BUILD_TYPE=Debug \
-DLLVM_BUILD_FRONTEND=ON \
-DSDFG_ENABLE_SANITIZER=ON \
-DSDFG_SANITIZER=address
ninja -C build-debug

Debug Options explains how to run the tests and inspect what docc does with your code.