Installation¶
Requirements¶
- Python 3.12+
- clang 20+ (system-wide)
Installing clang¶
anvil uses clang for JIT compilation and AOT code generation. Version 20 or later is required.
macOS:
Make sure the Homebrew-installed clang is on your PATH (or set CC/CXX):
Ubuntu/Debian:
# Add LLVM apt repository
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20
# Ensure clang-20 is the default
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-20 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-20 100
CUDA requirements (optional)¶
For CUDA GPU support:
- CUDA toolkit 12.0+ with
nvccandnvrtc(typically installed via the CUDA toolkit) - A compatible NVIDIA GPU
nvidia-smiavailable onPATH(for automatic architecture detection)
Install from Git¶
# with uv (recommended)
uv add git+https://github.com/PREDICT-EPFL/anvil.git
# with SSH
uv add git+ssh://git@github.com/PREDICT-EPFL/anvil.git
# with pip
pip install git+https://github.com/PREDICT-EPFL/anvil.git
Note
anvil is not yet published to PyPI. PyPI wheels will be available once the repository is made public.