Skip to content

Instantly share code, notes, and snippets.

@wecing
Created February 6, 2025 23:09
Show Gist options
  • Select an option

  • Save wecing/3123c1a85c6e52794b034d7f7247148e to your computer and use it in GitHub Desktop.

Select an option

Save wecing/3123c1a85c6e52794b034d7f7247148e to your computer and use it in GitHub Desktop.
compile MLIR with cmake / bazel
cd llvm-project
# bazel
cd utils/bazel
bazel build @llvm-project//mlir/... # --action_env=BAZEL_CXXOPTS='-std=c++17'
# cmake - see https://mlir.llvm.org/getting_started/
mkdir build
cd build
cmake -G Ninja ../llvm \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_BUILD_EXAMPLES=ON \
-DLLVM_TARGETS_TO_BUILD="Native;NVPTX;AMDGPU" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON
cmake --build . --target check-mlir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment