From 0c5e34c48b2543715186cf3d96aa11ad4d128243 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 2 Jun 2021 19:28:59 -0500 Subject: [PATCH 1/2] Adds an Intel C++ configuration file --- MANIFEST | 1 + config/intel-cxxflags | 128 +++++++++++++++++++++++++++++++++++++++ config/linux-gnulibc1 | 4 ++ release_docs/RELEASE.txt | 9 ++- src/H5VLcallback.c | 6 +- 5 files changed, 143 insertions(+), 5 deletions(-) create mode 100644 config/intel-cxxflags diff --git a/MANIFEST b/MANIFEST index e114586a930..6913febc725 100644 --- a/MANIFEST +++ b/MANIFEST @@ -135,6 +135,7 @@ ./config/cygwin ./config/ibm-aix ./config/ibm-flags +./config/intel-cxxflags ./config/intel-fflags ./config/intel-flags ./config/libhdf5.pc.in diff --git a/config/intel-cxxflags b/config/intel-cxxflags new file mode 100644 index 00000000000..3ef172f8fce --- /dev/null +++ b/config/intel-cxxflags @@ -0,0 +1,128 @@ +# -*- shell-script -*- +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://www.hdfgroup.org/licenses. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. + + +# This file should be sourced into configure if the compiler is the +# Intel icpc compiler or a derivative. It is careful not to do anything +# if the compiler is not Intel; otherwise `cxx_flags_set' is set to `yes' +# + +# Get the compiler version in a way that works for icpc +# icpc unless a compiler version is already known +# +# cxx_vendor: The compiler name: icpc +# cxx_version: Version number: 8.0 +# +if test X = "X$cxx_flags_set"; then + cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 |grep 'Version'`" + if test X != "X$cxx_version"; then + cxx_vendor=icpc + cxx_version=`echo $cxx_version |sed 's/.*Version \([-a-z0-9\.\-]*\).*/\1/'` + echo "compiler '$CXX' is Intel $cxx_vendor-$cxx_version" + + # Some version numbers + # Intel version numbers are of the form: "major.minor" + cxx_vers_major=`echo $cxx_version | cut -f1 -d.` + cxx_vers_minor=`echo $cxx_version | cut -f2 -d.` + #cxx_vers_patch=`echo $cxx_version | cut -f2 -d.` + test -n "$cxx_vers_major" || cxx_vers_major=0 + test -n "$cxx_vers_minor" || cxx_vers_minor=0 + test -n "$cxx_vers_patch" || cxx_vers_patch=0 + cxx_vers_all=`expr $cxx_vers_major '*' 1000000 + $cxx_vers_minor '*' 1000 + $cxx_vers_patch` + fi +fi + +# Common Intel flags for various situations +if test "X-icpc" = "X-$cxx_vendor"; then + # Insert section about version specific problems from compiler flags here, + # if necessary. + + arch= + # Architecture-specific flags + # Nothing currently. (Uncomment code below and modify to add any) + #case "$host_os-$host_cpu" in + # *-i686) + # arch="-march=i686" + # ;; + #esac + + # Host-specific flags + # Nothing currently. (Uncomment code below and modify to add any) + #case "`hostname`" in + # sleipnir.ncsa.uiuc.edu) + # arch="$arch -pipe" + # ;; + #esac + + ########### + # General # + ########### + + # Default to C++11 standard + H5_CXXFLAGS="$H5_CXXFLAGS $arch -std=c++11" + + ############## + # Production # + ############## + + PROD_CXXFLAGS= + + ######### + # Debug # + ######### + + # NDEBUG is handled explicitly by the configure script + # -g is handled by the symbols flags + DEBUG_CXXFLAGS= + + ########### + # Symbols # + ########### + + SYMBOLS_CXXFLAGS="-g" + NO_SYMBOLS_CXXFLAGS="-Wl,-s" + + ############# + # Profiling # + ############# + + # Use this for profiling with gprof + PROFILE_CXXFLAGS="-p" + + ################ + # Optimization # + ################ + + HIGH_OPT_CXXFLAGS="-O3" + DEBUG_OPT_CXXFLAGS="-O0" + NO_OPT_CXXFLAGS="-O0" + + ############ + # Warnings # + ############ + + ############################# + # Version-specific warnings # + ############################# + + ################# + # Flags are set # + ################# + cxx_flags_set=yes + +fi + +# Clear cc info if no flags set +if test "X-$cxx_flags_set" = "X-"; then + cxx_vendor= + cxx_version= +fi diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 0fef1616984..6d96dc3c7b9 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -199,6 +199,10 @@ if test -z "$CXX"; then CXX_BASENAME=g++ fi +# Figure out Intel CXX compiler flags +# Do this ahead of GNU to avoid icpc being detected as g++ +. $srcdir/config/intel-cxxflags + # Figure out GNU CXX compiler flags . $srcdir/config/gnu-cxxflags diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 20d561c68b7..645c8db1975 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -49,6 +49,14 @@ New Features Configuration: ------------- + - Adds C++ Autotools configuration file for Intel + + * Checks for icpc as the compiler + * Sets std=c++11 + * Copies most non-warning flags from intel-flags + + (DER - 2021/06/02) + - A C++11-compliant compiler is now required to build the C++ wrappers CMAKE_CXX_STANDARD is now set to 11 when building with CMake and @@ -56,7 +64,6 @@ New Features (DER - 2021/05/27) - - CMake will now run the shell script tests in test/ by default The test directory includes several shell script tests that previously diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index baedbf1b56e..f57740e9d39 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -5487,8 +5487,7 @@ H5VLlink_optional_op(const char *app_file, const char *app_func, unsigned app_li herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE9("e", "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, - es_id); + H5TRACE9("e", "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, es_id); /* Check arguments */ /* name is verified in H5VL_setup_name_args() */ @@ -6066,8 +6065,7 @@ H5VLobject_optional_op(const char *app_file, const char *app_func, unsigned app_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE9("e", "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, - es_id); + H5TRACE9("e", "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, es_id); /* Check arguments */ /* name is verified in H5VL_setup_name_args() */ From 562ad6d196fd02b870410845a1e90c07febe4df5 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 3 Jun 2021 00:32:26 +0000 Subject: [PATCH 2/2] Committing clang-format changes --- src/H5VLcallback.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index f57740e9d39..baedbf1b56e 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -5487,7 +5487,8 @@ H5VLlink_optional_op(const char *app_file, const char *app_func, unsigned app_li herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE9("e", "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, es_id); + H5TRACE9("e", "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, + es_id); /* Check arguments */ /* name is verified in H5VL_setup_name_args() */ @@ -6065,7 +6066,8 @@ H5VLobject_optional_op(const char *app_file, const char *app_func, unsigned app_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE9("e", "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, es_id); + H5TRACE9("e", "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, + es_id); /* Check arguments */ /* name is verified in H5VL_setup_name_args() */