]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Complete metis support
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 16 Sep 2012 20:09:26 +0000 (20:09 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 16 Sep 2012 20:09:26 +0000 (20:09 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26421 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/contrib/cmake/configure/configure_metis.cmake
deal.II/contrib/cmake/modules/FindMETIS.cmake
deal.II/features.m4

index f749799032cef78824df381540d0818bca234a84..c7f8e24177346fd5e097b06888b518681dad6624 100644 (file)
@@ -6,8 +6,13 @@ MACRO(FIND_FEATURE_METIS_EXTERNAL var)
 
   FIND_PACKAGE(METIS)
 
-  IF(METIS_FOUND)
+  IF(METIS_FOUND AND METIS_MAJOR GREATER 4)
     SET(${var} TRUE)
+  ELSE()
+    MESSAGE(STATUS
+      "Could not find a sufficient modern metis installation: Version 5.x
+      required."
+      )
   ENDIF()
 
 ENDMACRO()
@@ -29,7 +34,7 @@ MACRO(CONFIGURE_FEATURE_METIS_ERROR_MESSAGE)
   MESSAGE(SEND_ERROR "
 Could not find the metis library!
 
-Please ensure that the metis library is installed on your computer.
+Please ensure that the metis version 5.x is installed on your computer.
 If the library is not at a default location, either provide some hints
 via environment variables:
 METIS_LIBRARY_DIR METIS_INCLUDE_DIR
index fec10fad51d43481864cf560f272c4a4ac8bf1de..1ea0c7d7822c2bb65a3633b8f39aabc80e3fb0d6 100644 (file)
@@ -15,6 +15,19 @@ FIND_LIBRARY(METIS_LIBRARY
   PATH_SUFFIXES lib64 lib
 )
 
+#
+# Extract the version number out of metis.h
+#
+
+FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" METIS_MAJOR_STRING
+  REGEX "METIS_VER_MAJOR")
+STRING(REGEX REPLACE "^.*METIS_VER_MAJOR.* ([0-9]+).*" "\\1" METIS_MAJOR "${METIS_MAJOR_STRING}")
+
+FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" METIS_MINOR_STRING
+  REGEX "METIS_VER_MINOR")
+STRING(REGEX REPLACE "^.*METIS_VER_MINOR.* ([0-9]+).*" "\\1" METIS_MINOR "${METIS_MINOR_STRING}")
+
+
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(METIS DEFAULT_MSG METIS_LIBRARY METIS_INCLUDE_DIR)
 
 IF(METIS_FOUND)
index 45c81c8ef0b7f0b1cc118ab64163c266bec8f50a..fae309429b75f2f8aeb2c1f7d3b9be94e86b1426 100644 (file)
@@ -1352,94 +1352,6 @@ AC_DEFUN(DEAL_II_CONFIGURE_ARPACK, dnl
 ])
 
 
-dnl ------------------------------------------------------------
-dnl Check whether Metis is installed, and if so store the
-dnl respective links
-dnl
-dnl Usage: DEAL_II_CONFIGURE_METIS
-dnl
-dnl ------------------------------------------------------------
-AC_DEFUN(DEAL_II_CONFIGURE_METIS, dnl
-[
-  dnl First check for the Metis directory
-
-  AC_ARG_WITH(metis,
-              [AS_HELP_STRING([--with-metis=/path/to/metis],
-              [Specify the path to the Metis installation, of which the include and library directories are subdirs; use this if you want to override the METIS_DIR environment variable.])],
-     [
-        AC_MSG_CHECKING([for METIS library directory])
-        USE_CONTRIB_METIS=yes
-        DEAL_II_METIS_DIR="$withval"
-        AC_MSG_RESULT($DEAL_II_METIS_DIR)
-
-        dnl Make sure that what was specified is actually correct. The
-        dnl libraries could be in either $DEAL_II_METIS_DIR/lib (metis was
-        dnl make installed) or $DEAL_II_METIS_DIR/libmetis (metis was make
-        dnl only and PETSc).
-        if test ! -d $DEAL_II_METIS_DIR/lib \
-           && test ! -d $DEAL_II_METIS_DIR/libmetis ; then
-          AC_MSG_ERROR([Path to Metis specified with --with-metis does not point to a complete Metis installation])
-        fi
-
-        dnl If lib is not found, we must have libraries in libmetis
-        dnl (which was found above).
-        if test -d $DEAL_II_METIS_DIR/lib ; then
-          DEAL_II_METIS_LIBDIR="$DEAL_II_METIS_DIR/lib"
-        else
-          DEAL_II_METIS_LIBDIR="$DEAL_II_METIS_DIR/libmetis"
-        fi
-
-        if test ! -d $DEAL_II_METIS_DIR/include ; then
-          AC_MSG_ERROR([Path to Metis specified with --with-metis does not point to a complete Metis installation])
-        fi
-
-        DEAL_II_METIS_INCDIR="$DEAL_II_METIS_DIR/include"
-     ],
-     [
-        dnl Take something from the environment variables, if it is there
-        if test "x$METIS_DIR" != "x" ; then
-          AC_MSG_CHECKING([for METIS from the environment])
-          USE_CONTRIB_METIS=yes
-          DEAL_II_METIS_DIR="$METIS_DIR"
-          AC_MSG_RESULT($DEAL_II_METIS_DIR)
-
-          dnl Make sure that what this is actually correct (see notes above).
-          if test ! -d $DEAL_II_METIS_DIR/lib \
-             && test ! -d $DEAL_II_METIS_DIR/libmetis ; then
-            AC_MSG_ERROR([The path to Metis specified in the METIS_DIR environment variable does not point to a complete Metis installation])
-          fi
-
-          if test -d $DEAL_II_METIS_DIR/lib ; then
-            DEAL_II_METIS_LIBDIR="$DEAL_II_METIS_DIR/lib"
-          else
-            DEAL_II_METIS_LIBDIR="$DEAL_II_METIS_DIR/libmetis"
-          fi
-
-          DEAL_II_METIS_INCDIR="$DEAL_II_METIS_DIR/include"
-
-        else
-          USE_CONTRIB_METIS=no
-          DEAL_II_METIS_DIR=""
-        fi
-     ])
-
-  if test "x$USE_CONTRIB_METIS" = "xyes" ; then
-    AC_DEFINE(DEAL_II_USE_METIS, 1,
-              [Defined if a Metis installation was found and is going
-               to be used])
-    LDFLAGS="$LDFLAGS -L$DEAL_II_METIS_LIBDIR -lmetis"
-
-    if test "x$DEAL_II_LD_UNDERSTANDS_RPATH" = "xyes" ; then
-      LDFLAGS="$LDFLAGS $LD_PATH_OPTION$DEAL_II_METIS_LIBDIR"
-    fi
-
-    dnl AC_MSG_CHECKING(for Metis version)
-    dnl DEAL_II_METIS_VERSION=`cat $DEAL_II_METIS_DIR/VERSION`
-    dnl AC_MSG_RESULT($DEAL_II_METIS_VERSION)
-  fi
-])
-
-
 dnl ------------------------------------------------------------
 dnl Check whether P4EST is to be used to parallelize meshes
 dnl

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.