]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make Intel icc also use C++0x and thereby also avoid a problem with configuring and...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 6 Nov 2011 18:29:57 +0000 (18:29 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 6 Nov 2011 18:29:57 +0000 (18:29 +0000)
git-svn-id: https://svn.dealii.org/trunk@24733 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure
deal.II/doc/news/changes.h

index 42d79c5b89186584378e10a6b89ae6957b3cc5ee..6f5ec23313b9d467de48e764b20fe3757b13544f 100644 (file)
@@ -425,24 +425,8 @@ AC_DEFUN(DEAL_II_SET_CXX_FLAGS, dnl
     CXXFLAGSG="$CXXFLAGSG -Wno-long-long"
 
     dnl See whether the gcc we use already has a flag for C++2011 features.
-    AC_MSG_CHECKING(whether compiler has a flag to support C++2011)
+    DEAL_II_CHECK_CXX1X
 
-    OLD_CXXFLAGS="$CXXFLAGS"
-    CXXFLAGS=-std=c++0x
-    AC_TRY_COMPILE([], [;],
-       [
-         AC_MSG_RESULT(yes)
-         test_cxx1x=yes
-       ],
-       [
-         AC_MSG_RESULT(no)
-         test_cxx1x=no
-       ])
-    CXXFLAGS="${OLD_CXXFLAGS}"
-
-    if test "x$test_cxx1x" = "xyes" ; then
-      DEAL_II_CHECK_CXX1X_COMPONENTS("-std=c++0x")
-    fi
 
     dnl On some gcc 4.3 snapshots, a 'const' qualifier on a return type triggers a
     dnl warning. This is unfortunate, since we happen to stumble on this
@@ -808,6 +792,9 @@ AC_DEFUN(DEAL_II_SET_CXX_FLAGS, dnl
                 esac
                ;;
          esac
+
+         dnl Finally, see if the compiler supports C++0x
+         DEAL_II_CHECK_CXX1X
           ;;
 
       compaq_cxx)
@@ -1062,6 +1049,38 @@ AC_DEFUN(DEAL_II_SET_CXX_DEBUG_FLAG, dnl
 
 
 
+dnl -------------------------------------------------------------
+dnl See if there is a compiler flag to enable C++1x features
+dnl
+dnl Usage: DEAL_II_CHECK_CXX1X
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_CXX1X, dnl
+[
+  AC_MSG_CHECKING(whether compiler has a flag to support C++2011)
+
+  dnl See if -std=c++0x exists
+  OLD_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS=-std=c++0x
+  AC_TRY_COMPILE([], [;],
+     [
+       AC_MSG_RESULT(yes)
+       test_cxx1x=yes
+     ],
+     [
+       AC_MSG_RESULT(no)
+       test_cxx1x=no
+     ])
+  CXXFLAGS="${OLD_CXXFLAGS}"
+
+  dnl If the flag above works, then see if the compiler is complete
+  dnl enough in this area
+  if test "x$test_cxx1x" = "xyes" ; then
+    DEAL_II_CHECK_CXX1X_COMPONENTS("-std=c++0x")
+  fi
+])
+
+
 dnl -------------------------------------------------------------
 dnl Given the command line flag specified as argument to this macro,
 dnl test whether all components that we need from the C++1X
index 3ecc6dd83643e1978581ba6782119e1eaceefc4e..46f426646609dd7150f7deb48fdca26ac8f891d2 100755 (executable)
@@ -4131,12 +4131,13 @@ rm -f core conftest.err conftest.$ac_objext \
 
         CXXFLAGSG="$CXXFLAGSG -Wno-long-long"
 
-        OLD_CXXFLAGS="$CXXFLAGS"
-    CXXFLAGS=-std=c++0x
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler has a flag to support C++1x" >&5
-$as_echo_n "checking whether compiler has a flag to support C++1x... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler has a flag to support C++2011" >&5
+$as_echo_n "checking whether compiler has a flag to support C++2011... " >&6; }
+
+    OLD_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS=-std=c++0x
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -4149,21 +4150,21 @@ main ()
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
 
-         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-         test_cxx1x=yes
+       test_cxx1x=yes
 
 else
 
-         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-         test_cxx1x=no
+       test_cxx1x=no
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    CXXFLAGS="${OLD_CXXFLAGS}"
+  CXXFLAGS="${OLD_CXXFLAGS}"
 
-    if test "x$test_cxx1x" = "xyes" ; then
+      if test "x$test_cxx1x" = "xyes" ; then
 
   OLD_CXXFLAGS="$CXXFLAGS"
   CXXFLAGS=""-std=c++0x""
@@ -4471,7 +4472,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 $as_echo "no" >&6; }
   fi
 
