mlir-sys 230.0.2

Rust bindings to the MLIR C API.
# mlir-sys

[![GitHub Action](https://img.shields.io/github/actions/workflow/status/femtomc/mlir-sys/test.yaml?style=flat-square)](https://github.com/femtomc/mlir-sys/actions)
[![Crate](https://img.shields.io/crates/v/mlir-sys.svg?style=flat-square)](https://crates.io/crates/mlir-sys)
[![License](https://img.shields.io/github/license/femtomc/mlir-sys.svg?style=flat-square)](LICENSE)

Rust bindings to [the MLIR C API](https://mlir.llvm.org/docs/CAPI/).

## Versioning

Starting with LLVM 21, this crate follows a versioning scheme similar to `llvm-sys`. The crate version is the LLVM version multiplied by 10 with a patch version:

- `mlir-sys` 230.0.x is compatible with LLVM/MLIR 23.x.x
- Previous versions (0.x.x) used a different versioning scheme

## Install

```sh
cargo add mlir-sys
```

This crate searches an `llvm-config` command on build and uses it to determine build configurations related to LLVM and MLIR. You can also use a `MLIR_SYS_230_PREFIX` environment variable to specify a custom directory of LLVM installation.

The C API bindings are automatically generated at build time by discovering all MLIR C headers from the LLVM installation. This means the bindings will match whatever headers your LLVM build provides, even if it includes custom or out-of-tree dialects.

### Using MLIR from main

To build against MLIR built from the main branch (or any non-release version), enable the `no-version-check` feature to skip the LLVM version validation:

```sh
cargo add mlir-sys --features no-version-check
```

## License

[MIT](LICENSE)