diff --git a/configure b/configure index 9af835866ba..c1203ef211a 100755 --- a/configure +++ b/configure @@ -1196,6 +1196,7 @@ with_cxx_std enable_sanitize enable_glibcxx_debugging enable_glibcxx_debugging_cppunit +enable_fpe_safety enable_coverage with_methods enable_werror @@ -2014,6 +2015,7 @@ Optional Features: dbg mode --enable-glibcxx-debugging-cppunit Use GLIBCXX debugging flags for unit tests + --disable-fpe-safety remove FPE-trapping compiler flags --enable-coverage configure code coverage analysis tools --enable-werror Turn compilation warnings into errors --enable-paranoid-warnings @@ -8038,34 +8040,70 @@ fi if test "x$compiler_brand_detected" = "xno" then : - clang_version="`($CXX --version 2>&1)`" - is_clang="`echo $clang_version | grep 'clang'`" + ACSM_CLANG_VERSION_STRING="`($CXX --version 2>&1)`" + is_clang="`echo $ACSM_CLANG_VERSION_STRING | grep 'clang'`" if test "x$is_clang" != "x" then : - is_apple_clang="`echo $clang_version | grep 'Apple'`" + is_apple_clang="`echo $ACSM_CLANG_VERSION_STRING | grep 'Apple'`" clang_vendor="clang" if test "x$is_apple_clang" != "x" then : clang_vendor="Apple clang" fi - clang_major_minor=unknown - - if test "x$PERL" != "x" -then : - - clang_major_minor=`echo $clang_version | $PERL -ne 'print $1 if /version\s(\d+\.\d+)/'` - if test "x$clang_major_minor" = "x" -then : - clang_major_minor=unknown -fi - -fi + case "x$ACSM_CLANG_VERSION_STRING" in #( + *clang\ version\ 17.*) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler is clang-17.x >>>" >&5 +printf "%s\n" "<<< C++ compiler is clang-17.x >>>" >&6; } + ACSM_CLANG_VERSION=17 ;; #( + *clang\ version\ 16.*) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler is clang-16.x >>>" >&5 +printf "%s\n" "<<< C++ compiler is clang-16.x >>>" >&6; } + ACSM_CLANG_VERSION=16 ;; #( + *clang\ version\ 15.*) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler is clang-15.x >>>" >&5 +printf "%s\n" "<<< C++ compiler is clang-15.x >>>" >&6; } + ACSM_CLANG_VERSION=15 ;; #( + *clang\ version\ 14.*) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler is clang-14.x >>>" >&5 +printf "%s\n" "<<< C++ compiler is clang-14.x >>>" >&6; } + ACSM_CLANG_VERSION=14 ;; #( + *clang\ version\ 13.*) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler is clang-13.x >>>" >&5 +printf "%s\n" "<<< C++ compiler is clang-13.x >>>" >&6; } + ACSM_CLANG_VERSION=13 ;; #( + *clang\ version\ 12.*) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler is clang-12.x >>>" >&5 +printf "%s\n" "<<< C++ compiler is clang-12.x >>>" >&6; } + ACSM_CLANG_VERSION=12 ;; #( + *clang\ version\ 11.*) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler is clang-11.x >>>" >&5 +printf "%s\n" "<<< C++ compiler is clang-11.x >>>" >&6; } + ACSM_CLANG_VERSION=11 ;; #( + *clang\ version\ 10.*) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler is clang-10.x >>>" >&5 +printf "%s\n" "<<< C++ compiler is clang-10.x >>>" >&6; } + ACSM_CLANG_VERSION=10 ;; #( + *clang\ version\ 9.*) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler is clang-9.x >>>" >&5 +printf "%s\n" "<<< C++ compiler is clang-9.x >>>" >&6; } + ACSM_CLANG_VERSION=9 ;; #( + *clang\ version\ 8.*) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler is clang-8.x >>>" >&5 +printf "%s\n" "<<< C++ compiler is clang-8.x >>>" >&6; } + ACSM_CLANG_VERSION=8 ;; #( + *clang\ version\ 7.*) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler is clang-7.x >>>" >&5 +printf "%s\n" "<<< C++ compiler is clang-7.x >>>" >&6; } + ACSM_CLANG_VERSION=7 ;; #( + *) : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler \"$ACSM_CLANG_VERSION\" is unknown but accepted clang version >>>" >&5 +printf "%s\n" "<<< C++ compiler \"$ACSM_CLANG_VERSION\" is unknown but accepted clang version >>>" >&6; } + ACSM_CLANG_VERSION=other ;; +esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< C++ compiler is ${clang_vendor}, version ${clang_major_minor} >>>" >&5 -printf "%s\n" "<<< C++ compiler is ${clang_vendor}, version ${clang_major_minor} >>>" >&6; } ACSM_GXX_VERSION=clang compiler_brand_detected=yes @@ -26494,7 +26532,17 @@ fi ACSM_CXXFLAGS_DBG="$ACSM_CXXFLAGS_DBG -Wunused-parameter -Wunused -Wpointer-arith -Wformat -Wparentheses -Qunused-arguments -Woverloaded-virtual -fno-limit-debug-info" ACSM_NODEPRECATEDFLAG="-Wno-deprecated" - ACSM_FPE_SAFETY_FLAGS="-ftrapping-math" + if test "x$ACSM_CLANG_VERSION" = "xother" || test $ACSM_CLANG_VERSION -ge 10 +then : + ACSM_FPE_SAFETY_FLAGS="-ftrapping-math" +else $as_nop + ACSM_FPE_SAFETY_FLAGS="" +fi + + if test "x$ACSM_CLANG_VERSION" = "xother" || test $ACSM_CLANG_VERSION -ge 12 +then : + ACSM_FPE_SAFETY_FLAGS="$ACSM_FPE_SAFETY_FLAGS -Wno-unsupported-floating-point-opt" +fi ACSM_PARANOID_FLAGS="-Wall -Wextra -Wcast-align -Wdisabled-optimization -Wformat=2" ACSM_PARANOID_FLAGS="$ACSM_PARANOID_FLAGS -Wformat-nonliteral -Wformat-security -Wformat-y2k" @@ -26596,6 +26644,132 @@ fi + + + + # Check whether --enable-fpe-safety was given. +if test ${enable_fpe_safety+y} +then : + enableval=$enable_fpe_safety; case "${enableval}" in #( + yes) : + acsm_enablefpesafety=yes ;; #( + no) : + acsm_enablefpesafety=no ;; #( + *) : + as_fn_error $? "bad value ${enableval} for --enable-fpe-safety" "$LINENO" 5 ;; +esac +else $as_nop + acsm_enablefpesafety=yes +fi + + + if test "$acsm_enablefpesafety" = "yes" +then : + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_fpe_safety_save_CFLAGS="$CFLAGS" + CFLAGS="${CFLAGS} ${ACSM_FPE_SAFETY_FLAGS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unable to compile C with FPE safety flag ($CC $ACSM_FPE_SAFETY_FLAGS)" >&5 +printf "%s\n" "$as_me: WARNING: unable to compile C with FPE safety flag ($CC $ACSM_FPE_SAFETY_FLAGS)" >&2;} + ACSM_FPE_SAFETY_FLAGS="" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$ac_fpe_safety_save_CFLAGS" + 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 + + + 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 + + ac_fpe_safety_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="${CXXFLAGS} ${ACSM_FPE_SAFETY_FLAGS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unable to compile C++ with FPE safety flag ($CXX $ACSM_FPE_SAFETY_FLAGS)" >&5 +printf "%s\n" "$as_me: WARNING: unable to compile C++ with FPE safety flag ($CXX $ACSM_FPE_SAFETY_FLAGS)" >&2;} + ACSM_FPE_SAFETY_FLAGS="" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXXFLAGS="$ac_fpe_safety_save_CXXFLAGS" + 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 + + + if test "x$ACSM_FPE_SAFETY_FLAGS" != "x" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< Adding $ACSM_FPE_SAFETY_FLAGS for FPE safety >>>" >&5 +printf "%s\n" "<<< Adding $ACSM_FPE_SAFETY_FLAGS for FPE safety >>>" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< No flags found to use for FPE safety >>>" >&5 +printf "%s\n" "<<< No flags found to use for FPE safety >>>" >&6; } + +fi + ACSM_CXXFLAGS_OPT="$ACSM_CXXFLAGS_OPT $ACSM_FPE_SAFETY_FLAGS" + ACSM_CXXFLAGS_DBG="$ACSM_CXXFLAGS_DBG $ACSM_FPE_SAFETY_FLAGS" + ACSM_CXXFLAGS_DEVEL="$ACSM_CXXFLAGS_DEVEL $ACSM_FPE_SAFETY_FLAGS" + + ACSM_CFLAGS_OPT="$ACSM_CFLAGS_OPT $ACSM_FPE_SAFETY_FLAGS" + ACSM_CFLAGS_DBG="$ACSM_CFLAGS_DBG $ACSM_FPE_SAFETY_FLAGS" + ACSM_CFLAGS_DEVEL="$ACSM_CFLAGS_DEVEL $ACSM_FPE_SAFETY_FLAGS" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: <<< Not enabling flags for FPE safety >>>" >&5 +printf "%s\n" "<<< Not enabling flags for FPE safety >>>" >&6; } + +fi + + CXXFLAGS_OPT="$ACSM_CXXFLAGS_OPT" CXXFLAGS_DEVEL="$ACSM_CXXFLAGS_DEVEL" CXXFLAGS_DBG="$ACSM_CXXFLAGS_DBG" diff --git a/contrib/metaphysicl b/contrib/metaphysicl index a03a9c6b9a7..12bd7c3090e 160000 --- a/contrib/metaphysicl +++ b/contrib/metaphysicl @@ -1 +1 @@ -Subproject commit a03a9c6b9a7ea580fdc30adf79fbf5bf3c0065f9 +Subproject commit 12bd7c3090e13ea96f7a7b8707c2ec34a32e7378 diff --git a/contrib/timpi b/contrib/timpi index d7d4c49653b..545a25655fc 160000 --- a/contrib/timpi +++ b/contrib/timpi @@ -1 +1 @@ -Subproject commit d7d4c49653b0ab72a6ddfb60e026c58a74a7ccf8 +Subproject commit 545a25655fca3d1fc330549a7d4ea3bc8336d2f2 diff --git a/m4/autoconf-submodule b/m4/autoconf-submodule index 2650a1c8dcc..a68e86a69b8 160000 --- a/m4/autoconf-submodule +++ b/m4/autoconf-submodule @@ -1 +1 @@ -Subproject commit 2650a1c8dccebb4400a6809d9bbe9ff98a8481f4 +Subproject commit a68e86a69b8ab5f0cef18863e22e2e374b46863c diff --git a/m4/compiler.m4 b/m4/compiler.m4 index 34bfc123536..739355096fc 100644 --- a/m4/compiler.m4 +++ b/m4/compiler.m4 @@ -203,6 +203,8 @@ AC_DEFUN([LIBMESH_SET_BUILD_FLAGS], ACSM_SET_GLIBCXX_DEBUG_FLAGS + ACSM_SET_FPE_SAFETY_FLAGS + CXXFLAGS_OPT="$ACSM_CXXFLAGS_OPT" CXXFLAGS_DEVEL="$ACSM_CXXFLAGS_DEVEL" CXXFLAGS_DBG="$ACSM_CXXFLAGS_DBG"