A tool to compile Noir to LLZK via ACIR.
The recommended way to build this project is with the nix flake, which includes pinned versions of the dependencies and builds them automatically.
- Nix (currently tested with versions 2.24 and 2.31)
Install Nix with the official installer:
curl -L https://nixos.org/nix/install | shAfter installation, restart your shell or source the Nix profile script so
nix is on your PATH.
Build the default package:
nix build -LOpen a development shell with the pinned toolchain:
nix developFrom inside nix develop, run the usual Cargo commands:
cargo build
cargo testYou can also run a one-off command without entering an interactive shell:
nix develop -c cargo build
nix develop -c cargo testDependencies can be updated with, e.g.:
nix flake update llzk-rs-pkgsIf you are not using Nix, you can still build manually with the dependencies below.
- Rust (edition 2024)
- LLVM 23.1.3 with MLIR and Clang support
- zstd (LLVM 23's MLIR libraries depend on libzstd for bitcode compression)
brew install llvm@23 zstdSet the MLIR prefix path (used by the cmake commands below and by Cargo during build):
export MLIR_SYS_230_PREFIX=$(brew --prefix llvm@23)The LLZK library must be built and installed separately.
The Rust bindings (llzk-rs) expect the LLZK_SYS_30_PREFIX
environment variable to point to the LLZK installation prefix.
Clone at the LLZK commit pinned in flake.lock, paired with the llzk-rs / llzk-sys
revision in Cargo.lock.
git clone https://github.com/project-llzk/llzk-lib.git
cd llzk-lib && git checkout 1d2b49b221db0fca4e0bbea9840badde88f8e7b2 && cd ..Build and install with CMake:
cd llzk-lib
cmake -B build -S . \
-DCMAKE_INSTALL_PREFIX=$(pwd)/build/install \
-DCMAKE_PREFIX_PATH="$MLIR_SYS_230_PREFIX" \
-DLLZK_WITH_PCL=ON
cmake --build build
cmake --install build
cd ..Then set the LLZK_SYS_30_PREFIX environment variable to point to the install location:
export LLZK_SYS_30_PREFIX=$(pwd)/llzk-lib/build/installThe following environment variables must be set before building:
| Variable | Description |
|---|---|
MLIR_SYS_230_PREFIX |
LLVM 23 installation prefix |
TABLEGEN_230_PREFIX |
LLVM 23 installation prefix (same as above) |
LIBCLANG_PATH |
Path to libclang shared library |
LLZK_SYS_30_PREFIX |
Path to the LLZK installation prefix (see above) |
If MLIR's and LLVM's installation is not on standard paths set them here.
For example, for a homebrew version of LLVM on macOS use this path.
export RUSTFLAGS='-L /opt/homebrew/lib/'
This variable may need to be configured on macOS as well. If building fails try setting it.
export LIBCLANG_PATH=$MLIR_SYS_230_PREFIX/lib
cargo buildThe test suite is split by what each layer is meant to validate:
library/src/tests/blackboxes/contains lowering and shape tests for ACIR blackbox opcodes. These check things like witness collection, input validation, helper emission, helper sharing, compute/constrain wiring, and LLZK module verification. They do not execute the generated LLZK.library/src/tests/integration_tests.rscompiles real Noir fixture programs withnargo, translates the resulting ACIR to LLZK, and verifies the module. These tests exercise the full compile/translate pipeline, but still do not execute the generated LLZK.library/src/tests/e2e/blackboxes/contains semantic blackbox tests. These translate ACIR to LLZK and execute the result withllzk_interpreter.library/src/blackboxes/contains the module-level LLZK helper implementations used by both ACIR and Brillig lowering. Tests there build small helper modules and execute them directly withllzk_interpreter.
Use the regular test target for unit, lowering/shape, and Noir fixture integration coverage:
nix develop -c make testIf you are already inside nix develop, or are using a manual setup, run:
make testUse the e2e target when you need to check emitted LLZK behavior:
nix develop -c make e2eIf you are already inside nix develop, or are using a manual setup, run:
make e2e