This is an example of an out-of-tree MLIR dialect along with a finch opt
-like tool to operate on that dialect.
- Do a recursive clone
git clone --recursive https://github.com/finch-tensor/Finch-mlir.git
Or if you have already cloned this repository, run
git submodule init --update --recursive
This will take some time as it perform a shallow-clone of LLVM.
- Install prerequisites to build the dialect and the Python bindings:
1a. Use your system package manager or conda
to install a C/C++ compiler and CCache.
1b. Install the build-time Python requirements:
# Generate the build requirements dynamically from `pyproject.toml` and install them.
./scripts/install_build_reqs.sh
- Build the wheel or install the package:
python -m build --no-isolation
OR
pip install --no-build-isolation .
In theory, the --no-[build-]isolation
flag is unnecessary, but it caches the LLVM build which can greatly speed-up the buid process on repeated runs.
One can run the tests once the wheel is built and/or the package is installed with
cmake --build build --target check-finch
Assuming the CMake configure step doesn't need to run.