]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check for a compiler bug on Mac OS X.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 8 Sep 2009 13:42:24 +0000 (13:42 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 8 Sep 2009 13:42:24 +0000 (13:42 +0000)
git-svn-id: https://svn.dealii.org/trunk@19414 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/base/include/base/config.h.in
deal.II/configure
deal.II/configure.in

index 41a65ee52125eeb0ad5bf7f3249292c9f2710bad..bd9aae2f17f8541c4f4d77400c2cb63491b3c675 100644 (file)
@@ -4425,7 +4425,7 @@ AC_DEFUN(DEAL_II_CHECK_WSYNTH_AND_STD_COMPLEX, dnl
 
 
 dnl -------------------------------------------------------------
-dnl Older gcc version appear to frown upon the way we write the
+dnl Older gcc versions appear to frown upon the way we write the
 dnl IsBlockMatrix<MatrixType> template. If that's the case,
 dnl remove the -Wctor-dtor-privacy flag.
 dnl
@@ -4475,6 +4475,56 @@ AC_DEFUN(DEAL_II_CHECK_CTOR_DTOR_PRIVACY, dnl
 ])
 
 
+
+dnl -------------------------------------------------------------
+dnl On Mac OS X, gcc appears to have a bug that prevents us from
+dnl compiling a bit of code that involves boost::bind. Check for
+dnl that.
+dnl
+dnl Usage: DEAL_II_CHECK_BOOST_BIND_COMPILER_BUG
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_BOOST_BIND_COMPILER_BUG, dnl
+[
+  if test "x$GXX" = "xyes" ; then
+    AC_MSG_CHECKING(for boost::bind compiler internal error)
+    AC_LANG(C++)
+    CXXFLAGS="$CXXFLAGSG -I./contrib/boost/include"
+    AC_TRY_COMPILE(
+      [
+#include <complex>
+#include <iostream>
+#include <boost/bind.hpp>
+
+template<typename number>
+void bug_function (number test)
+{
+  std::cout << test << std::endl;
+}
+      ],
+      [
+  std::complex<double> double_val (1., 2.);
+  boost::bind(&bug_function<std::complex<double> >,
+             double_val)();
+
+  std::complex<float> float_val (1., 2.);
+  boost::bind(&bug_function<std::complex<float> >,
+             float_val)();
+      ],
+      [
+        AC_MSG_RESULT(no)
+      ],
+      [
+        AC_MSG_RESULT(yes)
+       AC_DEFINE(DEAL_II_BOOST_BIND_COMPILER_BUG, 1,
+                 [Defined if the compiler gets an internal error compiling
+                  some code that involves boost::bind])
+      ])
+  fi
+])
+
+
+
 dnl -------------------------------------------------------------
 dnl Check for boost option and find pre-installed boost
 dnl -------------------------------------------------------------
index 4c9b5d5aa08330d66288dc63e09ef6899e0b5a80..7c4b3020218b347c85a82aaaaee48c9777531915 100644 (file)
    header file. */
 #undef HAVE_THYRA_AZTECOOLINEAROPWITHSOLVEFACTORY_HPP
 
-/* Define to 1 if you have the <Thyra_DefaultBlockedLinearOpDecl.hpp> header
-   file. */
-#undef HAVE_THYRA_DEFAULTBLOCKEDLINEAROPDECL_HPP
-
 /* Define to 1 if you have the <Thyra_DefaultBlockedLinearOp.hpp> header file.
    */
 #undef HAVE_THYRA_DEFAULTBLOCKEDLINEAROP_HPP
index 12af1f698df8f4b637f21d304d3026a53165d083..3a241c776e39d2f1eb103d84391dba3d35c3a17f 100755 (executable)
@@ -8163,6 +8163,89 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
+  if test "x$GXX" = "xyes" ; then
+    { echo "$as_me:$LINENO: checking for boost::bind compiler internal error" >&5
+echo $ECHO_N "checking for boost::bind compiler internal error... $ECHO_C" >&6; }
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    CXXFLAGS="$CXXFLAGSG -I./contrib/boost/include"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <complex>
+#include <iostream>
+#include <boost/bind.hpp>
+
+template<typename number>
+void bug_function (number test)
+{
+  std::cout << test << std::endl;
+}
+
+int
+main ()
+{
+
+  std::complex<double> double_val (1., 2.);
+  boost::bind(&bug_function<std::complex<double> >,
+             double_val)();
+
+  std::complex<float> float_val (1., 2.);
+  boost::bind(&bug_function<std::complex<float> >,
+             float_val)();
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+        { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define DEAL_II_BOOST_BIND_COMPILER_BUG 1
+_ACEOF
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  fi
+
+
   { echo "$as_me:$LINENO: checking for const member deduction bug" >&5
 echo $ECHO_N "checking for const member deduction bug... $ECHO_C" >&6; }
   ac_ext=cpp
index 8b2f316c64b052fee940e7bf375c6ffae447de64..76a936b3cc6687e7184168dd6111b84adeb67369 100644 (file)
@@ -188,6 +188,7 @@ DEAL_II_CHECK_TEMPL_OP_DISAMBIGUATION_BUG
 DEAL_II_CHECK_ARRAY_CONDITIONAL_DECAY_BUG
 DEAL_II_CHECK_ARRAY_ARG_BUG
 DEAL_II_CHECK_EXPLICIT_CONSTRUCTOR_BUG
+DEAL_II_CHECK_BOOST_BIND_COMPILER_BUG
 DEAL_II_CHECK_CONST_MEMBER_DEDUCTION_BUG
 DEAL_II_CHECK_TYPE_QUALIFIER_BUG
 DEAL_II_CHECK_WSYNTH_AND_STD_COMPLEX

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.