forked from llvm/torch-mlir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: enable ccache on Windows (llvm#1548)
This patch makes a few small, but key, changes to enable ccache on Windows. First, it replaces the hendrikmuhs/ccache-action action with command line invocations to the ccache binary, since the action has two bugs, one of which causes CI to refer to different ccache artifacts before versus after the build on Windows whereas the other bug can sometimes cause the action to incorrectly infer that the cache is empty. Second, this patch slightly alters the cache key, so that our old cache artifacts, which have grown too big, are eventually discarded in favor of the new, smaller cache artifacts. Along the way, this patch also keeps the RollPyTorch's cache artifact separate from the regular build's cache artifact so as to keep these artifacts small, and also because the RollPyTorch action is off the critical path for most contributors. Finally, this patch makes small changes to the CMake file so that on Windows, the ccache binary is added as a prefix, as recommended on the [ccache Wiki](https://github.com/ccache/ccache/wiki/MS-Visual-Studio).
- Loading branch information
Showing
8 changed files
with
72 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Building torch-mlir" | ||
|
||
cmake -GNinja -Bbuild \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DLLVM_ENABLE_PROJECTS=mlir \ | ||
-DLLVM_TARGETS_TO_BUILD=host \ | ||
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \ | ||
-DPython3_FIND_VIRTUALENV=ONLY \ | ||
-DLLVM_EXTERNAL_PROJECTS="torch-mlir;torch-mlir-dialects" \ | ||
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$PWD" \ | ||
-DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR="$PWD/externals/llvm-external-projects/torch-mlir-dialects" \ | ||
-DPython3_EXECUTABLE="$(which python)" \ | ||
$GITHUB_WORKSPACE/externals/llvm-project/llvm | ||
|
||
cmake --build build | ||
|
||
echo "Build completed successfully" |