Make cusolver finding work for really old versions of cmake with CUDA 10.1

This commit is contained in:
Davis King 2019-03-10 09:58:19 -04:00
parent 5faf8ccce3
commit ffce4af6e2

View File

@ -720,6 +720,16 @@ if (NOT TARGET dlib)
if (NOT CUDA_cusolver_LIBRARY)
get_filename_component(cuda_blas_path "${CUDA_CUBLAS_LIBRARIES}" DIRECTORY)
find_library(CUDA_cusolver_LIBRARY cusolver HINTS ${cuda_blas_path})
# CUDA 10.1 doesn't install symbolic links to libcusolver.so in
# the usual place. This is probably a bug in the cuda
# installer. In any case, If we haven't found cusolver yet go
# look in the cuda install folder for it. New versions of cmake
# do this correctly, but older versions need help.
if (NOT CUDA_cusolver_LIBRARY)
find_library(CUDA_cusolver_LIBRARY cusolver HINTS
/usr/local/cuda/lib64/
)
endif()
mark_as_advanced(CUDA_cusolver_LIBRARY)
endif()
# Also find OpenMP since cuSOLVER needs it. Importantly, we only