]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Redirection of the slepc-arch detection in the deal.II configure system: slepc-arch...
authorToby D. Young <tyoung@ippt.pan.pl>
Mon, 22 Jun 2009 05:18:47 +0000 (05:18 +0000)
committerToby D. Young <tyoung@ippt.pan.pl>
Mon, 22 Jun 2009 05:18:47 +0000 (05:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@18943 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/common/Make.global_options.in
deal.II/configure.in

index 701baaae1943e5a4bf6a670bc6b4e14f5017d19e..703af127254df17c110b97cd51b8773dc6dea8b5 100644 (file)
@@ -497,7 +497,7 @@ AC_DEFUN(DEAL_II_SET_CXX_FLAGS, dnl
   dnl First the flags for gcc compilers
   if test "$GXX" = yes ; then
     CXXFLAGSO="$CXXFLAGS -O2 -Wuninitialized -felide-constructors -ftemplate-depth-128"
-    CXXFLAGSG="$CXXFLAGS -DDEBUG -pedantic -Wall -W -Wpointer-arith -Wwrite-strings -Woverloaded-virtual -Wsign-compare -Wswitch -ftemplate-depth-128"
+    CXXFLAGSG="$CXXFLAGS -DDEBUG -pedantic -Wall -W -Wpointer-arith -Wwrite-strings -Woverloaded-virtual -Wsynth -Wsign-compare -Wswitch -ftemplate-depth-128"
 
     dnl BOOST uses long long, so don't warn about this
     CXXFLAGSG="$CXXFLAGSG -Wno-long-long"
@@ -4327,6 +4327,50 @@ AC_DEFUN(DEAL_II_CHECK_TYPE_QUALIFIER_BUG, dnl
 
 
 
+dnl -------------------------------------------------------------
+dnl In the gcc libstdc++ headers for std::complex, there is 
+dnl no defined default copy constructor, but a templated copy 
+dnl constructor. So when using using a normal assignment 
+dnl between identical types, the compiler synthesizes the 
+dnl default operator, rather than using the template. 
+dnl The code will still be ok, though.
+dnl
+dnl With -Wsynth in gcc we then get a warning. So if we find that
+dnl this is still the case, disable -Wsynth, i.e. remove it from
+dnl the list of warning flags.
+dnl
+dnl This is gcc bug 18644:
+dnl   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18644
+dnl
+dnl Usage: DEAL_II_CHECK_WSYNTH_AND_STD_COMPLEX
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_WSYNTH_AND_STD_COMPLEX, dnl
+[
+  if test "x$GXX" = "xyes" ; then
+    AC_MSG_CHECKING(for problem with -Wsynth and std::complex)
+    AC_LANG(C++)
+    CXXFLAGS="-Wsynth -Werror"
+    AC_TRY_COMPILE(
+      [
+#       include <complex>
+      ],
+      [
+       std::complex<double> x;
+       x = std::complex<double>(1,0);
+      ],
+      [
+        AC_MSG_RESULT(no)
+      ],
+      [
+        AC_MSG_RESULT(yes)
+       CXXFLAGSG="`echo $CXXFLAGSG | perl -pi -e 's/-Wsynth\s*//g;'`"
+      ])
+  fi
+])
+
+
+
 dnl -------------------------------------------------------------
 dnl Older gcc version appear to frown upon the way we write the
 dnl IsBlockMatrix<MatrixType> template. If that's the case,
@@ -4400,8 +4444,52 @@ AC_DEFUN(DEAL_II_CHECK_BOOST, dnl
     [AC_MSG_ERROR([Your boost installation is incomplete!])])
   AC_CHECK_HEADER(boost/tuple/tuple.hpp,,
     [AC_MSG_ERROR([Your boost installation is incomplete!])])
+  DEAL_II_CHECK_BOOST_SHARED_PTR_ASSIGNMENT
 ])
 
