From: Bruno Turcksin Date: Sat, 11 Aug 2018 03:26:11 +0000 (-0400) Subject: Fix build system when using CMake 3.12 X-Git-Tag: v9.1.0-rc1~833^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7045%2Fhead;p=dealii.git Fix build system when using CMake 3.12 --- diff --git a/cmake/configure/configure_1_cuda.cmake b/cmake/configure/configure_1_cuda.cmake index 24fe1b4e00..c06a7179c8 100644 --- a/cmake/configure/configure_1_cuda.cmake +++ b/cmake/configure/configure_1_cuda.cmake @@ -24,6 +24,12 @@ SET(DEAL_II_WITH_CUDA FALSE CACHE BOOL "") MACRO(FEATURE_CUDA_FIND_EXTERNAL var) + # We need to set CUDA_USE_STATIC_CUDA_RUNTIME before FIND_PACKAGE(CUDA) and to + # force the value otherwise it is overwritten by FIND_PACKAGE(CUDA) + IF(BUILD_SHARED_LIBS) + SET(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE BOOL "" FORCE) + ENDIF() + # # TODO: Ultimately, this find_package call is not needed any more. We # still use it because it is very convenient to (a) check that CUDA is @@ -96,6 +102,10 @@ MACRO(FEATURE_CUDA_FIND_EXTERNAL var) SET(${var} FALSE) ENDIF() + # cuSOLVER requires OpenMP + FIND_PACKAGE(OpenMP) + SET(DEAL_II_LINKER_FLAGS "${DEAL_II_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") + ADD_FLAGS(DEAL_II_CUDA_FLAGS_DEBUG "-G") ENDIF() ENDMACRO() diff --git a/cmake/modules/FindCUDA.cmake b/cmake/modules/FindCUDA.cmake index 6a9d3d85ce..c8bf61da12 100644 --- a/cmake/modules/FindCUDA.cmake +++ b/cmake/modules/FindCUDA.cmake @@ -43,10 +43,8 @@ IF(CUDA_FOUND) MESSAGE(STATUS "Configured to use CUDA installation at ${CUDA_TOOLKIT_ROOT_DIR}") ENDIF() -# cuSOLVER requires OpenMP -FIND_PACKAGE(OpenMP) SET(_cuda_libraries ${CUDA_LIBRARIES} ${CUDA_cusparse_LIBRARY} - ${CUDA_cusolver_LIBRARY} ${OpenMP_CXX_FLAGS}) + ${CUDA_cusolver_LIBRARY}) SET(_cuda_include_dirs ${CUDA_INCLUDE_DIRS}) DEAL_II_PACKAGE_HANDLE(CUDA LIBRARIES REQUIRED _cuda_libraries