From: Bruno Turcksin Date: Tue, 22 Dec 2020 14:37:19 +0000 (+0000) Subject: Revert "Merge pull request #11402 from pratikvn/fix-ginkgo-cmake" X-Git-Tag: v9.3.0-rc1~726^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d639dbaffd44d96979845f3a6a89756d5cd62557;p=dealii.git Revert "Merge pull request #11402 from pratikvn/fix-ginkgo-cmake" This reverts commit 927a89d58795378fa0060645f434e3627e8c8262, reversing changes made to a47360cd42a75a208c1e753dda4ff5134804f225. --- diff --git a/cmake/configure/configure_2_ginkgo.cmake b/cmake/configure/configure_2_ginkgo.cmake index c2a1950cbc..32e912e8e7 100644 --- a/cmake/configure/configure_2_ginkgo.cmake +++ b/cmake/configure/configure_2_ginkgo.cmake @@ -17,4 +17,23 @@ # 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) diff --git a/cmake/modules/FindGINKGO.cmake b/cmake/modules/FindGINKGO.cmake index a81b5cfbd6..66fe7357ba 100644 --- a/cmake/modules/FindGINKGO.cmake +++ b/cmake/modules/FindGINKGO.cmake @@ -19,23 +19,54 @@ # 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}") -find_package(Ginkgo - HINTS ${GINKGO_DIR} ${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 ) DEAL_II_PACKAGE_HANDLE(GINKGO LIBRARIES - REQUIRED GINKGO_INTERFACE_LINK_FLAGS - INCLUDE_DIRS - REQUIRED GINKGO_INSTALL_INCLUDE_DIR - USER_INCLUDE_DIRS - REQUIRED GINKGO_INSTALL_INCLUDE_DIR + 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 CLEAR - GINKGO_INSTALL_INCLUDE_DIR GINKGO_INTERFACE_LINK_FLAGS + GINKGO_LIBRARY GINKGO_REFERENCE_LIBRARY GINKGO_OMP_LIBRARY GINKGO_CUDA_LIBRARY GINKGO_INCLUDE_DIR ) diff --git a/tests/ginkgo/solver.cc b/tests/ginkgo/solver.cc index b8f69375dc..ff7af116a1 100644 --- a/tests/ginkgo/solver.cc +++ b/tests/ginkgo/solver.cc @@ -101,8 +101,8 @@ main(int argc, char **argv) u = 0.; check_solver_within_range(gmres_solver.solve(A, u, f), control.last_step(), - 20, - 49); + 23, + 29); u = 0.; check_solver_within_range(ir_solver_cg.solve(A, u, f), control.last_step(), diff --git a/tests/ginkgo/solver.output b/tests/ginkgo/solver.output index 631b3778ff..dda157582e 100644 --- a/tests/ginkgo/solver.output +++ b/tests/ginkgo/solver.output @@ -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 20 - 49 iterations +DEAL::Solver stopped within 23 - 29 iterations DEAL::Solver stopped within 0 - 2 iterations DEAL::Solver stopped within 29 - 33 iterations