Skip to content

Commit 09cdbe4

Browse files
authored
Disable building STABLEHLO and specify USE_MATH_DEFINES for windows builds. (#3805)
I'm trying to build python wheel for windows similar to as done for linux in https://github.com/llvm/torch-mlir-release/ however turns out the build process on windows is broken without the following fixes: 1. Building stablehlo for windows fails due to openxla/stablehlo#1772 -- so disabling stablehlo in `build_windows_ci.sh` that will be used for building the python wheels. 2. Add `USE_MATH_DEFINES` to resolve `torch-mlir\lib\Conversion\TorchOnnxToTorch\DefaultDomainGtoP.cpp(709): error C2065: 'M_LOG10E': undeclared identifier`
1 parent 02327af commit 09cdbe4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ macro(torch_mlir_enable_werror)
7171
endif()
7272
endmacro()
7373

74+
if(MSVC)
75+
add_definitions(-D_USE_MATH_DEFINES)
76+
endif()
77+
7478
#-------------------------------------------------------------------------------
7579
# Configure out-of-tree vs in-tree build
7680
#-------------------------------------------------------------------------------

build_tools/python_deploy/build_windows_ci.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ cmake -GNinja -Bbuild \
1414
-DLLVM_EXTERNAL_PROJECTS="torch-mlir" \
1515
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$PWD" \
1616
-DPython3_EXECUTABLE="$(which python)" \
17+
-DTORCH_MLIR_ENABLE_STABLEHLO=OFF \
1718
$GITHUB_WORKSPACE/externals/llvm-project/llvm
1819

1920
cmake --build build --config Release

0 commit comments

Comments
 (0)