Skip to content

you can build a wheel from a specific version of llvm-project by adding the project as a submodule

Notifications You must be signed in to change notification settings

starrryz/flagtree_mlir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FLAGTREE-MLIR Build Guide

This document describes how to build a wheel package from a specific version of llvm-project.

Quick Start

1. Clone the repository and build clang

git clone https://github.com/flagos-ai/flagtree_mlir.git
apt install clang

Note: No need to download submodule and git clone --recursive unless your version is the same as ours.

2. Build the Wheel

cd flagtree_mlir
python -m build -w

After building, the .whl file will appear in the ./dist directory.

3. Install and Test

# Install the wheel package (adjust the filename according to the actual one)
pip install ./dist/flagtree_mlir-0.1.0-cp312-cp312-linux_x86_64.whl --force-reinstall

# Test import
python -c "import flagtree_mlir"
python -c "from mlir import ir"

No error is expected.

wheel Structure

Unzip the wheel package, the content is as below:

├── flagtree_mlir
│   ├── bin
│   ├── include
│   ├── lib
│   ├── python_packages
│   ├── share
│   └── src
├── flagtree_mlir-0.1.0.dist-info
└── mlir
    ├── _mlir_libs
    ├── dialects
    ├── extras
    └── runtime

Build Configuration

Our cmake instruction is as below:

cmake -G Ninja -B build -S llvm \
    -DLLVM_ENABLE_PROJECTS="mlir;llvm;lld" \
    -DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
    -DCMAKE_C_COMPILER=clang \
    -DCMAKE_CXX_COMPILER=clang++ \
    -DLLVM_ENABLE_LLD=ON \
    -DMLIR_ENABLE_BINDINGS_PYTHON=ON

Customization: You can change the content of pyproject.toml to follow your favor.

About

you can build a wheel from a specific version of llvm-project by adding the project as a submodule

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages