Copyright 2024-2025, Giordano Salvador SPDX-License-Identifier: BSD-3-Clause
Author/Maintainer: Giordano Salvador 73959795+e3m3@users.noreply.github.com
Rust library and bindings implementing the MLIR [1] (license [2]) compiler framework.
Uses the C API bindings from the mlir_sys
crate (site [3] and license [4]).
Read the API at https://e3m3.github.io/mlir-rust/mlir/.
-
rust-2024
-
llvm-19, clang-19, and mlir-sys (or llvm version matching mlir-sys)
-
libxml2 and libz headers (for testing)
-
num_cpus (for testing)
-
python3-lit, FileCheck (for testing)
- By default,
tests/lit-tests.rs
will search for the lit executable in$PYTHON_VENV_PATH/bin
(if it exists) or the system's/usr/bin
.
- By default,
-
[docker|podman] (for testing/containerization)
-
Native build:
cargo build
-
Build Rust lit tests:
cargo build --manifest-path tests/lit-tests-rust/Cargo.toml
-
Run Rust lit test (e.g.,
tests/lit-tests-rust/src/<test-name>.lit-rs
:cargo run --manifest-path tests/lit-tests-rust/Cargo.toml -- <test-name>
-
Build and run lit test suite (MLIR + Rust):
cargo test -- --nocapture
-
Container build and test podman [6]:
podman build -t mlir-rust -f container/Containerfile .
-
Container build and test docker [7]:
docker build -t mlir-rust -f container/Dockerfile .
-
If
make
is installed, you can build the image by running:make
-
https://mlir.llvm.org/
-
https://github.com/llvm/llvm-project/blob/main/mlir/LICENSE.TXT
-
https://crates.io/crates/mlir-sys
-
https://github.com/mlir-rs/mlir-sys/blob/main/LICENSE
-
https://fedoraproject.org/
-
https://podman.io/
-
https://www.docker.com/