From 21e1a4e592dd0294a8707694b1806b0d052a6f06 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Mon, 8 Feb 2021 17:24:43 -0600 Subject: 1 12 merges from develop (#319) * OESS-98 fix tools test for plugins * sync fork * Merge of changes from dev * Move problem option to bottom of the list until fixed * HDFFV-11106 - fix parsing optional args * HDFFV-11106 add note * grammer fix * Whitespace after clang formatting * Undo format version 11 changes * Update check to working version * Merge workflow and minor changes from develop * Update supported platforms * PR#3 merge from develop * Merge gcc 10 diagnostics option from develop --- config/cmake/HDFCXXCompilerFlags.cmake | 8 ++++++ config/cmake/HDFCompilerFlags.cmake | 14 ++++++++++ config/cmake/HDFFortranCompilerFlags.cmake | 8 ++++++ config/gnu-cxxflags | 9 ++++++ config/gnu-fflags | 9 ++++++ config/gnu-flags | 9 ++++++ configure.ac | 45 ++++++++++++++++++++++++++++++ release_docs/RELEASE.txt | 19 +++++++++++++ 8 files changed, 121 insertions(+) diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index 4f2eabe..ebda39f 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -30,6 +30,14 @@ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") endif () + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () + endif () endif () endif () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index fb527d5..3d3cc6a 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -31,6 +31,20 @@ if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") endif () + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) + #----------------------------------------------------------------------------- + # Option to allow the user to enable build extended diagnostics + # + # This should NOT be on by default as it can cause process issues. + #----------------------------------------------------------------------------- + option (HDF5_ENABLE_BUILD_DIAGS "Enable color and URL extended diagnostic messages" OFF) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () + endif () endif () endif () diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index c7f085c..5521f6d 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -45,6 +45,14 @@ endif () #----------------------------------------------------------------------------- # HDF5 library compile options #----------------------------------------------------------------------------- +if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () +endif () #----------------------------------------------------------------------------- # CDash is configured to only allow 3000 warnings, so diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index 0b48bdf..6189db6 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -144,6 +144,15 @@ if test "X-g++" = "X-$cxx_vendor"; then DEBUG_CXXFLAGS="-ftrapv -fno-common" fi + ######################## + # Enhanced Diagnostics # + ######################## + + if test $cc_vers_major -ge 10; then + NO_DIAGS_CXXFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color" + fi + DIAGS_CXXFLAGS= + ########### # Symbols # ########### diff --git a/config/gnu-fflags b/config/gnu-fflags index 105a990..32e5a28 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -105,6 +105,15 @@ if test "X-gfortran" = "X-$f9x_vendor"; then DEBUG_FCFLAGS="-fbounds-check" fi + ######################## + # Enhanced Diagnostics # + ######################## + + if test $cc_vers_major -ge 10; then + NO_DIAGS_FCFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color" + fi + DIAGS_FCFLAGS= + ########### # Symbols # ########### diff --git a/config/gnu-flags b/config/gnu-flags index 538fd53..6f7aea6 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -158,6 +158,15 @@ if test "X-gcc" = "X-$cc_vendor"; then DEBUG_CFLAGS="-ftrapv -fno-common" fi + ######################## + # Enhanced Diagnostics # + ######################## + + if test $cc_vers_major -ge 10; then + NO_DIAGS_CFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color" + fi + DIAGS_CFLAGS= + ########### # Symbols # ########### diff --git a/configure.ac b/configure.ac index 64a3df3..6572346 100644 --- a/configure.ac +++ b/configure.ac @@ -2131,6 +2131,51 @@ AC_ARG_ENABLE([production], ## ---------------------------------------------------------------------- +## Check if the compiler should include build diagnostics +## +AC_MSG_CHECKING([enable build diagnostics]) +AC_ARG_ENABLE([diags], + [AS_HELP_STRING([--enable-diags=(yes|no|)], + [Allow default enhanced diagnostics to the build. + This is independent of the build mode and optimization + level. + [default=no] + ])], + [DIAGS=$enableval]) + +## Set default +if test "X-$DIAGS" = X- ; then + DIAGS=no +fi + +## Allow this variable to be substituted in +## other files (src/libhdf5.settings.in, etc.) +AC_SUBST([DIAGS]) + +case "X-$DIAGS" in + X-yes) + H5_CFLAGS="$H5_CFLAGS $DIAGS_CFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $DIAGS_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $DIAGS_FCFLAGS" + AC_MSG_RESULT([yes]) + ;; + X-no) + H5_CFLAGS="$H5_CFLAGS $NO_DIAGS_CFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $NO_DIAGS_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $NO_DIAGS_FCFLAGS" + AC_MSG_RESULT([no]) + ;; + *) + H5_CFLAGS="$H5_CFLAGS $DIAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $DIAGS" + H5_FCFLAGS="$H5_FCFLAGS $DIAGS" + DIAGS="custom ($DIAGS)" + AC_MSG_RESULT([$DIAGS]) + ;; +esac + + +## ---------------------------------------------------------------------- ## Check if the compiler should include symbols ## AC_MSG_CHECKING([enable debugging symbols]) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index dd5888b..6cf258d 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -46,6 +46,25 @@ New Features Configuration: ------------- + - Added a configure-time option to control certain compiler warnings + diagnostics + + A new configure-time option was added that allows some compiler warnings + diagnostics to have the default operation. This is mainly intended for + library developers and currently only works for gcc 10 and above. The + diagnostics flags apply to C, C++ and Fortran compilers and will appear + in "H5 C Flags", H5 C++ Flags" and H5 Fortran Flags, respectively. They + will NOT be exported to h5cc, etc. + + The default is OFF, which will disable the warnings URL and color attributes + for the warnings output. ON will not add the flags and allow default behavior. + + Autotools: --enable-diags + + CMake: HDF5_ENABLE_BUILD_DIAGS + + (ADB - 2021/02/05, HDFFV-11213) + - CMake option to build the HDF filter plugins project as an external project The HDF filter plugins project is a collection of registered compression -- cgit v0.12