+dnl -------------------------------------------------------------
+dnl The boost::shared_ptr class has a templated assignment operator
+dnl but no assignment operator matching the default operator
+dnl signature (this if for boost 1.29 at least). So when using
+dnl using a normal assignment between identical types, the
+dnl compiler synthesizes teh default operator, rather than using
+dnl the template. It doesn't matter here, but is probably an
+dnl oversight on behalf of the operators. It should be fixed in newer
+dnl versions of boost.
+dnl
+dnl With -Wsynth in gcc we then get a warning. So if we find that
+dnl this is still the case, disable -Wsynth, i.e. remove it from
+dnl the list of warning flags.
+dnl
+dnl Usage: DEAL_II_CHECK_BOOST_SHARED_PTR_ASSIGNMENT
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_BOOST_SHARED_PTR_ASSIGNMENT, dnl
+[
+  if test "x$GXX" = "xyes" ; then
+    AC_MSG_CHECKING(for boost::shared_ptr assignment operator= template buglet)
+    AC_LANG(C++)
+    CXXFLAGS="-Wsynth -Werror"
+    AC_TRY_COMPILE(
+      [
+#       include <boost/shared_ptr.hpp>
+      ],
+      [
+        boost::shared_ptr<int> a,b;
+        a = b;
+      ],
+      [
+        AC_MSG_RESULT(no)
+      ],
+      [
+        AC_MSG_RESULT(yes)
+       CXXFLAGSG="`echo $CXXFLAGSG | perl -pi -e 's/-Wsynth\s*//g;'`"
+      ])
+  fi
+])
+
+
+
 dnl -------------------------------------------------------------
 dnl Some versions of icc on some platforms issue a lot of warnings
 dnl about the unreliability of floating point comparisons. Check 
