heir icon indicating copy to clipboard operation
heir copied to clipboard

Make successful CMake build & test a CI PR merge requirement

Open AlexanderViand-Intel opened this issue 1 year ago • 2 comments

Depends on

  • [ ] #788
  • [ ] #818
  • [ ] #819
  • [ ] #820
  • [x] #822

and potentially on

  • #797

AlexanderViand-Intel avatar Jul 24 '24 07:07 AlexanderViand-Intel

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

j2kun avatar Oct 10 '24 16:10 j2kun

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!

AlexanderViand-Intel avatar Oct 10 '24 17:10 AlexanderViand-Intel

Closing remaining cmake-related issues after we fully dropped cmake support

AlexanderViand avatar Jul 20 '25 00:07 AlexanderViand