]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Update Ginkgo cmake detection and tests. 11402/head
authorPratik Nayak <pratikvn@protonmail.com>
Sat, 19 Dec 2020 11:11:42 +0000 (12:11 +0100)
committerPratik Nayak <pratikvn@protonmail.com>
Sat, 19 Dec 2020 13:59:06 +0000 (14:59 +0100)
cmake/configure/configure_2_ginkgo.cmake
cmake/modules/FindGINKGO.cmake
tests/ginkgo/solver.cc
tests/ginkgo/solver.output

index 32e912e8e740f125fd6990a97824e425470814ba..c2a1950cbc84d139fab11887087a12ed91252fc3 100644 (file)
 # Configuration for the Ginkgo library:
 #
 
-MACRO(FEATURE_GINKGO_ERROR_MESSAGE)
-  MESSAGE(FATAL_ERROR "\n"
-    "Could not find Ginkgo and supporting libraries!\n"
-    "Please ensure that the libraries are installed on your computer.\n"
-    "If the libraries are not at a default location, either provide some hints\n"
-    "for the autodetection:\n"
-    "    $ GINKGO_DIR=\"...\" cmake <...>\n"
-    "    $ cmake -DGINKGO_DIR=\"...\" <...>\n"
-    "or set the relevant variables by hand in ccmake.\n"
-    "Relevant hints for GINKGO are GINKGO_DIR.\n"
-    )
-ENDMACRO()
-
-MACRO(FEATURE_GINKGO_CONFIGURE_EXTERNAL)
-  SET(DEAL_II_GINKGO_BUILT_REFERENCE ${GINKGO_BUILT_REFERENCE})
-  SET(DEAL_II_GINKGO_BUILT_OPENMP ${GINKGO_BUILT_OMP})
-  SET(DEAL_II_GINKGO_BUILT_CUDA ${GINKGO_BUILT_CUDA})
-ENDMACRO()
-
 CONFIGURE_FEATURE(GINKGO)
index 66fe7357ba6406e1f76a4a3aae8b1b7339e8a825..a81b5cfbd6d0260f233ee447353670665e7a7f5b 100644 (file)
 # This module exports
 #
 #   GINKGO_INCLUDE_DIRS
+#   GINKGO_INTERFACE_LINK_FLAGS
 #
 
 SET(GINKGO_DIR "" CACHE PATH "An optional hint to a GINKGO installation")
 SET_IF_EMPTY(GINKGO_DIR "$ENV{GINKGO_DIR}")
 
-DEAL_II_FIND_LIBRARY(GINKGO_LIBRARY
-  NAMES ginkgo
-  HINTS ${GINKGO_DIR}
-  PATH_SUFFIXES
-    lib${LIB_SUFFIX} lib64 lib
-    # This is a hint, isn't it?
-    build/${CMAKE_CXX_PLATFORM_ID}-${CMAKE_SYSTEM_PROCESSOR}/libginkgo
-  )
-DEAL_II_FIND_LIBRARY(GINKGO_REFERENCE_LIBRARY
-  NAMES ginkgo_reference
-  HINTS ${GINKGO_DIR}
-  PATH_SUFFIXES
-    lib${LIB_SUFFIX} lib64 lib
-    # This is a hint, isn't it?
-    build/${CMAKE_CXX_PLATFORM_ID}-${CMAKE_SYSTEM_PROCESSOR}/libginkgo_reference
-  )
-DEAL_II_FIND_LIBRARY(GINKGO_OMP_LIBRARY
-  NAMES ginkgo_omp
-  HINTS ${GINKGO_DIR}
-  PATH_SUFFIXES
-    lib${LIB_SUFFIX} lib64 lib
-    # This is a hint, isn't it?
-    build/${CMAKE_CXX_PLATFORM_ID}-${CMAKE_SYSTEM_PROCESSOR}/libginkgo_omp
-  )
-DEAL_II_FIND_LIBRARY(GINKGO_CUDA_LIBRARY
-  NAMES ginkgo_cuda
-  HINTS ${GINKGO_DIR}
-  PATH_SUFFIXES
-    lib${LIB_SUFFIX} lib64 lib
-    # This is a hint, isn't it?
-    build/${CMAKE_CXX_PLATFORM_ID}-${CMAKE_SYSTEM_PROCESSOR}/libginkgo_cuda
-  )
-
-DEAL_II_FIND_PATH(GINKGO_INCLUDE_DIR ginkgo/ginkgo.hpp
-  HINTS ${GINKGO_DIR}
-  PATH_SUFFIXES include
+find_package(Ginkgo
+  HINTS ${GINKGO_DIR} ${Ginkgo_DIR} $ENV{Ginkgo_DIR}
   )
 
 DEAL_II_PACKAGE_HANDLE(GINKGO
   LIBRARIES
-    REQUIRED GINKGO_LIBRARY GINKGO_REFERENCE_LIBRARY GINKGO_OMP_LIBRARY GINKGO_CUDA_LIBRARY
-  INCLUDE_DIRS REQUIRED GINKGO_INCLUDE_DIR
-  USER_INCLUDE_DIRS REQUIRED GINKGO_INCLUDE_DIR
+    REQUIRED GINKGO_INTERFACE_LINK_FLAGS
+  INCLUDE_DIRS
+    REQUIRED GINKGO_INSTALL_INCLUDE_DIR
+  USER_INCLUDE_DIRS
+    REQUIRED GINKGO_INSTALL_INCLUDE_DIR
   CLEAR
-    GINKGO_LIBRARY GINKGO_REFERENCE_LIBRARY GINKGO_OMP_LIBRARY GINKGO_CUDA_LIBRARY GINKGO_INCLUDE_DIR
+    GINKGO_INSTALL_INCLUDE_DIR GINKGO_INTERFACE_LINK_FLAGS
   )
index ff7af116a15fc8582785f083f3e78b289ce9f4fa..b8f69375dc6a1a6c3726b061828b4cc84d7a061c 100644 (file)
@@ -101,8 +101,8 @@ main(int argc, char **argv)
     u = 0.;
     check_solver_within_range(gmres_solver.solve(A, u, f),
                               control.last_step(),
-                              23,
-                              29);
+                              20,
+                              49);
     u = 0.;
     check_solver_within_range(ir_solver_cg.solve(A, u, f),
                               control.last_step(),
index dda157582e34b43af14940c1a1edd163f8ca9b96..631b3778ff583afe2833b5d9f0676a3a56c41b35 100644 (file)
@@ -4,6 +4,6 @@ DEAL::Solver stopped within 35 - 39 iterations
 DEAL::Solver stopped within 53 - 65 iterations
 DEAL::Solver stopped within 72 - 79 iterations
 DEAL::Solver stopped within 33 - 39 iterations
-DEAL::Solver stopped within 23 - 29 iterations
+DEAL::Solver stopped within 20 - 49 iterations
 DEAL::Solver stopped within 0 - 2 iterations
 DEAL::Solver stopped within 29 - 33 iterations

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.