Go to file
Guojie Luo 34214af0ec Forked from hanchenye's commit on April 21, 2022
edd8f9d0cc
2022-12-25 09:13:16 +00:00
.github/workflows Fix GPU inline check 2021-12-31 21:23:51 -05:00
cmake/modules Option to build with address sanitizers 2021-09-16 11:42:46 +02:00
include Forked from hanchenye's commit on April 21, 2022 2022-12-25 09:13:16 +00:00
lib Forked from hanchenye's commit on April 21, 2022 2022-12-25 09:13:16 +00:00
llvm-project@d3cf3685a7 Forked from hanchenye's commit on April 21, 2022 2022-12-25 09:13:16 +00:00
test Fix Parallel LICM & inheritence (#196) 2022-03-25 01:28:06 -04:00
tools Forked from hanchenye's commit on April 21, 2022 2022-12-25 09:13:16 +00:00
.clang-format
.clang-tidy
.git-blame-ignore-revs
.gitignore Fix build 2021-12-10 09:59:31 -05:00
.gitmodules Forked from hanchenye's commit on April 21, 2022 2022-12-25 09:13:16 +00:00
AddClang.cmake
CMakeLists.txt Emit tools in ${CMAKE_BINARY_DIR}/bin dir 2021-12-14 09:50:27 -08:00
LICENSE Add License file 2021-10-15 11:48:44 -04:00
README.md Add installation guide for LLVM_EXTERNAL_PROJECTS. (#67) 2021-08-24 21:13:19 +02:00

README.md

Build instructions

Requirements

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

0. Clone Polygeist

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

1. 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-mlir-clang

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-mlir-clang