]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Do not test for __builtin_expect when using the Portland Group compiler
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 22 Sep 2006 15:07:15 +0000 (15:07 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 22 Sep 2006 15:07:15 +0000 (15:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@13951 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 46930cf0ed96cb3b0600e90c5c7c5b884b32c33f..19fe71967fe4a3b1cef84fa008f646ff7f12f7e1 100644 (file)
@@ -3949,29 +3949,36 @@ dnl gcc compilers. This can be used to hint the compiler's branch
 dnl prediction unit in some cases. We use it in the AssertThrow
 dnl macros.
 dnl
+dnl Annoyingly, the Portland Group compiler compiles code with
+dnl __builtin_expect just fine, but then doesn't want to link it,
+dnl saying it doesn't know this function. So simply not test for
+dnl __builtin_expect with that compiler.
+dnl
 dnl Usage: DEAL_II_HAVE_BUILTIN_EXPECT
 dnl
 dnl -------------------------------------------------------------
 AC_DEFUN(DEAL_II_HAVE_BUILTIN_EXPECT, dnl
 [
-  AC_MSG_CHECKING(for __builtin_expect)
-  AC_LANG(C++)
-  CXXFLAGS="$CXXFLAGSG"
-  AC_TRY_COMPILE(
-    [
-       bool f();
-    ],
-    [
-       if (__builtin_expect(f(),false));
-    ],
-    [
-      AC_MSG_RESULT(yes)
-      AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, 
-                [Define if the compiler provides __builtin_expect])
-    ],
-    [
-      AC_MSG_RESULT(no)
-    ])
+  if test ! "x$GXX_VERSION" = "xportland_group" ; then
+    AC_MSG_CHECKING(for __builtin_expect)
+    AC_LANG(C++)
+    CXXFLAGS="$CXXFLAGSG"
+    AC_TRY_COMPILE(
+      [
+         bool f();
+      ],
+      [
+         if (__builtin_expect(f(),false));
+      ],
+      [
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, 
+                  [Define if the compiler provides __builtin_expect])
+      ],
+      [
+        AC_MSG_RESULT(no)
+      ])
+  fi
 ])
 
 
index 43d6d275ce4bdebb822e8ce035c7ee75d102f736..b8492dedbea66f2ffb6cd7ccafa725d0efc2b9bf 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 13617 .
+# From configure.in Revision: 13905 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59 for deal.II 5.3.pre.
 #
@@ -7274,29 +7274,30 @@ fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
-  echo "$as_me:$LINENO: checking for __builtin_expect" >&5
+  if test ! "x$GXX_VERSION" = "xportland_group" ; then
+    echo "$as_me:$LINENO: checking for __builtin_expect" >&5
 echo $ECHO_N "checking for __builtin_expect... $ECHO_C" >&6
-  ac_ext=cc
+    ac_ext=cc
 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"
-  cat >conftest.$ac_ext <<_ACEOF
+    CXXFLAGS="$CXXFLAGSG"
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-       bool f();
+         bool f();
 
 int
 main ()
 {
 
-       if (__builtin_expect(f(),false));
+         if (__builtin_expect(f(),false));
 
   ;
   return 0;
@@ -7325,7 +7326,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-      echo "$as_me:$LINENO: result: yes" >&5
+        echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 cat >>confdefs.h <<\_ACEOF
@@ -7338,11 +7339,12 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-      echo "$as_me:$LINENO: result: no" >&5
+        echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  fi
 
 
   echo "$as_me:$LINENO: checking for __verbose_terminate_handler" >&5

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.