Go to file
William S. Moses 9c10e53d8a Init list cleanup 2021-12-05 01:49:09 -05:00
.github/workflows Fix GCC CI 2021-11-16 13:03:41 -06:00
cmake/modules Option to build with address sanitizers 2021-09-16 11:42:46 +02:00
include Add a polygeist-opt tool 2021-11-29 11:14:19 -05:00
lib minor 2021-12-05 01:49:09 -05:00
llvm-project@30d87d4a5d Bump LLVM 2021-11-16 13:03:41 -06:00
mlir-clang Init list cleanup 2021-12-05 01:49:09 -05:00
tools Fix upstream build 2021-12-01 14:51:48 -05:00
.clang-format Initial non-fork commit 2021-06-23 13:15:11 -04:00
.clang-tidy Initial non-fork commit 2021-06-23 13:15:11 -04:00
.git-blame-ignore-revs Initial non-fork commit 2021-06-23 13:15:11 -04:00
.gitignore Added funcop -> op by lower_to name 2021-07-20 09:20:31 +02:00
.gitmodules Added funcop -> op by lower_to name 2021-07-20 09:20:31 +02:00
AddClang.cmake Initial non-fork commit 2021-06-23 13:15:11 -04:00
CMakeLists.txt Add a polygeist-opt tool 2021-11-29 11:14:19 -05: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