You need Clang / LLVM version
13 or later. Note that on macOS the preinstalled clang does not support
the wasm target, so use e.g.
brew install llvm instead.
If you want to compile to WebAssembly, you also need:
- wasm-ld - the LLVM linker for WASM (NB: On
Linux you may need to install the
lldpackage; on macOS this is installed as part of
See below for instructions on how to install the dependencies.
The easiest way to install Juvix on MacOS is by using Homebrew.
To install the homebrew-juvix tap, run:
brew tap anoma/juvix
To install Juvix, run:
brew install juvix
Helpful information can also be obtained by running:
brew info juvix
A Juvix compiler binary executable for Linux x8664 is available on the Juvix release page.
To install this executable, download and unzip the linked file and move
it to a directory on your shell's
For example if
~/.local/bin is on your shell's
PATH, you can install
Juvix as follows:
cd /tmp curl -OL https://github.com/anoma/juvix/releases/download/v0.3.1/juvix-linux_x86_64-v0.3.1.zip unzip juvix-linux_x86_64-v0.3.1.zip mv juvix-linux_x86_64-v0.3.1 ~/.local/bin/juvix
Building Juvix from source¶
To install Juvix from source you must clone the Github repository. Then Juvix can be installed with the following commands. We assume you have Stack and GNU Make installed.
git clone --recursive https://github.com/anoma/juvix.git cd juvix make install
The C compiler and linker paths can be specified as options to the
make install command, e.g.
make install CC=path/to/clang LIBTOOL=path/to/llvm-ar
On MacOS, you can alternatively run the following command for Homebrew.
--HEAD used below is optional – use it to build the latest
version of Juvix in the
main branch on Github.
brew install --build-from-source --HEAD juvix --verbose
Building the project with
We recommend to use the
stack build tool with this project.
If you prefer the
cabal build tool instead, then you need to generate
juvix.cabal file using hpack
You also need to compile the runtime first:
make runtime cabal build
wasi-sdk you need to download
wasi-sysroot precompiled archives from the wasi-sdk release
libclang_rt.builtins-wasm32-wasi-*.tar.gzarchive in the
clanginstallation root (for example
/usr/lib/clang/13on Ubuntu or
`brew --prefix llvm`on macOS).
For example on macOS with
cd `brew --prefix llvm` curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-15/libclang_rt.builtins-wasm32-wasi-15.0.tar.gz -OL tar xf libclang_rt.builtins-wasm32-wasi-15.0.tar.gz
wasi-sysroot-*.tar.gzarchive on your local system and set
WASI_SYSROOT_PATHto its path.
cd ~ curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-15/wasi-sysroot-15.0.tar.gz -OL tar xf wasi-sysroot-15.0.tar.gz export WASI_SYSROOT_PATH=~/wasi-sysroot