You will need to have maturin installed to build the bindings. You can install it in a virtual environment like this:
python3 -m venv env
source env/bin/activate
pip install maturinYou will also need to have LLVM installed. On Ubuntu, you can install it with:
sudo apt install llvm-devMake a note of the directory where LLVM is installed as well as the version number, as you will need to pass it to maturin when building the bindings.
To build the bindings, run the following command in the root directory of the project, replacing the llvm directory and version number with the ones you noted earlier:
LLVM_DIR=/usr/lib/llvm-17 LLVM_SYS_170_PREFIX=/usr/lib/llvm-17 maturin develop --features diffsol-llvm17To build a wheel, you can use the following command:
LLVM_DIR=/usr/lib/llvm-17 LLVM_SYS_170_PREFIX=/usr/lib/llvm-17 maturin build --release --out dist --features diffsol-llvm17Or via pip:
MATURIN_PEP517_ARGS="--features diffsol-llvm17" pip wheel .