Skip to content

Installing from Source

Before building Zap, install:

  • clang 21.1.8
  • llvm 21.1.8
  • doxygen
  • cmake 20+

Clone the repository, enter the project directory, make the build script executable, and run it:

Terminal window
git clone https://github.com/thezaplang/zap.git
cd zap
chmod +x build.sh
./build.sh

After a successful build, the compiler will be available at:

Terminal window
build/zapc

You can verify it with:

Terminal window
./build/zapc --version
./build/zapc --help

Add this line to ~/.zshrc:

Terminal window
export PATH="$PATH:/absolute/path/to/zap/build"

Then reload your shell:

Terminal window
source ~/.zshrc

Add this line to ~/.bashrc:

Terminal window
export PATH="$PATH:/absolute/path/to/zap/build"

Then reload your shell:

Terminal window
source ~/.bashrc

Add the path with:

Terminal window
fish_add_path /absolute/path/to/zap/build

Or make it universal:

Terminal window
set -Ux fish_user_paths /absolute/path/to/zap/build $fish_user_paths

If the repository is in ~/dev/zap, then the compiler path is:

Terminal window
~/dev/zap/build/zapc

and the directory you add to PATH is:

Terminal window
~/dev/zap/build