Skip to content

C/C++ frontend for MLIR. Also features polyhedral optimizations, parallel optimizations, and more!

License

Notifications You must be signed in to change notification settings

curiouscat2018/Polygeist

This branch is 352 commits behind llvm/Polygeist:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e703db1 · Jun 25, 2022
Jun 21, 2022
Sep 16, 2021
May 18, 2022
Jun 25, 2022
May 18, 2022
May 8, 2022
Jun 25, 2022
Jun 23, 2021
Jun 23, 2021
Jun 23, 2021
Dec 10, 2021
Jul 20, 2021
Jun 23, 2021
May 31, 2022
Oct 15, 2021
Jun 21, 2022

Repository files navigation

Build instructions

Requirements

  • Working C and C++ toolchains(compiler, linker)
  • cmake
  • make or ninja

1. Clone Polygeist

git clone --recursive https://github.com/llvm/Polygeist
cd Polygeist

2. Install LLVM, MLIR, Clang, and Polygeist

Option 1: Using pre-built LLVM, MLIR, and Clang

Polygeist can be built by providing paths to a pre-built MLIR and Clang toolchain.

  1. Build LLVM, MLIR, and Clang:
mkdir llvm-project/build
cd llvm-project/build
cmake -G Ninja ../llvm \
  -DLLVM_ENABLE_PROJECTS="mlir;clang" \
  -DLLVM_TARGETS_TO_BUILD="host" \
  -DLLVM_ENABLE_ASSERTIONS=ON \
  -DCMAKE_BUILD_TYPE=DEBUG
ninja
ninja check-mlir
  1. Build Polygeist:
mkdir build
cd build
cmake -G Ninja .. \
  -DMLIR_DIR=$PWD/../llvm-project/build/lib/cmake/mlir \
  -DCLANG_DIR=$PWD/../llvm-project/build/lib/cmake/clang \
  -DLLVM_TARGETS_TO_BUILD="host" \
  -DLLVM_ENABLE_ASSERTIONS=ON \
  -DCMAKE_BUILD_TYPE=DEBUG
ninja
ninja check-polygeist-opt && ninja check-cgeist

Option 2: Using unified LLVM, MLIR, Clang, and Polygeist build

Polygeist can also be built as an external LLVM project using LLVM_EXTERNAL_PROJECTS.

  1. Build LLVM, MLIR, Clang, and Polygeist:
mkdir build
cd build
cmake -G Ninja ../llvm-project/llvm \
  -DLLVM_ENABLE_PROJECTS="clang;mlir" \
  -DLLVM_EXTERNAL_PROJECTS="polygeist" \
  -DLLVM_EXTERNAL_POLYGEIST_SOURCE_DIR=.. \
  -DLLVM_TARGETS_TO_BUILD="host" \
  -DLLVM_ENABLE_ASSERTIONS=ON \
  -DCMAKE_BUILD_TYPE=DEBUG
ninja
ninja check-polygeist-opt && ninja check-cgeist

ninja check-polygeist-opt runs the tests in Polygeist/test/polygeist-opt ninja check-cgeist runs the tests in Polygeist/tools/cgeist/Test

About

C/C++ frontend for MLIR. Also features polyhedral optimizations, parallel optimizations, and more!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 60.1%
  • C 25.8%
  • MLIR 11.6%
  • CMake 0.9%
  • Perl 0.5%
  • R 0.4%
  • Other 0.7%