From: bangerth Date: Fri, 22 Sep 2006 15:07:15 +0000 (+0000) Subject: Do not test for __builtin_expect when using the Portland Group compiler X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3533b2a4200bb33f607311a4117e44736e550677;p=dealii-svn.git Do not test for __builtin_expect when using the Portland Group compiler git-svn-id: https://svn.dealii.org/trunk@13951 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 46930cf0ed..19fe71967f 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -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 ]) diff --git a/deal.II/configure b/deal.II/configure index 43d6d275ce..b8492dedbe 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -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