torch-mlir/build.sh

25 lines
776 B
Bash
Raw Normal View History

2024-09-12 19:36:52 +08:00
#!/bin/bash
set -x
set -e
cmake -GNinja -Bbuild \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_LINKER=lld \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_EXTERNAL_PROJECTS="torch-mlir" \
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$(pwd)" \
-DLLVM_TARGETS_TO_BUILD=host \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
-DTORCH_MLIR_USE_INSTALLED_PYTORCH=ON \
-DTORCH_MLIR_ENABLE_PYTORCH_EXTENSIONS=ON \
-DTORCH_MLIR_ENABLE_JIT_IR_IMPORTER=ON \
-DTORCH_MLIR_ENABLE_LTC=OFF \
$(pwd)/externals/llvm-project/llvm
2024-09-30 16:42:38 +08:00
cmake --build build --target TorchMLIRPythonModules TorchMLIRJITIRImporterPybind TorchMLIRE2ETestPythonModules check-torch-mlir-pt1 check-torch-mlir
2024-09-12 19:36:52 +08:00