From c8ee8d02ebfd6e672e82904cdde049a10dc34d75 Mon Sep 17 00:00:00 2001 From: stephenneuendorffer Date: Thu, 20 Jan 2022 08:20:54 -0800 Subject: [PATCH] Install torch-mlir binaries (#421) In addition, use add_llvm_executable so that the relative rpath of the installed binaries is set properly. --- tools/torch-mlir-lsp-server/CMakeLists.txt | 7 ++++++- tools/torch-mlir-opt/CMakeLists.txt | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/torch-mlir-lsp-server/CMakeLists.txt b/tools/torch-mlir-lsp-server/CMakeLists.txt index f9f239b7e..3ee29438e 100644 --- a/tools/torch-mlir-lsp-server/CMakeLists.txt +++ b/tools/torch-mlir-lsp-server/CMakeLists.txt @@ -1,6 +1,11 @@ # torch-mlir-lsp-server is always linked dynamically as we want to distribute the # binaries with the python packages for hacking/debugging. -add_executable(torch-mlir-lsp-server torch-mlir-lsp-server.cpp) +add_llvm_executable(torch-mlir-lsp-server torch-mlir-lsp-server.cpp) + +install(TARGETS torch-mlir-lsp-server +EXPORT TorchMLIRTargets +RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} +COMPONENT torch-mlir-lsp-server) get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS) diff --git a/tools/torch-mlir-opt/CMakeLists.txt b/tools/torch-mlir-opt/CMakeLists.txt index c868d65d6..3fb003633 100644 --- a/tools/torch-mlir-opt/CMakeLists.txt +++ b/tools/torch-mlir-opt/CMakeLists.txt @@ -1,4 +1,9 @@ -add_executable(torch-mlir-opt torch-mlir-opt.cpp) +add_llvm_executable(torch-mlir-opt torch-mlir-opt.cpp) + +install(TARGETS torch-mlir-opt +EXPORT TorchMLIRTargets +RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} +COMPONENT torch-mlir-opt) get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)