From cd7bdfcff2a56a8001fcf46805184d69b8d872f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E6=99=93=E4=BC=9F?= <39303645+Shixiaowei02@users.noreply.github.com> Date: Thu, 28 Nov 2019 20:33:52 +0800 Subject: [PATCH] fix cuda cmake, test=develop (#2514) --- cmake/cuda.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/cuda.cmake b/cmake/cuda.cmake index b80c35a0e6..a5d3d57218 100644 --- a/cmake/cuda.cmake +++ b/cmake/cuda.cmake @@ -180,13 +180,16 @@ function(add_cuda_static_lib alias cuda_lib_paths file_name) add_library(${alias} STATIC IMPORTED GLOBAL) set_property(TARGET ${alias} PROPERTY IMPORTED_LOCATION ${ABS_PATH}) set(CUDA_STATIC_MODULES ${CUDA_STATIC_MODULES} ${alias} PARENT_SCOPE) + if (NOT ABS_PATH) + message(FATAL_ERROR "Can not find CUDA static library: ${file_name}") + endif() endfunction() add_cuda_static_lib(cudart_static CUDNN_CHECK_LIBRARY_DIRS libcudart_static.a) add_cuda_static_lib(cublas_static CUDNN_CHECK_LIBRARY_DIRS libcublas_static.a) add_cuda_static_lib(curand_static CUDNN_CHECK_LIBRARY_DIRS libcurand_static.a) add_cuda_static_lib(culibos_static CUDNN_CHECK_LIBRARY_DIRS libculibos.a) -if((${CUDA_VERSION} GREATER 10.0) OR (${CUDA_VERSION} EQUAL 10.0)) +if(NOT ${CUDA_VERSION} LESS 10.1) add_cuda_static_lib(cublasLt_static CUDNN_CHECK_LIBRARY_DIRS libcublasLt_static.a) endif() -- GitLab