]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Changes to the configure system to link the libraries of MUMPS, BLACS, and SCALAPACK...
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 7 May 2010 12:40:28 +0000 (12:40 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 7 May 2010 12:40:28 +0000 (12:40 +0000)
git-svn-id: https://svn.dealii.org/trunk@21091 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/base/include/base/config.h.in
deal.II/common/Make.global_options.in
deal.II/configure.in
deal.II/deal.II/Makefile
deal.II/lac/Makefile

index 773b5493a96a7356adc7164d087c3ac7b580a0d7..6d10cfb290ae7a541e2ea4a79d67812d07bce913 100644 (file)
@@ -5412,7 +5412,7 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC, dnl
   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
@@ -6153,6 +6153,119 @@ AC_DEFUN(DEAL_II_CHECK_TRILINOS_HEADER_FILES, dnl
 ])
 
 
+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
index 0fb95fd907cad2ad95896f9b190fb601db16af93..c5bb06ecc9b55f2ada78358aee637816c38b7443 100644 (file)
 /* 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 + \
index 7ff04c54e1a122f2b19e9598539999d3bc2b346a..f8b43139ffc4a3efb8f956116a4c325e10d535a6 100644 (file)
@@ -65,8 +65,14 @@ DEAL_II_TRILINOS_LIBDIR = @DEAL_II_TRILINOS_LIBDIR@
 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@
@@ -206,6 +212,18 @@ ifeq ($(USE_CONTRIB_TRILINOS),yes)
   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)
@@ -219,7 +237,6 @@ ifeq ($(enable-threads),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) \
@@ -230,11 +247,15 @@ lib-base.g     = $(LIBDIR)/libbase.g$(lib-suffix) \
 
 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)
@@ -258,6 +279,7 @@ endif
 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
@@ -273,7 +295,7 @@ INCLUDE = -I$D/base/include -I$D/lac/include -I$D/deal.II/include \
 # (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
@@ -290,6 +312,10 @@ ifeq ($(USE_CONTRIB_TRILINOS),yes)
   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
index 3fc9e56b62b1a1be30f26379e649954308ba7b4b..f34464ffaa1e73a2c6ece1ec06864c4705d4ec30 100644 (file)
@@ -403,7 +403,6 @@ dnl -------------------------------------------------------------
 AC_MSG_RESULT()
 AC_MSG_RESULT(---------------- configuring additional libs ----------------)
 
-
 DEAL_II_CONFIGURE_PETSC
 AC_SUBST(USE_CONTRIB_PETSC)
 AC_SUBST(DEAL_II_PETSC_DIR)
@@ -429,6 +428,13 @@ AC_SUBST(DEAL_II_TRILINOS_LIBDIR)
 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
index b1010a6a221b1980f94ab5d79a799d0c5366e0a4..bf01fcb5e185af16565dfd03d1912c30426fd794 100644 (file)
@@ -105,6 +105,12 @@ ifneq ($(GXX-VERSION),compaq_cxx)
     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)
index e2b7fdabfa3c967ae52a19b541a312d00a80438a..a82c9e6a115f7a5345b383207c7378e3b6ad9cc3 100644 (file)
@@ -79,6 +79,12 @@ ifneq ($(GXX-VERSION),compaq_cxx)
     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)

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.