AC_MSG_CHECKING([for PETSc library directory])
AC_ARG_WITH(petsc,
- [AS_HELP_STRING([--with-petsc=path/to/slepc],
+ [AS_HELP_STRING([--with-petsc=path/to/petsc],
[Specify the path to the PETSc installation, of which the include and library directories are subdirs; use this if you want to override the PETSC_DIR environment variable.])],
[
dnl Special case when someone does --with-petsc=no
])
+dnl ------------------------------------------------------------
+dnl Check whether MUMPS is installed; and, if so, then check for
+dnl two known dependecies, namely, SCALAPACK and BLACS.
+dnl
+dnl Usage: DEAL_II_CONFIGURE_MUMPS
+dnl
+dnl ------------------------------------------------------------
+AC_DEFUN(DEAL_II_CONFIGURE_MUMPS, dnl
+[
+ AC_MSG_CHECKING([for MUMPS library directory])
+ AC_ARG_WITH(mumps,
+ [AS_HELP_STRING([--with-mumps=path/to/mumps],
+ [Specify the path to the MUMPS installation, for which the include directory and lib directory are subdirs; use this if you want to override the MUMPS_DIR environment variable.])],
+ [dnl action-if-given
+ if test "x$withval" = "xno" ; then
+ AC_MSG_RESULT([explicitly disabled])
+ USE_CONTRIB_MUMPS=no
+ else
+ USE_CONTRIB_MUMPS=yes
+ DEAL_II_MUMPS_DIR="$withval"
+ AC_MSG_RESULT($DEAL_II_MUMPS_DIR)
+ dnl Make sure that what was specified is actually correct
+ if test ! -d $DEAL_II_MUMPS_DIR \
+ -o ! -d $DEAL_II_MUMPS_DIR/include \
+ -o ! -d $DEAL_II_MUMPS_DIR/lib \
+ ; then
+ AC_MSG_ERROR([Path to MUMPS specified with --with-mumps does not point to a complete MUMPS installation])
+ fi
+ fi
+ ],
+ [dnl action-if-not-given (do nothing)
+ USE_CONTRIB_MUMPS=no
+ ])
+
+ dnl ------------------------------------------------------------
+ dnl If MUMPS was requested and found, we had better check for
+ dnl dependencies right here. First, SCALAPACK and then BLACS.
+ if test "$USE_CONTRIB_MUMPS" = "yes" ; then
+
+ dnl ------------------------------------------------------------
+ dnl Check whether SCALAPACK is installed
+ AC_MSG_CHECKING([for SCALAPACK library directory])
+ AC_ARG_WITH(scalapack,
+ [AS_HELP_STRING([--with-scalapack=path/to/scalapack],
+ [Specify the path to the scalapack installation; use this if you want to override the SCALAPACK_DIR environment variable.])],
+ [dnl action-if-given (test)
+ DEAL_II_SCALAPACK_DIR="$withval"
+ AC_MSG_RESULT($DEAL_II_SCALAPACK_DIR)
+ dnl Make sure that what was specified is actually correct
+ if test ! -d $DEAL_II_SCALAPCK_DIR ; then
+ AC_MSG_ERROR([The path to SCALAPACK specified with --with-scalapack does t point to a complete SCALAPACK installation])
+ fi
+ ],
+ [dnl action-if-not-given (bail out)
+ AC_MSG_ERROR([If MUMPS is used, the path to SCALAPACK must be specified with --with-scalapack])
+ ])
+ dnl ------------------------------------------------------------
+
+ dnl ------------------------------------------------------------
+ dnl Check whether BLACS is installed and BLAS architecture type
+ AC_MSG_CHECKING([for BLACS library directory])
+ AC_ARG_WITH(blacs,
+ [AS_HELP_STRING([--with-blacs=path/to/blacs],
+ [Specify the path to the BLACS installation; use this if you want to override the BLACS_DIR environment variable.])],
+ [dnl action-if-given
+ DEAL_II_BLACS_DIR="$withval"
+ AC_MSG_RESULT($DEAL_II_BLACS_DIR)
+ dnl Make sure that what was specified is actually correct
+ if test ! -d $DEAL_II_BLACS_DIR \
+ -o ! -d $DEAL_II_BLACS_DIR/LIB ; then
+ AC_MSG_ERROR([The path to BLACS specified with --with-blacs does not point to a complete BLACS installation])
+ fi
+ ],
+ [dnl action-if-not-given (bail out)
+ AC_MSG_ERROR([If MUMPS is used, the path to BLACS must be specified with --with-blacs])
+ ])
+
+ dnl BLACS labels libraries with "communications library",
+ dnl "platform type" and "debug level" (see BlACS Bmake.inc for
+ dnl details of the meaning of these terms). Finally, determine what
+ dnl these are:
+ AC_MSG_CHECKING([for BLACS library architecture])
+ BLACS_COMM=`cat $DEAL_II_BLACS_DIR/Bmake.inc \
+ | grep "COMMLIB = " \
+ | perl -pi -e 's/.*LIB =\s+//g;'`
+ BLACS_PLAT=`cat $DEAL_II_BLACS_DIR/Bmake.inc \
+ | grep "PLAT = " \
+ | perl -pi -e 's/.*PLAT =\s+//g;'`
+ BLACS_DEBUG=`cat $DEAL_II_BLACS_DIR/Bmake.inc \
+ | grep "BLACSDBGLVL = " \
+ | perl -pi -e 's/.*DBGLVL =\s+//g;'`
+ dnl and patch that together to make the BLACS architecture type:
+ DEAL_II_BLACS_ARCH="$BLACS_COMM-$BLACS_PLAT-$BLACS_DEBUG"
+ AC_MSG_RESULT($DEAL_II_BLACS_ARCH)
+ dnl ------------------------------------------------------------
+
+ fi
+ dnl End check for MUMPS dependencies
+ dnl ------------------------------------------------------------
+
+ dnl If we do get this far then define a macro that says so:
+ if test "$USE_CONTRIB_MUMPS" = "yes" ; then
+ AC_DEFINE([DEAL_II_USE_MUMPS], [1],
+ [Defined if a MUMPS installation was found and is going to be used ])
+ dnl and set an additional variable:
+ DEAL_II_DEFINE_DEAL_II_USE_MUMPS=DEAL_II_USE_MUMPS
+ dnl and finally set with_mumps if this hasn't happened yet:
+ if test "x$with_mumps" = "x" ; then
+ with_mumps="yes"
+ fi
+ fi
+])
+
dnl ------------------------------------------------------------
dnl Check whether Metis is installed, and if so store the
/* Defined if a Trilinos installation was found and is going to be used */
#undef DEAL_II_USE_TRILINOS
+/* Defined if a MUMPS installation was found and is going to be used */
+#undef DEAL_II_USE_MUMPS
+
/* Define if vector iterators are just plain pointers */
#undef DEAL_II_VECTOR_ITERATOR_IS_POINTER
* compatibility; and (ii) DEAL_II_PETSC_VERSION_GTE is used to add
* functionality to the PETScWrappers that does not exist in previous
* versions of PETSc. Examples of usage can be found in
- * lac/source/petsc_matrix_base.h. Note: SLEPcWrappers do not need
- * their own anological macros, since SLEPc and PETSc must have
- * identical version numbers anyways.
+ * lac/source/petsc_matrix_base.h.
+ *
+ * Note: SLEPcWrappers do not need their own anological macros, since
+ * SLEPc and PETSc must have identical version numbers anyways.
*/
#define DEAL_II_PETSC_VERSION_LT(major,minor,subminor) \
((PETSC_VERSION_MAJOR * 10000 + \
DEAL_II_TRILINOS_SHARED = @DEAL_II_TRILINOS_SHARED@
DEAL_II_TRILINOS_STATIC = @DEAL_II_TRILINOS_STATIC@
+USE_CONTRIB_MUMPS = @USE_CONTRIB_MUMPS@
+DEAL_II_MUMPS_DIR = @DEAL_II_MUMPS_DIR@
+DEAL_II_SCALAPACK_DIR = @DEAL_II_SCALAPACK_DIR@
+DEAL_II_BLACS_DIR = @DEAL_II_BLACS_DIR@
+DEAL_II_BLACS_ARCH = @DEAL_II_BLACS_ARCH@
+
USE_CONTRIB_METIS = @USE_CONTRIB_METIS@
-DEAL_II_METIS_LIBDIR = @DEAL_II_METIS_LIBDIR@
+DEAL_II_METIS_LIBDIR = @DEAL_II_METIS_LIBDIR@
USE_CONTRIB_HSL = @USE_CONTRIB_HSL@
USE_CONTRIB_UMFPACK = @USE_CONTRIB_UMFPACK@
endif
endif
+# Using dealii with MUMPS means we need to link the MUMPS library as
+# well as its dependencies, ie, SCALAPCK and BLACS
+ifeq ($(USE_CONTRIB_MUMPS),yes)
+ lib-contrib-mumps = $(DEAL_II_MUMPS_DIR)/lib/libdmumps.a \
+ $(DEAL_II_MUMPS_DIR)/lib/libmumps_common.a \
+ $(DEAL_II_MUMPS_DIR)/lib/libpord.a
+ lib-contrib-mumps += $(DEAL_II_SCALAPACK_DIR)/libscalapack.a
+ lib-contrib-mumps += $(DEAL_II_BLACS_DIR)/LIB/blacsCinit_$(DEAL_II_BLACS_ARCH).a \
+ $(DEAL_II_BLACS_DIR)/LIB/blacsF77init_$(DEAL_II_BLACS_ARCH).a \
+ $(DEAL_II_BLACS_DIR)/LIB/blacs_$(DEAL_II_BLACS_ARCH).a
+endif
+
# deal with HSL; this should have been $(lib-contrib-hsl) but for a long time we
# accidentally had $(lib-hsl) -- so we simply make both symbols available
ifeq ($(USE_CONTRIB_HSL),yes)
lib-contrib-tbb.o = $D/lib/libtbb$(shared-lib-suffix)
endif
-
# set paths to all the libraries we need:
lib-base.o = $(LIBDIR)/libbase$(lib-suffix) \
$(lib-contrib-trilinos) \
lib-lac.o = $(LIBDIR)/liblac$(lib-suffix) \
$(lib-hsl) \
- $(lib-contrib-petsc.o) $(lib-contrib-slepc) $(DEAL_II_PETSC_MPIUNI_LIB) \
+ $(lib-contrib-petsc.o) $(DEAL_II_PETSC_MPIUNI_LIB) \
+ $(lib-contrib-slepc) \
+ $(lib-contrib-mumps) \
$(lib-contrib-metis)
lib-lac.g = $(LIBDIR)/liblac.g$(lib-suffix) \
$(lib-hsl) \
- $(lib-contrib-petsc.g) $(lib-contrib-slepc) $(DEAL_II_PETSC_MPIUNI_LIB) \
+ $(lib-contrib-petsc.g) $(DEAL_II_PETSC_MPIUNI_LIB) \
+ $(lib-contrib-slepc) \
+ $(lib-contrib-mumps) \
$(lib-contrib-metis)
lib-deal2-1d.o = $(LIBDIR)/libdeal_II_1d$(lib-suffix)
include-path-slepc = $(DEAL_II_SLEPC_DIR)/include
include-path-slepc-conf = $(DEAL_II_SLEPC_DIR)/$(DEAL_II_PETSC_ARCH)/conf
include-path-trilinos = $(DEAL_II_TRILINOS_INCDIR)
+include-path-mumps = $(DEAL_II_MUMPS_DIR)/include
# include paths as command line flags. while compilers allow a space between
# the '-I' and the actual path, we also send these flags to the
# (and thus import all of its variables), but rather set up a scheme to
# extract these values upon configuration
#
-# note also that this only works for PETSc before 2.3 :-]
+# also, note that this only works for PETSc before 2.3 :-]
ifeq ($(USE_CONTRIB_PETSC),yes)
ifeq ($(DEAL_II_PETSC_VERSION_MINOR),2)
include $(DEAL_II_PETSC_DIR)/bmake/$(DEAL_II_PETSC_ARCH)/packages
INCLUDE += -I$(include-path-trilinos)
endif
+ifeq ($(USE_CONTRIB_MUMPS),yes)
+ INCLUDE += -I$(include-path-mumps)
+endif
+
ifeq ($(enable-threads),yes)
INCLUDE += -I$(shell echo $D/contrib/tbb/tbb*/include)
endif
AC_MSG_RESULT()
AC_MSG_RESULT(---------------- configuring additional libs ----------------)
-
DEAL_II_CONFIGURE_PETSC
AC_SUBST(USE_CONTRIB_PETSC)
AC_SUBST(DEAL_II_PETSC_DIR)
AC_SUBST(DEAL_II_TRILINOS_SHARED)
AC_SUBST(DEAL_II_TRILINOS_STATIC)
+DEAL_II_CONFIGURE_MUMPS
+AC_SUBST(USE_CONTRIB_MUMPS)
+AC_SUBST(DEAL_II_MUMPS_DIR)
+AC_SUBST(DEAL_II_SCALAPACK_DIR) dnl MUMPS dependency
+AC_SUBST(DEAL_II_BLACS_DIR) dnl MUMPS dependency
+AC_SUBST(DEAL_II_BLACS_ARCH)
+AC_SUBST(DEAL_II_DEFINE_DEAL_II_USE_MUMPS)
dnl Make sure we configure for libraries used by other libraries. For
dnl example, UMFPACK needs blas, and so does LAPACK
deplibs.o += $(lib-contrib-slepc)
endif
+ # same with MUMPS
+ ifeq ($(USE_CONTRIB_MUMPS),yes)
+ deplibs.g += $(lib-contrib-mumps)
+ deplibs.o += $(lib-contrib-mumps)
+ endif
+
# and METIS
ifeq ($(USE_CONTRIB_METIS),yes)
deplibs.g += $(lib-contrib-metis)
deplibs.o += $(lib-contrib-trilinos)
endif
+ # same with MUMPS
+ ifeq ($(USE_CONTRIB_MUMPS),yes)
+ deplibs.g += $(lib-contrib-mumps)
+ deplibs.o += $(lib-contrib-mumps)
+ endif
+
# and METIS
ifeq ($(USE_CONTRIB_METIS),yes)
deplibs.g += $(lib-contrib-metis)