Skip to main content

Installation and configuration

Using pre-built binaries

The easiest way to access zkLLVM is to install pre-built binaries of its key components.


All pre-built binaries discussed below are only supported on x86-64 systems.

Install zkLLVM binaries

zkLLVM is distributed as a Deb package which can be installed using the following commands.

echo 'deb [trusted=yes] all main' >>/etc/apt/sources.list
apt update
apt install -y zkllvm

This will install binaries for nearly all major components of zkLLVM such as assigner and the clang frontend. Note that the Rust frontend needs to be installed separately.

To verify the installation, run:

clang-zkllvm --version

Note that the newly installed clang frontend is accessed via clang-zkllvm, not clang.

Install Rust binaries

First, install rustup.

curl --proto '=https' --tlsv1.2 -sSf | sh

Then, install rslang by executing the following command.

curl --proto '=https' --tlsv1.2 -sSf | python - --channel nightly

Alternatively, download and run it.

curl --proto '=https' --tlsv1.2 -O
python --channel nightly
Standalone installation

To install rslang without rustup, run the below command.

curl --proto '=https' --tlsv1.2 -O
python --no-rustup --prefix PATH

If the python command fails, specify Python 3.x explicitly by replacing python with python3.

Verify that the installation has been successful.

rustc +zkllvm -V
Command output

The output to the above command should follow the below format.

rustc x.y.z (abcabcabc yyyy-mm-dd) (zkLLVM x.y.z)

If zkLLVM x.y.z is missing from the output, the zkllvm toolchain needs to be reinstalled.

Building from sources

To build zkLLVM from its source repository, follow the below steps.

Install dependencies

Install the following dependencies.

Every dependency apart from Rust can be installed by executing the following command.

sudo apt install build-essential libssl-dev cmake clang-12 git curl pkg-config zlib

To install Rust, execute the following command.

curl --proto '=https' --tlsv1.2 -sSf | sh

The Ninja build system can make building zkLLVM from sources faster and more convenient. While it is not a direct dependency, using Ninja is preferable to simply using Unix makefiles. Install Ninja by running the below command.

sudo apt-get install ninja-build
Installing Boost

Installing Boost from sources is the most consistent way to ensure that the latest version of Boost is installed that matches the above version constraint.

To install Boost from sources, do the following.

  1. Navigate to the folder where you want to install Boost and download Boost.
  1. Extract the archive with Boost.
cd boost_1_84_0
  1. Prepare the build system for Boost by running
  1. Install Boost system-wide.
sudo ./b2 install

Clone the repository

Clone the repository and all of its sub-modules.

git clone --recurse-submodules
cd zkllvm

As the zkLLVM repository contains many large sub-modules, it is recommended to add the following lines to the global Git configuration file before attempting to clone it.

packedGitLimit = 512m
packedGitWindowSize = 512m
deltaCacheSize = 2047m
packSizeLimit = 2047m
windowMemory = 2047m

Configure cmake

This step is needed to define initial build targets and specify that zkLLVM should produce IRs of circuits in the .ll format compatible with Proof Market.


Build clang and assigner

The next step is to build the C++ compiler and the assigner tool.

make -C ${ZKLLVM_BUILD:-build} assigner clang -j$(nproc)

Build the Rust compiler

The first step to building the Rust compiler is adding Rust tools to cmake.


Afterward, export the path containing LLVM libraries.

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/build/libs/circifier/llvm/lib"

Use the below command to build rustc and cargo.

make -C ${ZKLLVM_BUILD:-build} rslang -j$(nproc)

After the build completes, export the RSLANG environment variable.

export RSLANG="$(pwd)/build/libs/rslang/build/host"

Verify the versions of rustc and cargo by running the following commands.

RUSTC=$RSLANG/stage1/bin/rustc $RSLANG/stage1-tools-bin/cargo --version
Finding rustc and cargo

If the terminal cannot find rustc and cargo, run find ~/zkllvm -name rustc and find ~/zkllvm -name cargo.

Advanced compiling with Rust

To use the original bootstrap system supplied by Rust (, build zkllvm first.

make -C ${ZKLLVM_BUILD:-build} -j$(nproc)