]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Detect Ginkgo and compile the ginkgo files: CMake.
authorPratik Nayak <pratik.nayak4@gmail.com>
Wed, 30 Jan 2019 11:47:50 +0000 (12:47 +0100)
committerPratik Nayak <pratik.nayak4@gmail.com>
Wed, 30 Jan 2019 11:47:50 +0000 (12:47 +0100)
cmake/configure/configure_2_ginkgo.cmake [new file with mode: 0644]
cmake/modules/FindGINKGO.cmake [new file with mode: 0644]
include/deal.II/base/config.h.in
source/lac/CMakeLists.txt
tests/run_testsuite.cmake

diff --git a/cmake/configure/configure_2_ginkgo.cmake b/cmake/configure/configure_2_ginkgo.cmake
new file mode 100644 (file)
index 0000000..5b778ae
--- /dev/null
@@ -0,0 +1,39 @@
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2018 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE.md at
+## the top level directory of deal.II.
+##
+## ---------------------------------------------------------------------
+
+#
+# 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
new file mode 100644 (file)
index 0000000..d05c252
--- /dev/null
@@ -0,0 +1,72 @@
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2018 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE.md at
+## the top level directory of deal.II.
+##
+## ---------------------------------------------------------------------
+
+#
+# Try to find the GINKGO library
+#
+# This module exports
+#
+#   GINKGO_INCLUDE_DIRS
+#
+
+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
+  )
+
+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
+  CLEAR
+    GINKGO_INCLUDE_DIR 
+  )
index 7801a2397f442f89ad6879046c01ed80173c70ed..84e17b33843836ad4f595aef2809d3ca74a5afc6 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2012 - 2016 by the deal.II authors
+// Copyright (C) 2012 - 2018 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -43,6 +43,7 @@
 #cmakedefine DEAL_II_WITH_CUDA_AWARE_MPI
 #cmakedefine DEAL_II_WITH_CXX14
 #cmakedefine DEAL_II_WITH_CXX17
+#cmakedefine DEAL_II_WITH_GINKGO
 #cmakedefine DEAL_II_WITH_GSL
 #cmakedefine DEAL_II_WITH_GMSH
 #cmakedefine DEAL_II_WITH_HDF5
index 2cecfbc24f36c2479c4de31ea6ca7bbcd0e25721..a6ce60360fe800f43e20058fbea5b33e3a567aad 100644 (file)
@@ -112,6 +112,13 @@ IF(DEAL_II_WITH_SLEPC)
   )
 ENDIF()
 
+IF(DEAL_II_WITH_GINKGO)
+  SET(_unity_include_src
+    ${_unity_include_src}
+    ginkgo_solver.cc
+  )
+ENDIF()
+
 # Also add Trilinos wrapper files
 IF(DEAL_II_WITH_TRILINOS)
   SET(_unity_include_src
index 713c31b614c0eacc95ef7e64a5c7e63e1db94f7c..688ae9da65007398b46414aaecb10b1c453a37e6 100644 (file)
@@ -1,6 +1,6 @@
 ## ---------------------------------------------------------------------
 ##
-## Copyright (C) 2013 - 2016 by the deal.II authors
+## Copyright (C) 2013 - 2018 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -273,7 +273,7 @@ FOREACH(_var ${_variables})
   IF( _var MATCHES "^(TEST|DEAL_II|ALLOW|WITH|FORCE|COMPONENT)_" OR
       _var MATCHES "^(DOCUMENTATION|EXAMPLES)" OR
       _var MATCHES "^(ADOLC|ARPACK|BOOST|OPENCASCADE|MUPARSER|HDF5|METIS|MPI)_" OR
-      _var MATCHES "^(NETCDF|P4EST|PETSC|SCALAPACK|SLEPC|THREADS|TBB|TRILINOS)_" OR
+      _var MATCHES "^(GINKGO|NETCDF|P4EST|PETSC|SCALAPACK|SLEPC|THREADS|TBB|TRILINOS)_" OR
       _var MATCHES "^(UMFPACK|ZLIB|LAPACK|MUPARSER|CUDA)_" OR
       _var MATCHES "^(CMAKE|DEAL_II)_(C|CXX|Fortran|BUILD)_(COMPILER|FLAGS)" OR
       _var MATCHES "^CMAKE_BUILD_TYPE$" OR

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.