From d5861aa55ce1c39350084f2761bbc3211243cd1a Mon Sep 17 00:00:00 2001 From: peterjc123 Date: Tue, 26 Mar 2019 19:47:37 -0700 Subject: [PATCH] Append c10 libs to TorchConfig.cmake (#18418) Summary: Fixes #18416. Pull Request resolved: https://github.com/pytorch/pytorch/pull/18418 Differential Revision: D14635322 Pulled By: ezyang fbshipit-source-id: 81cb658f73583e4cd0358173617f747ebf4f7f8a --- cmake/TorchConfig.cmake.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/TorchConfig.cmake.in b/cmake/TorchConfig.cmake.in index 6222d71..063bd75 100644 --- a/cmake/TorchConfig.cmake.in +++ b/cmake/TorchConfig.cmake.in @@ -44,6 +44,9 @@ find_library(TORCH_LIBRARY torch PATHS "${TORCH_INSTALL_PREFIX}/lib") add_library(torch UNKNOWN IMPORTED) set(TORCH_LIBRARIES torch ${Caffe2_MAIN_LIBS}) +find_library(C10_LIBRARY c10 PATHS "${TORCH_INSTALL_PREFIX}/lib") +list(APPEND TORCH_LIBRARIES ${C10_LIBRARY}) + if (@USE_CUDA@) if(MSVC) set(NVTOOLEXT_HOME "C:/Program Files/NVIDIA Corporation/NvToolsExt") @@ -68,6 +71,8 @@ if (@USE_CUDA@) ${LIBNVTOOLSEXT} ${CUDA_LIBRARIES}) endif() + find_library(C10_CUDA_LIBRARY c10_cuda PATHS "${TORCH_INSTALL_PREFIX}/lib") + list(APPEND TORCH_CUDA_LIBRARIES ${C10_CUDA_LIBRARY}) list(APPEND TORCH_LIBRARIES ${TORCH_CUDA_LIBRARIES}) endif() -- 2.7.4