This directory contains installation scripts for the Ligero prover, which enables true zero-knowledge proofs for the zigkvm-sdk.
Disclaimer: I've only used this script on my macbook M1 pro, have not tried the linux. Feel free to open issues if it's broken
curl -fsSL https://raw.githubusercontent.com/MatteoMer/zigkvm-sdk/main/scripts/ligero/install-ligero.sh | bashAfter installation, restart your terminal or run:
source ~/.zshrc # or ~/.bashrc for bash users| Platform | Architecture | Status |
|---|---|---|
| macOS | Intel (x86_64) | ✅ Supported |
| macOS | Apple Silicon (arm64) | ✅ Supported |
| Linux | x86_64 | ✅ Supported |
| Linux | arm64 | ✅ Supported |
Requirements:
- macOS: Homebrew must be installed
- Linux: Ubuntu 22.04+ or Debian-based distribution with
apt-get
Install the default version (v1.2.0):
bash scripts/ligero/install-ligero.shInstall a specific version:
bash scripts/ligero/install-ligero.sh --version v1.1.0Or use an environment variable:
LIGERO_VERSION=v1.1.0 bash scripts/ligero/install-ligero.shInstall to a custom location:
bash scripts/ligero/install-ligero.sh --home /opt/ligeroOr use an environment variable:
LIGERO_HOME=/opt/ligero bash scripts/ligero/install-ligero.shForce reinstallation even if already installed:
bash scripts/ligero/install-ligero.sh --forceInstall without modifying shell configuration:
bash scripts/ligero/install-ligero.sh --no-path-setupThen manually add to your shell config:
export PATH="$HOME/.ligero/bin:$PATH"See what would be done without making changes:
bash scripts/ligero/install-ligero.sh --dry-runThe installer builds Ligero and its dependencies from source. This takes ~30 minutes on modern hardware.
Build Steps:
- Platform Detection - Detects your OS and architecture
- Prerequisite Check - Verifies curl, git, and cmake are available
- System Dependencies - Installs required packages via Homebrew (macOS) or apt (Linux)
- Build Dawn (WebGPU) - 10-20 minutes
- Required for GPU acceleration
- Builds Google's Dawn WebGPU implementation
- Installs system-wide to
/usr/local/
- Build wabt - 2-5 minutes
- WebAssembly Binary Toolkit
- Required dependency for Ligero
- Installs system-wide to
/usr/local/
- Build Ligero Prover - 5-10 minutes
- Clones ligero-prover repository
- Builds native prover/verifier (no web support)
- Installs binaries to
~/.ligero/bin
- Shell Integration - Adds
~/.ligero/binto your PATH - Verification - Tests that binaries are executable
System Requirements:
- CPU: Multi-core processor (build uses all cores)
- RAM: 8GB+ recommended (Dawn build is memory-intensive)
- Disk: 5GB free space
- Time: ~30 minutes on modern hardware
~/.ligero/
├── bin/ # Ligero binaries
│ ├── webgpu_prover
│ └── webgpu_verifier
├── src/ # Source code
│ ├── dawn/ # Dawn (WebGPU) source
│ ├── wabt/ # wabt source
│ └── ligero-prover/ # Ligero source
├── tmp/ # Temporary downloads
├── VERSION # Installed version
└── install.log # Installation log
/usr/local/ # System-wide installations (Linux)
├── lib/libdawn* # Dawn libraries
├── include/dawn/ # Dawn headers
├── bin/wasm* # wabt tools
└── include/wabt/ # wabt headers
The installer automatically installs these via Homebrew:
- cmake
- gmp
- mpfr
- libomp
- llvm
- boost
- ninja
Manual installation:
brew install cmake gmp mpfr libomp llvm boost ninjaThe installer automatically installs these via apt:
Core packages:
- build-essential
- git
- cmake
- ninja-build
Libraries:
- libgmp-dev
- libtbb-dev
- libssl-dev
- libboost-all-dev
GPU/Graphics (required for Dawn/WebGPU):
- libvulkan1, vulkan-tools, libvulkan-dev
- libx11-dev, libxrandr-dev, libxinerama-dev, libxcursor-dev, libxi-dev, libx11-xcb-dev
- mesa-common-dev, libgl1-mesa-dev
Compiler:
- g++-13 (automatically configured as default g++)
Manual installation:
sudo apt-get update
sudo apt-get install build-essential git cmake ninja-build \
libgmp-dev libtbb-dev libssl-dev libboost-all-dev \
libvulkan1 vulkan-tools libvulkan-dev \
libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libx11-xcb-dev \
mesa-common-dev libgl1-mesa-dev
# Install g++-13
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-13
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 20
sudo update-alternatives --set g++ "/usr/bin/g++-13"Check the installation log for detailed error messages:
cat ~/.ligero/install.logInstall Homebrew first:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"On Linux, you may need sudo for package installation. The installer will use sudo automatically if available.
If the build fails:
- Check that all dependencies are installed
- Review the installation log:
cat ~/.ligero/install.log - Ensure you have enough RAM (8GB+) and disk space (5GB+)
- Dawn build is the most demanding - if it fails, you may need to close other applications
- Try building manually (see Manual Installation below)
- Report the issue with the log contents
Common build failures:
- Dawn build timeout: Close other applications, Dawn needs significant memory
- Linker errors: Ensure you have g++-13 on Linux
- CMake version errors: Upgrade CMake to 3.x+ (installer does this automatically)
If the specified version doesn't exist:
# List available versions
git ls-remote --tags https://github.com/ligeroinc/ligero-proverIf the PATH wasn't updated automatically, add manually:
For bash (~/.bashrc):
echo 'export PATH="$HOME/.ligero/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcFor zsh (~/.zshrc):
echo 'export PATH="$HOME/.ligero/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcFor fish (~/.config/fish/config.fish):
echo 'set -gx PATH "$HOME/.ligero/bin" $PATH' >> ~/.config/fish/config.fish
source ~/.config/fish/config.fishIf the installer doesn't work for your system, follow these steps:
macOS:
brew install cmake gmp mpfr libomp llvm boost ninjaLinux:
sudo apt-get update
sudo apt-get install build-essential git cmake ninja-build \
libgmp-dev libtbb-dev libssl-dev libboost-all-dev \
libvulkan1 vulkan-tools libvulkan-dev \
libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libx11-xcb-dev \
mesa-common-dev libgl1-mesa-dev
# Install and configure g++-13
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-13
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 20
sudo update-alternatives --set g++ "/usr/bin/g++-13"git clone https://dawn.googlesource.com/dawn
cd dawn
git checkout cec4482eccee45696a7c0019e750c77f101ced04
mkdir release && cd release
cmake -DDAWN_FETCH_DEPENDENCIES=ON \
-DDAWN_BUILD_MONOLITHIC_LIBRARY=STATIC \
-DDAWN_ENABLE_INSTALL=ON \
-DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
sudo make install # Linux only; omit sudo on macOS
cd ../..git clone https://github.com/WebAssembly/wabt.git
cd wabt
git submodule update --init
mkdir build && cd build
# macOS:
cmake -DCMAKE_CXX_COMPILER=clang++ ..
# Linux:
cmake -DCMAKE_CXX_COMPILER=g++-13 ..
make -j$(nproc)
sudo make install # Linux only; omit sudo on macOS
cd ../..git clone --depth 1 --branch v1.2.0 https://github.com/ligeroinc/ligero-prover
cd ligero-prover
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)mkdir -p ~/.ligero/bin
cp webgpu_prover webgpu_verifier ~/.ligero/bin/
chmod +x ~/.ligero/bin/webgpu_prover ~/.ligero/bin/webgpu_verifierAdd to your shell configuration (~/.bashrc, ~/.zshrc, etc.):
export PATH="$HOME/.ligero/bin:$PATH"bash scripts/ligero/install-ligero.sh --uninstall# Remove Ligero installation
rm -rf ~/.ligero
# Remove PATH configuration from shell config
# Edit ~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish
# Remove the lines containing "ligero"
# Remove system-wide dependencies (Linux only, optional)
sudo rm -rf /usr/local/lib/libdawn* /usr/local/include/dawn
sudo rm -rf /usr/local/bin/wasm* /usr/local/include/wabt| Variable | Description | Default |
|---|---|---|
LIGERO_VERSION |
Version to install | v1.2.0 |
LIGERO_HOME |
Installation directory | ~/.ligero |
Example:
LIGERO_VERSION=v1.1.0 LIGERO_HOME=/opt/ligero bash scripts/ligero/install-ligero.shAfter installing Ligero, you can use it with zigkvm-sdk:
# Build your zkVM program
zig build -Dbackend=ligero
# Generate proof
zig build -Dbackend=ligero prove
# Verify proof
zig build -Dbackend=ligero verify- Ligero Issues: https://github.com/ligeroinc/ligero-prover/issues
- zigkvm-sdk Issues: https://github.com/MatteoMer/zigkvm-sdk/issues