@@ -5688,6 +5776,12 @@ AC_DEFUN(DEAL_II_CONFIGURE_SLEPC, dnl
             AC_MSG_ERROR([Path to SLEPc specified with --with-slepc does not
                          point to a complete SLEPc installation])
          fi
+
+         if test ! -d $DEAL_II_SLEPC_DIR/$DEAL_II_PETSC_ARCH \
+               -o ! -d $DEAL_II_SLEPC_DIR/$DEAL_II_PETSC_ARCH/lib \
+               ; then
+           AC_MSG_ERROR([SLEPc has not been compiled for the PETSc architecture])
+          fi
         fi
      ],
      [
@@ -5727,7 +5821,6 @@ AC_DEFUN(DEAL_II_CONFIGURE_SLEPC, dnl
   dnl If we have found SLEPc, determine additional pieces of data
   if test "$USE_CONTRIB_SLEPC" = "yes" \
        ; then
-    DEAL_II_CONFIGURE_SLEPC_ARCH
     DEAL_II_CONFIGURE_SLEPC_VERSION
 
     dnl Finally set with_slepc if this hasn't happened yet
@@ -5737,64 +5830,6 @@ AC_DEFUN(DEAL_II_CONFIGURE_SLEPC, dnl
   fi
 ])
 
-
-
-dnl ------------------------------------------------------------
-dnl Figure out the architecture used for SLEPc and if the 
-dnl library directory exists, since that determines where object
-dnl and configuration files will be found.
-dnl
-dnl Usage: DEAL_II_CONFIGURE_SLEPC_ARCH
-dnl
-dnl ------------------------------------------------------------
-AC_DEFUN(DEAL_II_CONFIGURE_SLEPC_ARCH, dnl
-[
-  AC_MSG_CHECKING(for SLEPc library architecture)
-
-  AC_ARG_WITH(slepc-arch,
-  [  --with-slepc-arch=architecture  
-                          Specify the architecture for your SLEPc installation;
-                          use this if you want to override the SLEPC_ARCH 
-                          environment variable.],
-     [
-        DEAL_II_SLEPC_ARCH="$withval"
-       AC_MSG_RESULT($DEAL_II_SLEPC_ARCH)
-     ],
-     [
-        dnl Take something from the environment variables, if it is there
-        if test "x$SLEPC_ARCH" != "x" ; then
-          DEAL_II_SLEPC_ARCH="$SLEPC_ARCH"
-         AC_MSG_RESULT($DEAL_II_SLEPC_ARCH)
-        else
-         AC_MSG_ERROR([If SLEPc is used, you must specify the architecture
-                        either through the SLEPC_ARCH environment variable,
-                        or through the --with-slepc-arch flag])
-        fi
-     ])
-
-  if test "x$SLEPC_ARCH" != "x" ; then
-    dnl Make sure that what was specified is actually correct.
-    if test ! -d $DEAL_II_SLEPC_DIR/$DEAL_II_SLEPC_ARCH \
-         -o ! -d $DEAL_II_SLEPC_DIR/$DEAL_II_SLEPC_ARCH/lib \
-         ; then
-      AC_MSG_ERROR([SLEPc has not been compiled for the architecture
-                    specified with --with-slepc-arch])
-    fi
-  fi
-
-  dnl Then check that PETSc and SLEPc architectures are compatible 
-  dnl ie. that they are the same.
-  if test "$DEAL_II_SLEPC_ARCH" != "$DEAL_II_PETSC_ARCH" \
-       ; then
-         AC_MSG_ERROR([If SLEPc is used, you must specify the same 
-                        architecture as your PETSc Installation either
-                        through the SLEPC_ARCH environment variable,
-                        or through the --with-slepc-arch flag])
-  fi 
-])
-
-
-
 dnl ------------------------------------------------------------
 dnl Figure out the version numbers of SLEPc and compare with 
 dnl version numbers of PETSc. This is not strictly necessary
index 9ad8dc73b17cd27de88f0cd7b2b1102f37b015eb..c7a277526a05c0c2102c11ce5296c86ab0538391 100644 (file)
@@ -55,7 +55,6 @@ DEAL_II_PETSC_MPIUNI_LIB = @DEAL_II_PETSC_MPIUNI_LIB@
 
 USE_CONTRIB_SLEPC    = @USE_CONTRIB_SLEPC@
 DEAL_II_SLEPC_DIR    = @DEAL_II_SLEPC_DIR@
-DEAL_II_SLEPC_ARCH   = @DEAL_II_SLEPC_ARCH@
 DEAL_II_SLEPC_VERSION_MAJOR    = @DEAL_II_SLEPC_VERSION_MAJOR@
 DEAL_II_SLEPC_VERSION_MINOR    = @DEAL_II_SLEPC_VERSION_MINOR@
 DEAL_II_SLEPC_VERSION_SUBMINOR = @DEAL_II_SLEPC_VERSION_SUBMINOR@
@@ -169,7 +168,7 @@ ifeq ($(USE_CONTRIB_PETSC),yes)
 endif
 
 ifeq ($(USE_CONTRIB_SLEPC),yes)
-  lib-contrib-slepc    = $(DEAL_II_SLEPC_DIR)/$(DEAL_II_SLEPC_ARCH)/lib/libslepc$(lib-suffix)
+  lib-contrib-slepc    = $(DEAL_II_SLEPC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/libslepc$(lib-suffix)
 endif
 
 # same for metis, except that there is only one library in that case
@@ -263,7 +262,7 @@ else
   include-path-petsc-bmake   = $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/include
 endif
 include-path-slepc           = $(DEAL_II_SLEPC_DIR)/include
-include-path-slepc-conf      = $(DEAL_II_SLEPC_DIR)/$(DEAL_II_SLEPC_ARCH)/conf
+include-path-slepc-conf      = $(DEAL_II_SLEPC_DIR)/$(DEAL_II_PETSC_ARCH)/conf
 include-path-trilinos        = $(DEAL_II_TRILINOS_INCDIR)
 include-path-metis           = $(DEAL_II_METIS_INCDIR)
 
index e9a27260a8051a4b9aa397345104d88e82d8dd90..499fabb33b2aa83adeea6664fca1cd011195d4ed 100644 (file)
@@ -189,6 +189,7 @@ DEAL_II_CHECK_ARRAY_CONDITIONAL_DECAY_BUG
 DEAL_II_CHECK_EXPLICIT_CONSTRUCTOR_BUG
 DEAL_II_CHECK_CONST_MEMBER_DEDUCTION_BUG
 DEAL_II_CHECK_TYPE_QUALIFIER_BUG
+DEAL_II_CHECK_WSYNTH_AND_STD_COMPLEX
 DEAL_II_CHECK_CTOR_DTOR_PRIVACY
 DEAL_II_HAVE_PRETTY_FUNCTION
 DEAL_II_HAVE_STD_ITERATOR
@@ -397,7 +398,6 @@ AC_SUBST(DEAL_II_DEFINE_DEAL_II_USE_PETSC)
 DEAL_II_CONFIGURE_SLEPC
 AC_SUBST(USE_CONTRIB_SLEPC)
 AC_SUBST(DEAL_II_SLEPC_DIR)
-AC_SUBST(DEAL_II_SLEPC_ARCH)
 AC_SUBST(DEAL_II_SLEPC_VERSION_MAJOR)
 AC_SUBST(DEAL_II_SLEPC_VERSION_MINOR)
 AC_SUBST(DEAL_II_SLEPC_VERSION_SUBMINOR)

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.