From 0bdb92b2d4a3229ed9e0ddac4d0eab799dd49d17 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 13 May 2022 19:52:49 -0400 Subject: [PATCH] change propagate of CUDA libraries to PUBLIC In #976, propagate was changed from PRIVATE to PUBLIC. However, `libdeepmd` actually includes the CUDA libraries in the `gelu.cc` file. --- source/lib/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/lib/CMakeLists.txt b/source/lib/CMakeLists.txt index 251f87053f..17697aab93 100644 --- a/source/lib/CMakeLists.txt +++ b/source/lib/CMakeLists.txt @@ -11,7 +11,8 @@ if (USE_CUDA_TOOLKIT) add_definitions("-DGOOGLE_CUDA") add_subdirectory(src/cuda) set (EXTRA_LIBS ${EXTRA_LIBS} deepmd_op_cuda) - target_link_libraries (${libname} INTERFACE ${CUDA_LIBRARIES} ${EXTRA_LIBS}) + target_link_libraries (${libname} PUBLIC ${CUDA_LIBRARIES}) + target_link_libraries (${libname} INTERFACE ${EXTRA_LIBS}) # gpu_cuda.h target_include_directories(${libname} PUBLIC ${CUDA_INCLUDE_DIRS}) endif() @@ -20,7 +21,8 @@ if (USE_ROCM_TOOLKIT) add_definitions("-DTENSORFLOW_USE_ROCM") add_subdirectory(src/rocm) set (EXTRA_LIBS ${EXTRA_LIBS} deepmd_op_rocm) - target_link_libraries (${libname} INTERFACE ${ROCM_LIBRARIES} ${EXTRA_LIBS}) + target_link_libraries (${libname} PUBLIC ${ROCM_LIBRARIES}) + target_link_libraries (${libname} INTERFACE ${EXTRA_LIBS}) # gpu_rocm.h target_include_directories(${libname} PUBLIC ${ROCM_INCLUDE_DIRS}) endif()