]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add support for arpack
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Sep 2012 21:34:17 +0000 (21:34 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Sep 2012 21:34:17 +0000 (21:34 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26455 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/CMakeLists.txt
deal.II/contrib/cmake/configure/configure_arpack.cmake [new file with mode: 0644]
deal.II/contrib/cmake/modules/FindARPACK.cmake [new file with mode: 0644]
deal.II/features.m4
deal.II/include/deal.II/base/config.h.in
deal.II/include/deal.II/base/config.h.in.old

index cd7ed19fc701b94874614e486dce4d42720049b9..5ba9d52f168e60d7ea78700231b9a40eea2d275e 100644 (file)
@@ -95,6 +95,10 @@ OPTION(DEAL_II_ALLOW_CONTRIB
   OFF"
   OFF)
 
+OPTION(DEAL_II_WITH_ARPACK
+  "Build deal.II with support for ARPACK."
+  ON)
+
 OPTION(DEAL_II_WITH_BLAS
   "Build deal.II with support for BLAS."
   OFF)
@@ -248,29 +252,22 @@ ENDFOREACH()
 # Feature configuration:
 #
 
+#
+# TODO: Resolve this boost dependency so that we can automatically include
+# configure_[...] files
+#
+INCLUDE(configure_arpack)
 INCLUDE(configure_blas)
 INCLUDE(configure_lapack)
-
-# configure_boost depends on configure_blas and configure_lapack
-INCLUDE(configure_umfpack)
-
 INCLUDE(configure_functionparser)
-
 INCLUDE(configure_metis)
-
 INCLUDE(configure_mpi)
-
 INCLUDE(configure_netcdf)
-
 INCLUDE(configure_p4est)
-
 INCLUDE(configure_tbb)
-
+INCLUDE(configure_boost) # depends on variables defined in configure_tbb
 INCLUDE(configure_trilinos)
-
-# configure_boost depends on configure_tbb
-INCLUDE(configure_boost)
-
+INCLUDE(configure_umfpack)
 INCLUDE(configure_zlib)
 
 
diff --git a/deal.II/contrib/cmake/configure/configure_arpack.cmake b/deal.II/contrib/cmake/configure/configure_arpack.cmake
new file mode 100644 (file)
index 0000000..04abc3a
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Configuration for the ARPACK library:
+#
+
+MACRO(FEATURE_ARPACK_FIND_EXTERNAL var)
+
+  FIND_PACKAGE(ARPACK)
+
+  IF(ARPACK_FOUND)
+    SET(${var} TRUE)
+  ENDIF()
+
+ENDMACRO()
+
+
+MACRO(FEATURE_ARPACK_CONFIGURE_EXTERNAL var)
+
+  INCLUDE_DIRECTORIES(${ARPACK_INCLUDE_DIR})
+  LIST(APPEND deal_ii_external_libraries ${ARPACK_LIBRARY})
+
+  SET(DEAL_II_USE_ARPACK TRUE)
+
+  SET(${var} TRUE)
+ENDMACRO()
+
+
+CONFIGURE_FEATURE(ARPACK)
diff --git a/deal.II/contrib/cmake/modules/FindARPACK.cmake b/deal.II/contrib/cmake/modules/FindARPACK.cmake
new file mode 100644 (file)
index 0000000..6479e4c
--- /dev/null
@@ -0,0 +1,16 @@
+# Try to find ARPACK
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+FIND_LIBRARY(ARPACK_LIBRARY
+  NAMES arpack
+  PATH_SUFFIXES lib64 lib
+)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ARPACK DEFAULT_MSG ARPACK_LIBRARY)
+
+IF(ARPACK_FOUND)
+  MARK_AS_ADVANCED(
+    ARPACK_LIBRARY
+  )
+ENDIF()
index fc558ae826d762123bbf9f1ddd4e8893e452d978..dc0048acacf272d76d386a9d611f16ddcb23c7ff 100644 (file)
@@ -693,51 +693,3 @@ AC_DEFUN(DEAL_II_CONFIGURE_MUMPS, dnl
     fi
   fi
 ])
-
-dnl ------------------------------------------------------------
-dnl Check whether ARPACK is installed, and if so store the
-dnl respective links
-dnl
-dnl Usage: DEAL_II_CONFIGURE_ARPACK
-dnl
-dnl ------------------------------------------------------------
-AC_DEFUN(DEAL_II_CONFIGURE_ARPACK, dnl
-[
-  AC_MSG_CHECKING([for ARPACK library directory])
-  AC_ARG_WITH(arpack,
-    [AS_HELP_STRING([--with-arpack=path/to/arpack],
-    [Specify the path to the ARPACK installation, for which the include directory and lib directory are subdirs; use this if you want to override the ARPACK_DIR environment variable.])],
-    [dnl action-if-given
-     if test "x$withval" = "xno" ; then
-       AC_MSG_RESULT([explicitly disabled])
-       USE_CONTRIB_ARPACK=no
-     else
-       DEAL_II_ARPACK_DIR="$withval"
-       AC_MSG_RESULT($DEAL_II_ARPACK_DIR)
-       dnl Make sure that what was specified is actually correct
-       if test ! -d $DEAL_II_ARPACK_DIR \
-          ; then
-         AC_MSG_ERROR([Path to ARPACK specified with --with-arpack does not point to a complete ARPACK installation])
-       fi
-
-       dnl ------------------------------------------------------------
-       dnl Grab a meaningful name of the architeture ARPACK was
-       dnl compiled for
-       AC_MSG_CHECKING([for ARPACK library architecture])
-       ARPACK_ARCH=`cat $DEAL_II_ARPACK_DIR/ARmake.inc \
-                 | grep "PLAT = " \
-                 | perl -pi -e 's/.*PLAT =\s+//g;'`
-       DEAL_II_ARPACK_ARCH="$ARPACK_ARCH"
-       AC_MSG_RESULT($DEAL_II_ARPACK_ARCH)
-
-       USE_CONTRIB_ARPACK=yes
-       AC_DEFINE(DEAL_II_USE_ARPACK, 1,
-                 [Defined if an ARPACK installation was found and is
-                  going to be used])
-     fi
-    ],
-    [dnl action-if-not-given (do nothing)
-     USE_CONTRIB_ARPACK=no
-     AC_MSG_RESULT([no])
-    ])
-])
index a81b8b611e355cea66355ea275ae7a0b045d06d8..da8ea1512b1738997b235ec57a50e26e3e590ba6 100644 (file)
 
 
 
+
+/*****************************************
+ * Configured in configure_arpack.cmake: *
+ *****************************************/
+
+/* Defined if an ARPACK installation was found and is going to be used */
+#cmakedefine DEAL_II_USE_ARPACK
+
+
 /***************************************
  * Configured in configure_blas.cmake: *
  ***************************************/
index b381758f2257aed84b981d383048e81369252415..ead5e6739a6e71c1ed244aabfef664c605f7c539 100644 (file)
    this bug. */
 #cmakedefine DEAL_II_TEMPL_SPEC_FRIEND_BUG
 
-/* Defined if an ARPACK installation was found and is going to be used */
-#cmakedefine DEAL_II_USE_ARPACK
-
 /* Defined if a MUMPS installation was found and is going to be used */
 #cmakedefine DEAL_II_USE_MUMPS
 

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.