]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Don't just test for the existence of std::thread but also whether it works.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 25 Oct 2010 16:41:24 +0000 (16:41 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 25 Oct 2010 16:41:24 +0000 (16:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@22475 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure

index 9256e092d24e5f0d2cb75dcaec0e0d08b6900d89..20dc46cd9949fe3c5117aa71c535deb916786434 100644 (file)
@@ -1054,6 +1054,18 @@ AC_DEFUN(DEAL_II_CHECK_CXX1X_COMPONENTS, dnl
        [ AC_MSG_RESULT(no); all_cxx1x_available=no ]
        )
 
+  dnl On some systems with gcc 4.5.0, we can compile the code
+  dnl above but it will throw an exception when run. So test
+  dnl that as well.
+  AC_MSG_CHECKING(whether std::thread actually works)
+  AC_TRY_RUN(
+       [#include <thread>
+        void f(int); ],
+       [ std::thread t(f,1); t.join();],
+       [ AC_MSG_RESULT(yes) ],
+       [ AC_MSG_RESULT(no); all_cxx1x_available=no ]
+       )
+
   AC_MSG_CHECKING(for std::mutex)
   AC_TRY_COMPILE(
        [#include <mutex> ],
index 24a3e88df131e41eb85d9f08097066c0c8f79421..34246213ea990bd0d446faf0ab53a2a4979ca8b8 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 22430 .
+# From configure.in Revision: 22448 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.63 for deal.II 6.4.pre.
 #
@@ -4376,6 +4376,60 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+        { $as_echo "$as_me:$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:$LINENO: result: no" >&5
+$as_echo "no" >&6; }; all_cxx1x_available=no
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <thread>
+        void f(int);
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+   std::thread t(f,1); t.join();
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
   { $as_echo "$as_me:$LINENO: checking for std::mutex" >&5
 $as_echo_n "checking for std::mutex... " >&6; }
   cat >conftest.$ac_ext <<_ACEOF

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.