Skip to content

munich-quantum-software/setup-mlir

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

setup-mlir

This repository provides an action for setting up MLIR in GitHub Actions and installation scripts for setting up MLIR locally.

The MLIR binaries are built and distributed in the portable-mlir-toolchain repository.

GitHub Actions

- name: Setup MLIR
  uses: munich-quantum-software/setup-mlir@v1.1.0
  with:
    llvm-version: 21.1.8

This extracts a pre-built MLIR installation, adds the binaries to $PATH, and defines $LLVM_DIR and $MLIR_DIR.

Debug Builds (Windows Only)

On Windows, you can optionally install debug builds:

- name: Setup MLIR (Debug)
  uses: munich-quantum-software/setup-mlir@v1.1.0
  with:
    llvm-version: 21.1.8
    debug: true

Installation Scripts

If you want to use the pre-built MLIR installations locally, we also provide installation scripts. The scripts require the LLVM version or commit hash (e.g., 21.1.8 or f8cb798) and the desired installation directory to be passed. The scripts automatically download and use a platform-specific zstd binary for decompression, so only tar needs to be installed on the host system.

Note

tar is included by default in Windows 10 and Windows 11. If you're using an older version, you can install it, for example, via Chocolatey: choco install tar.

On Linux and macOS, use the following Bash command:

curl -LsSf https://github.com/munich-quantum-software/setup-mlir/releases/latest/download/setup-mlir.sh | bash -s -- -v 21.1.8 -p /path/to/installation

On Windows, use the following PowerShell command:

powershell -ExecutionPolicy ByPass -c "& ([scriptblock]::Create((irm https://github.com/munich-quantum-software/setup-mlir/releases/latest/download/setup-mlir.ps1))) -llvm_version 21.1.8 -install_prefix /path/to/installation"

Debug Builds (Windows Only)

On Windows, you can optionally install debug builds by adding the -use_debug flag:

powershell -ExecutionPolicy ByPass -c "& ([scriptblock]::Create((irm https://github.com/munich-quantum-software/setup-mlir/releases/latest/download/setup-mlir.ps1))) -llvm_version 21.1.8 -install_prefix /path/to/installation -use_debug"

About

Set up MLIR in your GitHub Actions workflow

Resources

License

Stars

Watchers

Forks

Contributors 9