Revert to using local PyTorch binaries (#1024)

Temporarily revert to using PyTorch binaries until source builds
are ready to land.

TORCH_MLIR_USE_INSTALLED_PYTORCH can be turned to OFF if you want
to link against libtorch and/or source builds.
pull/1013/head snapshot-20220708.527
powderluv 2022-07-07 15:42:08 -07:00 committed by GitHub
parent 3d1a160101
commit f202ae0012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -5,9 +5,20 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
include(TorchMLIRPyTorch)
set(Torch_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../libtorch/share/cmake/Torch")
option(TORCH_MLIR_USE_INSTALLED_PYTORCH "Build from local PyTorch in environment" ON)
if(TORCH_MLIR_USE_INSTALLED_PYTORCH)
TorchMLIRProbeForPyTorchInstall()
endif()
find_package(Torch 1.11 REQUIRED)
TorchMLIRConfigureLibTorch()
if(TORCH_MLIR_USE_INSTALLED_PYTORCH)
TorchMLIRConfigurePyTorch()
else()
TorchMLIRConfigureLibTorch()
endif()
message(STATUS "libtorch_python CXXFLAGS is ...${TORCH_CXXFLAGS}")
#-------------------------------------------------------------------------------