]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix build system when using CMake 3.12 7045/head
authorBruno Turcksin <bruno.turcksin@gmail.com>
Sat, 11 Aug 2018 03:26:11 +0000 (23:26 -0400)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Sat, 11 Aug 2018 03:26:11 +0000 (23:26 -0400)
cmake/configure/configure_1_cuda.cmake
cmake/modules/FindCUDA.cmake

index 24fe1b4e001682c14ff208d015915adec99fa8d5..c06a7179c83b40aebded0fba66262a399711ee3d 100644 (file)
@@ -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()
index 6a9d3d85cedd6e52e59dac7509329678901120a7..c8bf61da12edd01c4efc124759a19ac492fcac9c 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.