Go to file
Ivan 8a21abf73e
Handle __builtin_expect (#268)
* Handle builtin_expect

* add warning
2022-09-14 10:27:12 +03:00
.github/workflows Update build.yml 2022-06-21 00:23:41 -04:00
cmake/modules Option to build with address sanitizers 2021-09-16 11:42:46 +02:00
include Bump llvm (#267) 2022-09-08 13:47:54 -04:00
lib Bump llvm (#267) 2022-09-08 13:47:54 -04:00
llvm-project@3262794804 Bump llvm (#267) 2022-09-08 13:47:54 -04:00
test Bump llvm (#267) 2022-09-08 13:47:54 -04:00
tools Handle __builtin_expect (#268) 2022-09-14 10:27:12 +03: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 Fix build 2021-12-10 09:59:31 -05: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 Bump llvm (#267) 2022-09-08 13:47:54 -04:00
LICENSE Add License file 2021-10-15 11:48:44 -04:00
README.md update README (#226) 2022-06-21 09:43:29 -04:00

README.md

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