heir
heir copied to clipboard
Make successful CMake build & test a CI PR merge requirement
Depends on
- [ ] #788
- [ ] #818
- [ ] #819
- [ ] #820
- [x] #822
and potentially on
- #797
Trying to keep the CMake working for some of my PRs, and looking for a canonical set of commands to run for the cmake build. So far I have:
# build LLVM
mkdir /path/to/llvm-project/build && cd /path/to/llvm-project/build
cmake -G Ninja ../llvm \ -DLLVM_ENABLE_PROJECTS="mlir" \
-DLLVM_TARGETS_TO_BUILD="host" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_BUILD_EXAMPLES=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_USE_SPLIT_DWARF=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_USE_LINKER=lld \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
# is it necessary to actually build MLIR at this step?
cmake --build . --target check-mlir
# navigate back to HEIR root
popd
mkdir build && cd build
cmake -G Ninja .. \
-DMLIR_DIR=/path/to/llvm-project/build/lib/cmake/mlir \
-DBUILD_DEPS=ON \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++
cmake --build . --target heir-opt
My recommendation would be to take a look at .devcontainer/cmake/setup_mlir.sh and .devcontainer/cmake/setup_heir.sh which (modulo paths being a bit different) should hopefully reflect "best practice".
@ai-mannamalai let me know if they don't reflect what you're doing and should be updated!
Closing remaining cmake-related issues after we fully dropped cmake support