Forked from hanchenye’s commit on April 21, 2022 https://github.com/hanchenye/Polygeist/tree/edd8f9d0ccb0b3eb67597faa83ee66245956ebb6
git clone --recursive https://github.com/wsmoses/Polygeist.git cd Polygeist
Polygeist can be built by providing paths to a pre-built MLIR and Clang toolchain.
-DLLVM_ENABLE_PROJECTS=”mlir;clang” -DLLVM_TARGETS_TO_BUILD=”host” -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=DEBUG ninja ninja check-mlir
2. Build Polygeist: ```sh 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
Polygeist can also be built as an external LLVM project using LLVM_EXTERNAL_PROJECTS.
-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
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Build instructions
Requirements
0. Clone 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.
-DLLVM_ENABLE_PROJECTS=”mlir;clang”
-DLLVM_TARGETS_TO_BUILD=”host”
-DLLVM_ENABLE_ASSERTIONS=ON
-DCMAKE_BUILD_TYPE=DEBUG ninja ninja check-mlir
Option 2: Using unified LLVM, MLIR, Clang, and Polygeist build
Polygeist can also be built as an external LLVM project using LLVM_EXTERNAL_PROJECTS.
-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