| Crates.io | llvm-bundler-rs |
| lib.rs | llvm-bundler-rs |
| version | 0.2.0 |
| created_at | 2025-06-11 23:10:00.111089+00 |
| updated_at | 2025-06-11 23:10:00.111089+00 |
| description | A bundler to download automatically LLVM and MLIR |
| homepage | |
| repository | https://github.com/marcantoinem/llvm-bundler-rs |
| max_upload_size | |
| id | 1709191 |
| size | 69,041 |
llvm-bundler-rs is a Rust crate designed to automatically bundle LLVM and statically link MLIR into your project. By downloading prebuilt LLVM artifacts and configuring the necessary environment variables, it simplifies the setup process for projects that rely on LLVM and MLIR tooling.
Add llvm-bundler-rs to your project's Cargo.toml and use it in your build.rs to compile in the right order:
[dev-dependencies]
llvm-bundler-rs = "0.1.0"
To set the env variable and download if missing:
llvm_bundler_rs::bundler::bundle_cache()?;
To get the compile order of MLIR .a:
use llvm_bundler_rs::{dependency_graph::DependencyGraph, topological_sort::TopologicalSort};
let prefix =
Path::new(&env::var(format!("MLIR_SYS_{LLVM_MAJOR_VERSION}0_PREFIX")).unwrap_or_default())
.join("lib")
.join("cmake")
.join("mlir")
.join("MLIRTargets.cmake");
let path = DependencyGraph::from_cmake(prefix)?;
let mlirlib = TopologicalSort::get_ordered_list(&path);