-    fi
+  fi
+
+
 
                     CXXFLAGS="-Wreturn-type -Werror"
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether qualifiers in return types lead to a warning" >&5
@@ -4855,6 +4858,350 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
                 esac
                ;;
          esac
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler has a flag to support C++2011" >&5
+$as_echo_n "checking whether compiler has a flag to support C++2011... " >&6; }
+
+    OLD_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS=-std=c++0x
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       test_cxx1x=yes
+
+else
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       test_cxx1x=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CXXFLAGS="${OLD_CXXFLAGS}"
+
+      if test "x$test_cxx1x" = "xyes" ; then
+
+  OLD_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS=""-std=c++0x""
+
+  all_cxx1x_classes_available=yes
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::array" >&5
+$as_echo_n "checking for std::array... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <array>
+int
+main ()
+{
+ std::array<int,3> p; p[0];
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; all_cxx1x_classes_available=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::condition_variable" >&5
+$as_echo_n "checking for std::condition_variable... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <condition_variable>
+int
+main ()
+{
+ std::condition_variable c; c.notify_all()
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; all_cxx1x_classes_available=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::function and std::bind" >&5
+$as_echo_n "checking for std::function and std::bind... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <functional>
+        void f(int, double);
+int
+main ()
+{
+ std::function<void (int)>
+            g = std::bind (f, std::placeholders::_1, 1.1) ;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; all_cxx1x_classes_available=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::bind works with rvalues" >&5
+$as_echo_n "checking for std::bind works with rvalues... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <functional>
+        void f(int);
+int
+main ()
+{
+ using namespace std;
+         using namespace std::placeholders;
+         bind(multiplies<int>(),4,_1)(5); ;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; all_cxx1x_classes_available=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::shared_ptr" >&5
+$as_echo_n "checking for std::shared_ptr... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <memory>
+int
+main ()
+{
+ std::shared_ptr<int> p(new int(3))
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; all_cxx1x_classes_available=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::thread" >&5
+$as_echo_n "checking for std::thread... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <thread>
+        void f(int);
+int
+main ()
+{
+ std::thread t(f,1); t.join();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; all_cxx1x_classes_available=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+              CXXFLAGS=""-std=c++0x" -lpthread"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether std::thread actually works" >&5
+$as_echo_n "checking whether std::thread actually works... " >&6; }
+  if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <thread>
+        void f(int) {}
+        int main() { std::thread t(f,1); t.join(); }
+_ACEOF
+if ac_fn_cxx_try_run "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; all_cxx1x_classes_available=no
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+  CXXFLAGS=""-std=c++0x""
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::mutex" >&5
+$as_echo_n "checking for std::mutex... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <mutex>
+int
+main ()
+{
+ std::mutex m; m.lock();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; all_cxx1x_classes_available=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::tuple" >&5
+$as_echo_n "checking for std::tuple... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <tuple>
+int
+main ()
+{
+ std::tuple<int,double,char> p(1,1.1,'a')
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; all_cxx1x_classes_available=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+  CXXFLAGS="${OLD_CXXFLAGS}"
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++1x support is complete enough" >&5
+$as_echo_n "checking whether C++1x support is complete enough... " >&6; }
+  if test "x$all_cxx1x_classes_available" = "xyes" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+    CXXFLAGSG="$CXXFLAGSG "-std=c++0x""
+    CXXFLAGSO="$CXXFLAGSO "-std=c++0x""
+
+
+$as_echo "#define DEAL_II_CAN_USE_CXX1X 1" >>confdefs.h
+
+
+
+                OLD_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="$CXXFLAGSG"
+
+    extra_cxx1x_features_available=yes
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for auto typed variables" >&5
+$as_echo_n "checking for auto typed variables... " >&6; }
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <vector>
+int
+main ()
+{
+
+           std::vector<int> v;
+          auto i = v.begin();
+          *i;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; extra_cxx1x_features_available=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for range-based for" >&5
+$as_echo_n "checking for range-based for... " >&6; }
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <vector>
+int
+main ()
+{
+
+           std::vector<int> v;
+          for (std::vector<int>::iterator i : v)
+            *i;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; extra_cxx1x_features_available=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+    CXXFLAGS="${OLD_CXXFLAGS}"
+
+              else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  fi
+
+  fi
+
           ;;
 
       compaq_cxx)
index 257060496732a594526041befd18d3e8e42dfbbf..c39d3e4bc9ef8723993c87cc1aa22fa92a3f7b94 100644 (file)
@@ -34,6 +34,13 @@ inconvenience this causes.
 <h3>General</h3>
 
 <ol>
+<li> Fixed: Intel ICC 12.1 gets into trouble with BOOST because BOOST
+believes that the compiler supports C++0x but one then still has to
+specify the corresponding flag on the command line to avoid compiler
+errors. This is now fixed.
+<br>
+(Wolfgang Bangerth, 2011/11/06)
+
 <li> Fixed: On some systems, <code>mpiCC</code> turns out to alias the
 C compiler, not the C++ compiler as expected. Consequently, try to use
 <code>mpic++</code> or <code>mpicxx</code> before <code>mpiCC</code> as

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.