]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add support for MUMPS
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 4 Oct 2012 11:05:11 +0000 (11:05 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 4 Oct 2012 11:05:11 +0000 (11:05 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26942 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/configure/configure_mumps.cmake [new file with mode: 0644]
deal.II/cmake/modules/FindMUMPS.cmake [new file with mode: 0644]
deal.II/cmake/modules/FindP4EST.cmake
deal.II/cmake/modules/FindSCALAPACK.cmake [new file with mode: 0644]
deal.II/include/deal.II/base/config.h.in
deal.II/include/deal.II/base/config.h.in.old

diff --git a/deal.II/cmake/configure/configure_mumps.cmake b/deal.II/cmake/configure/configure_mumps.cmake
new file mode 100644 (file)
index 0000000..4fd8fd7
--- /dev/null
@@ -0,0 +1,48 @@
+#####
+##
+## Copyright (C) 2012 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## <TODO: Full License information>
+## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
+## version of the LGPL license.
+##
+## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
+##
+#####
+
+#
+# Configuration for the MUMPS library:
+#
+
+OPTION(DEAL_II_WITH_MUMPS
+  "Build deal.II with support for MUMPS."
+  OFF)
+
+SET(FEATURE_MUMPS_DEPENDS DEAL_II_WITH_MPI)
+
+
+MACRO(FEATURE_MUMPS_FIND_EXTERNAL var)
+  FIND_PACKAGE(MUMPS)
+
+  IF(MUMPS_FOUND)
+    SET(${var} TRUE)
+  ENDIF()
+ENDMACRO()
+
+
+MACRO(FEATURE_MUMPS_CONFIGURE_EXTERNAL var)
+
+  INCLUDE_DIRECTORIES(${MUMPS_INCLUDE_DIRS})
+  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${MUMPS_LIBRARIES})
+  ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${MUMPS_LINKER_FLAGS}")
+
+  SET(DEAL_II_USE_MUMPS TRUE)
+
+  SET(${var} TRUE)
+ENDMACRO()
+
+
+CONFIGURE_FEATURE(MUMPS)
+
diff --git a/deal.II/cmake/modules/FindMUMPS.cmake b/deal.II/cmake/modules/FindMUMPS.cmake
new file mode 100644 (file)
index 0000000..c348f60
--- /dev/null
@@ -0,0 +1,83 @@
+#####
+##
+## Copyright (C) 2012 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## <TODO: Full License information>
+## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
+## version of the LGPL license.
+##
+## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
+##
+#####
+
+#
+# Try to find the MUMPS library
+#
+# This module exports
+#
+#   MUMPS_INCLUDE_DIRS
+#   MUMPS_LIBRARIES
+#   MUMPS_LINKER_FLAGS
+#
+
+SET_IF_EMPTY(MUMPS_DIR "$ENV{MUMPS_DIR}")
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+#
+# Search for all known dependencies of MUMPS:
+# (We'll rely on the user of FindMUMPS, setting up mpi *cough*)
+#
+FIND_PACKAGE(SCALAPACK) # which will also include lapack and blas
+
+#
+# TODO: libpord.a ?
+#
+
+FIND_PATH(MUMPS_INCLUDE_DIRS dmumps_c.h
+  HINTS
+    ${MUMPS_DIR}
+  PATH_SUFFIXES
+    mumps include/mumps include
+  )
+
+FIND_LIBRARY(DMUMPS_LIBRARY
+  NAMES dmumps
+  HINTS
+    ${MUMPS_DIR}
+  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+  )
+
+FIND_LIBRARY(MUMPS_COMMON_LIBRARY
+  NAMES mumps_common
+  HINTS
+    ${MUMPS_DIR}
+  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+  )
+
+SET(MUMPS_LIBRARIES
+  ${DMUMPS_LIBRARY}
+  ${MUMPS_COMMON_LIBRARY}
+  ${LAPACK_LIBRARIES}
+  )
+
+SET(MUMPS_LINKER_FLAGS
+  ${LAPACK_LINKER_FLAGS}
+  )
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(MUMPS DEFAULT_MSG
+  DMUMPS_LIBRARY
+  MUMPS_COMMON_LIBRARY
+  LAPACK_FOUND
+  )
+
+IF(MUMPS_FOUND)
+  MARK_AS_ADVANCED(
+    DMUMPS_LIBRARY
+    MUMPS_COMMON_LIBRARY
+    MUMPS_INCLUDE_DIRS
+  )
+ENDIF()
+
index 0596743a86cdf08cc5f273211daf92b3a0bfa4c3..b9fac0f009f25ef412a335dae9a0c07ee30731c9 100644 (file)
@@ -56,9 +56,9 @@ SET(P4EST_INCLUDE_DIRS
   )
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(P4EST DEFAULT_MSG
-  SC_FOUND
   P4EST_LIBRARY
   P4EST_INCLUDE_DIR
+  SC_FOUND
   )
 
 IF(P4EST_FOUND)
diff --git a/deal.II/cmake/modules/FindSCALAPACK.cmake b/deal.II/cmake/modules/FindSCALAPACK.cmake
new file mode 100644 (file)
index 0000000..0b16faf
--- /dev/null
@@ -0,0 +1,88 @@
+#####
+##
+## Copyright (C) 2012 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## <TODO: Full License information>
+## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
+## version of the LGPL license.
+##
+## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
+##
+#####
+
+#
+# Try to find the SCALAPACK library
+#
+# Used as a helper module for FindMUMPS.cmake
+#
+# This module exports
+#
+#   SCALAPACK_LIBRARIES
+#   SCALAPACK_LINKER_FLAGS
+#
+
+SET_IF_EMPTY(SCALAPCK_DIR "$ENV{SCALAPACK_DIR}")
+SET_IF_EMPTY(BLACS_DIR "$ENV{BLACS_DIR}")
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+#
+# SCALAPACK needs LAPACK and BLAS as dependency, search for them with the help
+# of the LAPACK find module:
+#
+# TODO: SCALAPACK and mpi...
+#
+FIND_PACKAGE(LAPACK)
+
+FIND_LIBRARY(SCALAPACK_LIBRARY
+  NAMES scalapack
+  HINTS
+    ${SCALAPACK_DIR}
+  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+)
+
+SET(SCALAPACK_LIBRARIES
+  ${SCALAPACK_LIBRARY}
+  ${LAPACK_LIBRARIES}
+  )
+
+SET(SCALAPACK_LINKER_FLAGS
+  ${LAPACK_LINKER_FLAGS}
+  )
+
+#
+# Well, depending on the version of scalapack and the distribution it might
+# be necessary to search for blacs, too. So we do this in a very
+# probabilistic way...
+#
+FIND_LIBRARY(BLACS_LIBRARY
+  NAMES blacs
+    ${BLACS_DIR}
+    ${SCALAPACK_DIR}
+    ${SCALAPACK_DIR}/../blacs/
+  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+)
+
+IF(NOT BLACS_LIBRARY MATCHES "-NOTFOUND")
+  LIST(APPEND SCLAPACK_LIBRARIES
+    ${BLACS_LIBRARY}
+    )
+ENDIF()
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCALAPACK DEFAULT_MSG
+  SCALAPACK_LIBRARY
+  LAPACK_FOUND
+  )
+
+IF(SCALAPACK_FOUND)
+  MARK_AS_ADVANCED(
+    lapack_LIBRARY
+    atlas_LIBRARY
+    blas_LIBRARY
+    SCALAPACK_LIBRARY
+    BLACS_LIBRARY
+  )
+ENDIF()
+
index 59c907f57c8cd1ad472bb70fd9717e1d956b9640..f9da08a7bc37e982369c6cde682b1556c7bd7d93 100644 (file)
 #cmakedefine DEAL_II_COMPILER_SUPPORTS_MPI
 
 
+/*****************************************
+ * Configured in configure_mumps.cmake: *
+ *****************************************/
+
+/* Defined if an MUMPS installation was found and is going to be used */
+#cmakedefine DEAL_II_USE_MUMPS
+
+
 /*****************************************
  * Configured in configure_netcdf.cmake: *
  *****************************************/
index a853c94766a99a5000073b5daf08413228e466f2..7aea871350acc2841d8a0a9e19fff08c7eb843dc 100644 (file)
@@ -109,9 +109,6 @@ BUGS:
    this bug. */
 #cmakedefine DEAL_II_TEMPL_SPEC_FRIEND_BUG
 
-/* Defined if a MUMPS installation was found and is going to be used */
-#cmakedefine DEAL_II_USE_MUMPS
-
 /* Defined if a SLEPc installation was found and is going to be used */
 #cmakedefine DEAL_II_USE_SLEPC
 

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.