DEVELOPMENT EDITION · 769442725406
Toolchain Manual
On this page

Building and installing Verada

Verada runs on macOS on Apple silicon (arm64). You build the compiler from source and install it with the supplied installer, or make the binary package that the beta quick start installs from. veradic also builds from source on Linux (checked on arm64 Ubuntu 24.04, below); the installer and the binary package are macOS's. The steps below make every setting explicit, so they do not depend on the maintainer's own compiler path.

Prerequisites and separate roles

Tool Needed for
Stack and GHC 9.12.4 Building veradic from this pinned snapshot
LLVM 21, including llvm-config and shared libraries Building the LLVM binding and loading/running the compiler
C/C++ compiler and macOS command-line developer tools Binding/runtime construction, native links; otool/install_name_tool/codesign for the installer
Z3 Proof; z3 beside veradic, else on PATH, or --z3. Verada is tested with Z3 5.3; Z3 4.8 rejects some of its queries
Optional yices-smt2 and cvc5 Yices for linear conditions; cvc5 for the larger proof budgets
dsymutil / LLDB Debug bundle generation / native debugging

After preparing those tools, inspect what your shell will use:

stack --version
llvm-config --version
cc --version
z3 --version

LLVM must report 21.x and be the version used by the vendored llvm-hs-21 binding. If your LLVM installation lives in a versioned prefix, prepend its bin directory to PATH before building. The compiler's installed shared libraries must still be loadable when you later run check; a command that does not prove still loads the compiler binary.

On Linux the same tools come from the distribution and LLVM's own packages: on Ubuntu 24.04, build-essential, pkg-config, libgmp-dev, libffi-dev, libncurses-dev, zlib1g-dev and libzstd-dev; LLVM 21 from apt.llvm.org (llvm-21-dev, clang-21 and libpolly-21-dev, whose Polly the LLVM binding links, with llvm-config naming llvm-config-21); and GHCup's GHC 9.12.4 and Stack. The distribution's Z3 (4.8.12) is too old; use a current release. stack build then builds veradic as on macOS. Run it, and the test suite, in a UTF-8 locale (LANG=C.UTF-8): Verada's sources and the suite's files are UTF-8.

Select a reproducible local Stack configuration

The tracked stack.yaml pins nightly-2026-10-22 and GHC 9.12.4, disables GHC installation, and names the maintainer's own GHC directory in extra-path. Choose your own matching compiler and a local build configuration instead. From the checkout root, save stack-user.yaml with:

snapshot: nightly-2026-10-22
compiler: ghc-9.12.4
compiler-check: match-exact
packages:
  - .
  - vendor/llvm-hs-21/llvm-hs
  - vendor/llvm-hs-21/llvm-hs-pure
ghc-options:
  llvm-hs: -optcxx=-std=c++17 -optcxx=-lstdc++ -optcxx=-fno-rtti
configure-options:
  verada:
    - --enable-executable-dynamic
system-ghc: true
install-ghc: false

Put your GHC 9.12.4 bin directory on PATH and check ghc --numeric-version. Keep the dynamic executable setting: the JIT needs the runtime's symbols visible. The maintainer's GHC is built with the native big-number backend, so that nothing veradic links is under the LGPL; a stock GHC links GMP, which changes the licences an installed compiler carries.

To let Stack install GHC instead, change the last two settings to system-ghc: false and install-ghc: true. The Stack FAQ explains compiler selection and the STACK_YAML override.

Build, verify and install

Use an absolute configuration path so subsequent Stack invocations, including the installer, select the same build. These commands assume the local configuration above:

export STACK_YAML="$PWD/stack-user.yaml"
stack build verada:exe:veradic
stack exec veradic -- --help
stack exec veradic -- check --help
./goinstall.sh "$HOME/.local"
export PATH="$HOME/.local/bin:$PATH"
veradic --help

The installer builds the executable, copies it to PREFIX/bin/veradic, copies required Haskell dynamic libraries to PREFIX/lib/verada, adjusts run paths and ad-hoc signs the compiler and libraries, and copies the licences to PREFIX/share/doc/verada. It uses macOS's otool, install_name_tool and codesign. LLVM and the C compiler stay the system's. The predefined library and the runtime's C sources are built into veradic, so the installed compiler does not need the checkout.

For a smoke test outside the checkout, copy one complete first-proof after project into a new directory. Change to that copy, then run:

veradic check --project verada.toml
veradic prove --no-cache --project verada.toml
veradic run --project verada.toml
veradic build --project verada.toml -o application
./application

Both execution paths should print answer: 42. Set XDG_CACHE_HOME to an empty directory to check that the runtime compiles from cold, and run veradic --version to see which solvers it found.

Make the binary package

./gopackage.sh makes dist/Verada-VERSION-arm64.dmg, the disk image the beta quick start installs. It holds a Verada folder that works wherever it is copied: bin/veradic, Z3 beside it in bin/z3, everything veradic loads that macOS does not have in lib/verada (its Haskell libraries, LLVM and LLVM's zstd), the VS Code extension's .vsix, the first-proof examples, Install Command Line Tool.command, and in share/doc/verada the licences with the notices of everything bundled. Run it from the checkout root, after the build configuration above works:

./gopackage.sh            # bundles the z3 on PATH
./gopackage.sh /path/to/z3

It installs into the folder with goinstall.sh, copies each library the folder's files load from outside /usr/lib and /System into lib/verada, renames every such library through @rpath (resolved from @executable_path and @loader_path), removes every other run path, and signs everything ad hoc again. It stops if any file in the folder still names a library or run path outside the folder and the system, or if a bundled licence is the GPL or LGPL: cvc5 built with GMP, and Yices, stay separate installs, which veradic finds on PATH. The VS Code extension is built with npm ci and npm run package in editors/vscode, so Node.js and npm must be installed. The image is not notarised; the quick start gives the step that lets macOS run it.

veradic looks for each solver in its own directory (following a symbolic link to the real file) before PATH, so the packaged compiler proves with its own Z3 without any PATH setting. To check a package as a fresh machine would run it, copy the Verada folder out of the image and run it with an empty environment:

env -i HOME="$(mktemp -d)" PATH=/usr/bin:/bin:/usr/sbin:/sbin \
  /path/to/Verada/bin/veradic --version

Upgrade, relocate, uninstall

veradic --version names the installed compiler's revision. Install a new compiler into a separate prefix while you try it, and keep the old prefix until your projects pass. The installer replaces files in its prefix and can leave obsolete libraries, so an empty dedicated prefix is easier to audit. Keep PREFIX/bin and PREFIX/lib/verada together when relocating; recheck external LLVM/system library resolution with macOS's dependency tools.

To uninstall, remove PREFIX/bin/veradic, PREFIX/lib/verada and PREFIX/share/doc/verada when no other installed copy needs them. Project sources/certificates are user data; compiler caches are separate. Avoid deleting an entire shared ~/.local prefix. See troubleshooting for missing tools and library-load errors.