This guide takes you from a fresh clone to your first compiled CARTS program in about 15 minutes (plus build time).
Install the following system tools before you begin:
| Tool | Version | Check |
|---|---|---|
| conda | any | conda --version |
| git | any | git --version |
| cmake | >= 3.20 | cmake --version |
| ninja | any | ninja --version |
| make | any | make --version |
| python | >= 3.11 | python --version |
Optional:
| Tool | Purpose |
|---|---|
| clang-format | Source formatting (dekk carts format) |
| lit | Test runner (dekk carts test) -- built automatically if missing |
git clone <repo-url>
cd cartsYou do not need --recurse-submodules -- the install step handles
submodules automatically with shallow clones to save bandwidth.
The canonical install path is dekk-first. dekk creates the project-local conda
environment, activates the .dekk.toml configuration, initializes submodules,
generates agent/MCP resources, and builds the toolchain. The Conda environment
also provisions the bootstrap clang and clang++ pair automatically; they
are not separate system prerequisites for the dekk-first flow.
python -m pip install --upgrade dekk
dekk carts install- Creates or syncs the project environment -- ensures
.dekk/envmatchesenvironment.yml, including the bootstrapclang/clang++toolchain used for the pinned LLVM/MLIR build - Initializes git submodules -- ARTS, Polygeist, LLVM, carts-benchmarks
- Generates agent resources -- root instructions, skills, MCP adapters,
hooks, and editor configs from
carts-plugin/ - Builds the full toolchain in order:
- LLVM + MLIR + OpenMP (longest step, ~30-60 min)
- Polygeist (C-to-MLIR frontend)
- ARTS runtime
- CARTS compiler
dekk carts install --wrap additionally generates a wrapper under the active
install root. Add that install root to your PATH yourself if you want to use
bare carts ... commands outside the dekk runner.
The active artifact root is resolved by dekk from CARTS_HOME, then the
untracked carts.config, then the checkout root. Build and install outputs use
one predictable layout by default:
<CARTS_HOME>/build/{carts,arts,polygeist,llvm-project}
<CARTS_HOME>/.install/{carts,arts,polygeist,llvm}
You can split build and install roots in the untracked local config when the install tree must be visible to other nodes:
[carts]
home = ".carts"
build = ".carts/build"
install = ".carts/install"The matching environment overrides are CARTS_BUILD_ROOT and
CARTS_INSTALL_ROOT. CARTS_BUILD_DIR and CARTS_INSTALL_DIR are Makefile
subproject paths, not artifact-root overrides.
After installation, the guaranteed interface is the dekk project runner:
dekk carts doctor # System and toolchain diagnostics
dekk carts test # Run the full test suiteIf you generated the optional wrapper with dekk carts install --wrap, you can
also run the wrapper from the active install root directly, or add that root to
PATH.
# Check what's missing
dekk carts doctor
# Rebuild a specific component
dekk carts build --llvm # Rebuild LLVM
dekk carts build --arts # Rebuild ARTS runtime with RDMA/RoCE enabled
dekk carts build --arts --no-rdma # Rebuild ARTS runtime for TCP fallback
dekk carts build --polygeist # Rebuild Polygeist
dekk carts build # Rebuild CARTS compiler only
dekk carts build --clean # Clean rebuild of CARTSdekk carts build --arts defaults to the production RDMA/RoCE RSockets
transport for multinode runs. Use --no-rdma only for non-RDMA developer
machines or deliberate TCP fallback experiments. Benchmark runs use TCP for
single-node configs and apply --rdma/--no-rdma only to multinode configs.
If you are updating an older checkout that previously built against LLVM 18,
clean the LLVM and Polygeist build trees before rebuilding. The current
Polygeist submodule is llvmorg-23-init-8425-g23d8651de3f8, and stale
pre-LLVM-23 artifacts can produce mismatched TableGen/CMake failures.
CARTS compiles OpenMP-annotated C/C++ into ARTS task-based executables:
dekk carts compile samples/dotproduct/dotproduct.c -O3 -o dotproduct
./dotproductThe compile command automatically routes through the full pipeline:
C source -> Polygeist (cgeist) -> MLIR passes -> LLVM IR -> executable.
dekk carts compile file.c -O3 -o output # Optimized build
dekk carts compile file.c -g -o output # Debug build
dekk carts compile file.c --emit-llvm # Stop at LLVM IR
dekk carts compile file.c --diagnose # Emit compiler diagnostics
dekk carts compile file.c --pipeline=stage # Run up to a specific pipeline stageRun dekk carts compile --help for the full list.
CARTS ships with 17 example programs covering common parallel patterns:
| Example | Pattern |
|---|---|
dotproduct/ |
Parallel reduction |
matrixmul/ |
Block task dependencies |
stencil/ |
Neighbor (point) dependencies |
jacobi/ |
Iterative stencil with convergence |
cholesky/ |
Complex multi-block factorization |
parallel_for/ |
Parallel loop variants |
smith-waterman/ |
Dynamic programming wavefront |
convolution/ |
Sliding window computation |
Run all examples:
dekk carts examples run --allList available examples:
dekk carts examples listAll examples live in samples/ and serve as reference patterns for
writing your own CARTS programs.
carts/
include/carts/ C++ headers (dialect, passes, utilities)
lib/carts/ Core MLIR dialect, analysis, and passes
tools/ Dekk-backed command wrappers and scripts
tools/compile/ C++ compilation driver (carts-compile)
lib/carts/dialect/*/test/ MLIR regression tests (FileCheck)
tests/e2e/ End-to-end C/C++ compile-and-run tests
samples/ Example C/C++ programs
external/ Vendored deps (ARTS, Polygeist, LLVM)
docs/ Architecture and pipeline documentation
docker/ Multi-node Docker cluster setup
.dekk.toml Environment and dependency configuration
For multi-node benchmarking with SLURM:
dekk carts docker build # Build the Docker image
dekk carts docker start # Start a 6-node simulated cluster
dekk carts docker exec # Open a shell in the cluster
dekk carts docker stop # Tear downSee docker/README.md for details.
Run dekk carts --help for the full command list. Key commands:
| Command | Description |
|---|---|
dekk carts install |
Full project setup: environment, submodules, and build |
dekk carts install --wrap |
Also generate a wrapper under the active install root |
dekk carts doctor |
System and toolchain diagnostics |
dekk carts build |
Build components (--arts, --llvm, --polygeist) |
dekk carts compile |
Compile C/C++/MLIR through the pipeline |
dekk carts test |
Run the test suite |
dekk carts examples |
List and run example programs |
dekk carts benchmarks |
Performance benchmarking tools |
dekk carts pipeline |
Inspect compiler pipeline stages |
dekk carts clean |
Clean generated files |
dekk carts update |
Update git submodules |
dekk carts docker |
Multi-node Docker operations |
dekk carts format |
Format source files |
dekk carts skills |
Generate and inspect agent skill resources |
dekk carts worktree |
Create and manage project worktrees |
- Developer Guide -- Supported OpenMP constructs and memory layout requirements
- Compiler Pipeline -- 16-stage compilation pipeline, pass ordering, and stage ownership
- Contributing -- Coding style, testing, and commit guidelines