mirror of https://github.com/llvm/torch-mlir
Make build work (LTC not adapted yet).
parent
e7ead186cb
commit
61f5ff2ee4
|
@ -149,10 +149,12 @@ endfunction()
|
|||
# Configure CMake.
|
||||
list(APPEND CMAKE_MODULE_PATH ${MLIR_MAIN_SRC_DIR}/cmake/modules)
|
||||
list(APPEND CMAKE_MODULE_PATH ${LLVM_MAIN_SRC_DIR}/cmake)
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/cmake)
|
||||
|
||||
include(TableGen)
|
||||
include(AddLLVM)
|
||||
include(AddMLIR)
|
||||
include(AddMLIRPython)
|
||||
|
||||
################################################################################
|
||||
# Setup python.
|
||||
|
|
|
@ -2,7 +2,7 @@ include(AddMLIRPython)
|
|||
|
||||
# Configure PyTorch if we have any features enabled which require it.
|
||||
if(TORCH_MLIR_ENABLE_JIT_IR_IMPORTER OR TORCH_MLIR_ENABLE_LTC)
|
||||
message("Enabling PyTorch C++ dep (features depend on it)")
|
||||
message(STATUS "Enabling PyTorch C++ dep (features depend on it)")
|
||||
include(TorchMLIRPyTorch)
|
||||
|
||||
TorchMLIRProbeForPyTorchInstall()
|
||||
|
@ -39,5 +39,5 @@ endif()
|
|||
|
||||
# Include overall PT1 project.
|
||||
if(TORCH_MLIR_ENABLE_PROJECT_PT1)
|
||||
add_subdirectory(projects/pt1)
|
||||
add_subdirectory(pt1)
|
||||
endif()
|
||||
|
|
|
@ -1,28 +1,3 @@
|
|||
###########################################################################
|
||||
# Setup PyTorch
|
||||
###########################################################################
|
||||
|
||||
include(TorchMLIRPyTorch)
|
||||
|
||||
TorchMLIRProbeForPyTorchInstall()
|
||||
if(TORCH_MLIR_USE_INSTALLED_PYTORCH)
|
||||
TorchMLIRConfigurePyTorch()
|
||||
else()
|
||||
# Assume it is a sibling to the overall project.
|
||||
set(Torch_DIR "${PROJECT_SOURCE_DIR}/../libtorch/share/cmake/Torch")
|
||||
message(STATUS "Attempting to locate libtorch as a sibling to the project: ${Torch_DIR}")
|
||||
endif()
|
||||
|
||||
find_package(Torch 1.11 REQUIRED)
|
||||
|
||||
###########################################################################
|
||||
# Setup Python development
|
||||
###########################################################################
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/externals/llvm-project/mlir/cmake/modules")
|
||||
include(MLIRDetectPythonEnv)
|
||||
mlir_configure_python_dev_packages()
|
||||
|
||||
###########################################################################
|
||||
# Library definition
|
||||
###########################################################################
|
||||
|
|
|
@ -12,7 +12,6 @@ target_link_libraries(TorchMLIRJITIRImporter
|
|||
TorchMLIRAggregateCAPI
|
||||
${TORCH_LIBRARIES}
|
||||
)
|
||||
message(STATUS "TORCH_CXXFLAGS=${TORCH_CXXFLAGS}")
|
||||
set_target_properties(TorchMLIRJITIRImporter PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY "${TORCH_MLIR_PYTHON_PACKAGES_DIR}/torch_mlir/torch_mlir/_mlir_libs"
|
||||
OUTPUT_NAME lib_jit_ir_importer
|
||||
|
@ -50,7 +49,6 @@ if(Python3_LIBRARIES)
|
|||
)
|
||||
endif()
|
||||
|
||||
message(STATUS "TORCH_CXXFLAGS=${TORCH_CXXFLAGS}")
|
||||
set_target_properties(TorchMLIRJITIRImporterPybind PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY "${TORCH_MLIR_PYTHON_PACKAGES_DIR}/torch_mlir/torch_mlir/_mlir_libs"
|
||||
OUTPUT_NAME _jit_ir_importer
|
||||
|
|
|
@ -23,4 +23,4 @@ add_lit_testsuite(check-torch-mlir-pt1 "Running the torch-mlir PT1 regression te
|
|||
)
|
||||
set_target_properties(check-torch-mlir-pt1 PROPERTIES FOLDER "Tests")
|
||||
|
||||
add_lit_testsuites(TORCH_MLIR ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${TORCH_MLIR_TEST_DEPENDS})
|
||||
add_lit_testsuites(TORCH_MLIR_PT1 ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${TORCH_MLIR_TEST_DEPENDS})
|
||||
|
|
Loading…
Reference in New Issue