diff options
Diffstat (limited to 'config')
140 files changed, 3703 insertions, 2057 deletions
diff --git a/config/BlankForm b/config/BlankForm index a452f92..ce4bf53 100644 --- a/config/BlankForm +++ b/config/BlankForm @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. diff --git a/config/COPYING b/config/COPYING deleted file mode 100644 index 6497ace..0000000 --- a/config/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are 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://support.hdfgroup.org/ftp/HDF5/releases. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/config/Makefile.am.blank b/config/Makefile.am.blank index b01735b..37d0e6e 100644 --- a/config/Makefile.am.blank +++ b/config/Makefile.am.blank @@ -6,7 +6,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. diff --git a/config/apple b/config/apple index 0b15dfe..98dede2 100644 --- a/config/apple +++ b/config/apple @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. @@ -49,6 +49,7 @@ fi # Figure out compiler flags . $srcdir/config/gnu-flags +. $srcdir/config/clang-flags # temp patch: if GCC 4.2.1 is used in Lion or Mountain Lion systems, do not # use -O option as it causes failures in test/dt_arith. case "$host_os" in @@ -155,11 +156,13 @@ esac # get c++ version info case $CXX in clang++) + . $srcdir/config/clang-cxxflags cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ grep 'Apple' | sed 's/(.*//'` ;; *g++*) + . $srcdir/config/gnu-cxxflags cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'` ;; diff --git a/config/cce-fflags b/config/cce-fflags index 9a1c685..813d4c7 100644 --- a/config/cce-fflags +++ b/config/cce-fflags @@ -6,7 +6,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. diff --git a/config/cce-flags b/config/cce-flags index acab73c..0903dec 100644 --- a/config/cce-flags +++ b/config/cce-flags @@ -6,7 +6,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. diff --git a/config/clang-cxxflags b/config/clang-cxxflags new file mode 100644 index 0000000..23ba6a3 --- /dev/null +++ b/config/clang-cxxflags @@ -0,0 +1,189 @@ +# -*- shell-script -*- +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# 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 +# Clang clang++ compiler or a derivative. It is careful not to do anything +# if the compiler is not Clang; otherwise 'cxx_flags_set' is set to 'yes' +# + +# +# For now, do not promote any warnings to errors. +# +PROMOTE_ERRORS_DFLT=no + +# +# This filter rewrites -Werror= as -W, in that way demoting warnings +# promoted to errors back to warnings, if PROMOTE_ERRORS is no. +# +demote_errors() +{ + if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then + sed 's,-Werror=,-W,g' + else + cat + fi +} + +# +# Prepend `$srcdir/config/clang-warnings/` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_clang_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/clang-warnings/${arg} + done) + IFS=' ' echo "$*" +} +# Get the compiler version in a way that works for clang++ +# unless a compiler version is already known +# +# cxx_vendor: The compiler name: clang++ +# cxx_version: Version number: 6.0.0, 7.3.0, ... 10.0.1 +# +if test "X-" = "X-$cxx_flags_set"; then + # clang++ -v will return version number following "clang" on Linux machines, + # but on Macs the version number will follow "Apple LLVM version" + cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 |\ + grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`" + if test -n "$cxx_version"; then + cxx_vendor="clang" + else + cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 |\ + grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`" + if test -n "$cxx_version"; then + cxx_vendor="Apple LLVM" + fi + fi + if test "X-" != "X-$cxx_version"; then + + # Get the compiler version numbers + 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 -f3 -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 + fi +fi + +if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then + echo "compiler '$CXX' is $cxx_vendor-$cxx_version" + ############################### + # Architecture-specific flags # + ############################### + + arch= + case "$host_os-$host_cpu" in + # FreeBSD sets the information from "uname -m" to the general machine + # architecture, not the specific CPU for the machine, so even our + # Pentium II Xeon server is set to "i386". Once we know we are on a FreeBSD + # machine, use the "sysctl" command to get the CPU hardware model. + freebsd*-i386) + host_cpu_model=`sysctl -n hw.model` + case "$host_cpu_model" in + # Hmm.. this might not catch Celerons, but it won't hurt them either... + *Pro*|*II*|*III*|*IV*|*Athlon*) + # architecture-specific optimizations cause problems + # for some users who build binaries to be used on + # multiple architectures. + # arch="-march=i686" + ;; + esac + ;; + + *-i686) + # architecture-specific optimizations cause problems + # for some users who build binaries to be used on + # multiple architectures. + # arch="-march=i686" + ;; + esac + + H5_CXXFLAGS="$H5_CXXFLAGS $arch" + + ############## + # Production # + ############## + + # NDEBUG is handled explicitly by the configure script + PROD_CXXFLAGS= + + ######### + # Debug # + ######### + + # NDEBUG is handled explicitly by the configure script + # -g is handled by the symbols flags + DEBUG_CXXFLAGS="-ftrapv -fno-common" + + ########### + # Symbols # + ########### + + NO_SYMBOLS_CXXFLAGS= + SYMBOLS_CXXFLAGS="-g -fno-omit-frame-pointer" + + ############# + # Profiling # + ############# + + PROFILE_CXXFLAGS="-pg" + + ################ + # Optimization # + ################ + + HIGH_OPT_CXXFLAGS="-O3" + DEBUG_OPT_CXXFLAGS="-g" + NO_OPT_CXXFLAGS="-O0" + + ############ + # Warnings # + ############ + + ########### + # General # + ########### + + H5_CXXFLAGS="$H5_CXXFLAGS $(load_clang_arguments general)" + H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_clang_arguments error-general)" + H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_clang_arguments noerror-general)" + + ###################### + # Developer warnings # + ###################### + + NO_DEVELOPER_WARNING_CXXFLAGS=$(load_clang_arguments no-developer-general) + DEVELOPER_WARNING_CXXFLAGS=$(load_clang_arguments developer-general) + + ############################# + # Version-specific warnings # + ############################# + + + ################# + # Flags are set # + ################# + cxx_flags_set=yes +fi + +# Clear cxx info if no flags set +if test "X$cxx_flags_set" = "X"; then + cxx_vendor= + cxx_version= +fi + diff --git a/config/clang-flags b/config/clang-flags new file mode 100644 index 0000000..92a8973 --- /dev/null +++ b/config/clang-flags @@ -0,0 +1,211 @@ +# -*- shell-script -*- +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# 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 +# Clang compiler or a derivative. It is careful not to do anything +# if the compiler is not Clang; otherwise 'cc_flags_set' is set to 'yes' +# + +# +# For now, do not promote any warnings to errors. +# +PROMOTE_ERRORS_DFLT=no + +# +# This filter rewrites -Werror= as -W, in that way demoting warnings +# promoted to errors back to warnings, if PROMOTE_ERRORS is no. +# +demote_errors() +{ + if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then + sed 's,-Werror=,-W,g' + else + cat + fi +} + +# +# Prepend `$srcdir/config/clang-warnings/` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_clang_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/clang-warnings/${arg} + done) + IFS=' ' echo "$*" +} +# Get the compiler version in a way that works for clang +# unless a compiler version is already known +# +# cc_vendor: The compiler name: clang +# cc_version: Version number: 6.0.0, 7.3.0, ... 10.0.1 +# +if test "X-" = "X-$cc_flags_set"; then + # clang -v will return version number following "clang" on Linux machines, + # but on Xcode the version number will follow "Apple LLVM version" + # Note that the Xcode reported LLVM version doesn't match the canonical + # LLVM version, so you'll need to do different version checks for + # Xcode. + cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\ + grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`" + if test -n "$cc_version"; then + cc_vendor="clang" + else + cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\ + grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`" + if test -n "$cc_version"; then + cc_vendor="Apple LLVM" + fi + fi + if test "X-" != "X-$cc_version"; then + + # Get the compiler version numbers + cc_vers_major=`echo $cc_version | cut -f1 -d.` + cc_vers_minor=`echo $cc_version | cut -f2 -d.` + cc_vers_patch=`echo $cc_version | cut -f3 -d.` + test -n "$cc_vers_major" || cc_vers_major=0 + test -n "$cc_vers_minor" || cc_vers_minor=0 + test -n "$cc_vers_patch" || cc_vers_patch=0 + fi +fi + +if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then + echo "compiler '$CC' is $cc_vendor-$cc_version" + ############################### + # Architecture-specific flags # + ############################### + + arch= + case "$host_os-$host_cpu" in + # FreeBSD sets the information from "uname -m" to the general machine + # architecture, not the specific CPU for the machine, so even our + # Pentium II Xeon server is set to "i386". Once we know we are on a FreeBSD + # machine, use the "sysctl" command to get the CPU hardware model. + freebsd*-i386) + host_cpu_model=`sysctl -n hw.model` + case "$host_cpu_model" in + # Hmm.. this might not catch Celerons, but it won't hurt them either... + *Pro*|*II*|*III*|*IV*|*Athlon*) + # architecture-specific optimizations cause problems + # for some users who build binaries to be used on + # multiple architectures. + # arch="-march=i686" + ;; + esac + ;; + + *-i686) + # architecture-specific optimizations cause problems + # for some users who build binaries to be used on + # multiple architectures. + # arch="-march=i686" + ;; + esac + + case "$host_os-$host_cpu" in + # cygwin needs the "-std=c99" flag removed, so make + # a specific case for Cygwin without the flag and a default + # case to add the flag everywhere else + cygwin-*) + ;; + + *) + H5_CFLAGS="$H5_CFLAGS -std=c99" + ;; + esac + + H5_CFLAGS="$H5_CFLAGS $arch" + + ############## + # Production # + ############## + + # NDEBUG is handled explicitly by the configure script + PROD_CFLAGS= + + ######### + # Debug # + ######### + + # NDEBUG is handled explicitly by the configure script + # -g is handled by the symbols flags + DEBUG_CFLAGS="-ftrapv -fno-common" + + ########### + # Symbols # + ########### + + NO_SYMBOLS_CFLAGS= + SYMBOLS_CFLAGS="-g" + + ############# + # Profiling # + ############# + + PROFILE_CFLAGS="-pg" + + ################ + # Optimization # + ################ + + HIGH_OPT_CFLAGS="-O3" + NO_OPT_CFLAGS="-O0" + + # -Og is only understood by clang 4+ and Xcode 9+ + # Otherwise use -O1 (which is what -Og usually equates to) + if test "X-clang" = "X-$cc_vendor" -a $cc_vers_major -ge 4 -o "X-Apple LLVM" = "X-$cc_vendor" -a $cc_vers_major -ge 9; then + DEBUG_OPT_CFLAGS="-Og" + else + DEBUG_OPT_CFLAGS="-O1" + fi + + ############ + # Warnings # + ############ + + ########### + # General # + ########### + + H5_CFLAGS="$H5_CFLAGS $(load_clang_arguments general)" + H5_ECFLAGS="$H5_ECFLAGS $(load_clang_arguments error-general)" + H5_NECFLAGS="$H5_NECFLAGS $(load_clang_arguments noerror-general)" + + ###################### + # Developer warnings # + ###################### + + NO_DEVELOPER_WARNING_CFLAGS=$(load_clang_arguments no-developer-general) + DEVELOPER_WARNING_CFLAGS=$(load_clang_arguments developer-general) + + ############################# + # Version-specific warnings # + ############################# + + + ################# + # Flags are set # + ################# + cc_flags_set=yes +fi + +# Clear cc info if no flags set +if test "X$cc_flags_set" = "X"; then + cc_vendor= + cc_version= +fi + diff --git a/config/clang-warnings/developer-general b/config/clang-warnings/developer-general new file mode 100644 index 0000000..74d8404 --- /dev/null +++ b/config/clang-warnings/developer-general @@ -0,0 +1,4 @@ +-Wformat-nonliteral +-Wmissing-noreturn +-Wsometimes-uninitialized +-Wswitch-enum diff --git a/config/clang-warnings/error-general b/config/clang-warnings/error-general new file mode 100644 index 0000000..883dff7 --- /dev/null +++ b/config/clang-warnings/error-general @@ -0,0 +1,80 @@ +# +# HDF5 code should not trigger the following warnings under any +# circumstances, so ask the compiler to treat them as errors: +# +-Werror=bad-function-cast +-Werror=implicit-function-declaration +-Werror=incompatible-pointer-types +-Werror=missing-declarations +-Werror=packed +-Werror=shadow +-Werror=switch +# +# NOTE: Following files are not compatible with incompatible-pointer-types as errors +# src/H5Dchunk.c,src/H5Dint.c,src/H5Gint.c,src/H5HFcache.c,src/H5I.c,src/H5T.c +-Wno-error=incompatible-pointer-types-discards-qualifiers +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDdirect.c,H5FDmpio.c,H5FDros3.c, +# -Werror=unused-function +# +-Wunused-function +# +# H5FDdrvr_module.h +# -Werror=unused-variable +# +-Wunused-variable +# +# H5VLpassthru.c +# -Werror=unused-parameter +# +-Wunused-parameter +# +# +# +# NOTE: Tools files are not compatible with these warnings as errors +# lib/h5tools.c +# -Werror=cast-align +# +-Wcast-align +# +# lib/h5tools_utils.c +# -Werror=unused-parameter +# +# +# NOTE: JNI files are not compatible with these warnings as errors +# jni/h5pDCPLImp.c,jni/nativeData.c,jni/h5util.c,jni/h5rImp.c +# jni/h5sImp.c,jni/h5tImp.c +# -Werror=cast-align +# jni/h5util.c +# -Werror=format(-overflow) +# +-Wformat +# +# +#Examples and tests do not use the same set of extensive warning flags as libraries +# Here is a list of tests and examples that have issues with the stricter warnings as error +# +# NOTE: Test files are not compatible with these warnings as errors +# thread_id.c, +# -Werror=unused-function +# dsets.c +# -Werror=unused-parameter +# +# +# NOTE: Examples files are not compatible with these warnings as errors +# h5_vds-eiger.c,h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c,h5_vds-percival-unlim-maxmin.c +# h5_vds-percival.c,h5_read.c,h5_rdwt.c,h5_mount.c,h5_extend.c,h5_extend_write.c +# h5_write.c,h5_vds-simpleIO.c,h5_ref2reg_deprec.c,h5_crtgrp.c,h5_select.c +# h5_vds-percival-unlim.c,h5_crtatt.c,h5_group.c,h5_attribute.c,h5_crtdat.c +# h5_reference_deprec.c +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=strict-prototypes +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=old-style-definition +# h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c, +# -Werror=unused-variable +# h5_elink_unix2win.c,h5_extlink.c,h5_attribute.c +# -Werror=unused-parameter + diff --git a/config/clang-warnings/general b/config/clang-warnings/general new file mode 100644 index 0000000..f0c9b93 --- /dev/null +++ b/config/clang-warnings/general @@ -0,0 +1,26 @@ +# general clang warnings flags +-Wall +-Warray-bounds +-Wcast-qual +-Wconversion +-Wdouble-promotion +-Wextra +-Wformat=2 +-Wframe-larger-than=16384 +-Wimplicit-fallthrough +# +# NOTE: Due to the divergence in the C and C++, we're dropping support for +# compiling the C library with a C++ compiler and dropping the -Wc++-compat +# warning. +# +-Wno-c++-compat +# +# NOTE: Disable the -Wformat-nonliteral from -Wformat=2 here and re-add +# it to the developer flags. +# +-Wno-format-nonliteral +-Wnull-dereference +-Wunused-const-variable +-Wwrite-strings +-Wpedantic +-Wvolatile-register-var diff --git a/config/clang-warnings/no-developer-general b/config/clang-warnings/no-developer-general new file mode 100644 index 0000000..2bf1703 --- /dev/null +++ b/config/clang-warnings/no-developer-general @@ -0,0 +1 @@ +-Wno-missing-noreturn diff --git a/config/clang-warnings/noerror-general b/config/clang-warnings/noerror-general new file mode 100644 index 0000000..4690ebd --- /dev/null +++ b/config/clang-warnings/noerror-general @@ -0,0 +1,82 @@ +# +# These warnings will be treated as errors, using the error-general file, +# when HDF5_ENABLE_WARNINGS_AS_ERRORS is set to true for CMake or +# the --enable-warnings-as-errors option is specified for configure. +# Otherwise this file will be used to treat them as warnings. +# +-Wbad-function-cast +-Wimplicit-function-declaration +-Wincompatible-pointer-types +-Wmissing-declarations +-Wpacked +-Wshadow +-Wswitch +# +# NOTE: Following files are not compatible with incompatible-pointer-types as errors +# src/H5Dchunk.c,src/H5Dint.c,src/H5Gint.c,src/H5HFcache.c,src/H5I.c,src/H5T.c +-Wno-error=incompatible-pointer-types-discards-qualifiers +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDdirect.c,H5FDmpio.c,H5FDros3.c, +# -Werror=unused-function +# +-Wunused-function +# +# H5FDdrvr_module.h +# -Werror=unused-variable +# +-Wunused-variable +# +# H5VLpassthru.c +# -Werror=unused-parameter +# +-Wunused-parameter +# +# +# +# NOTE: Tools files are not compatible with these warnings as errors +# lib/h5tools.c +# -Werror=cast-align +# +-Wcast-align +# +# lib/h5tools_utils.c +# -Werror=unused-parameter +# +# +# NOTE: JNI files are not compatible with these warnings as errors +# jni/h5pDCPLImp.c,jni/nativeData.c,jni/h5util.c,jni/h5rImp.c +# jni/h5sImp.c,jni/h5tImp.c +# -Werror=cast-align +# jni/h5util.c +# -Werror=format(-overflow) +# +-Wformat +# +# +#Examples and tests do not use the same set of extensive warning flags as libraries +# Here is a list of tests and examples that have issues with the stricter warnings as error +# +# NOTE: Test files are not compatible with these warnings as errors +# thread_id.c, +# -Werror=unused-function +# dsets.c +# -Werror=unused-parameter +# +# +# NOTE: Examples files are not compatible with these warnings as errors +# h5_vds-eiger.c,h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c,h5_vds-percival-unlim-maxmin.c +# h5_vds-percival.c,h5_read.c,h5_rdwt.c,h5_mount.c,h5_extend.c,h5_extend_write.c +# h5_write.c,h5_vds-simpleIO.c,h5_ref2reg_deprec.c,h5_crtgrp.c,h5_select.c +# h5_vds-percival-unlim.c,h5_crtatt.c,h5_group.c,h5_attribute.c,h5_crtdat.c +# h5_reference_deprec.c +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=strict-prototypes +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=old-style-definition +# h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c, +# -Werror=unused-variable +# h5_elink_unix2win.c,h5_extlink.c,h5_attribute.c +# -Werror=unused-parameter + diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index fa4c66e..f958804 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -18,23 +18,18 @@ set (CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 50000) set (CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} -# "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" -# "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument" -# "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument" "note.*expected.*void.*but argument is of type.*volatile" -# "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type" -# "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244" "src.ZLIB.*:[ \t]*warning" "warning LNK4197:.*ZLIB-prefix" "src.SZIP.*:[ \t]*warning" # "POSIX name for this item is deprecated" "disabling jobserver mode" "config.cmake.xlatefile.c" -# "warning.*implicit declaration of function" "warning.*unknown pragma" "warning.*unrecognized .pragma" # "note: expanded from macro" -# "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro" + # HDDFFV-11074 + "This directive is not standard" ) set (CTEST_CUSTOM_MEMCHECK_IGNORE @@ -142,8 +137,8 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5REPACK-bug1814-clear-objects H5REPACK-HDFFV-5932-clear-objects H5REPACK-HDFFV-7840-clear-objects - H5REPACK_META-meta_long_N-clear-objects - H5REPACK_META-meta_short_N-clear-objects + H5REPACK_META-meta_long-clear-objects + H5REPACK_META-meta_short-clear-objects H5REPACK_STAT-GS_AGGR-clear-objects H5REPACK_STAT-S_AGGR-clear-objects H5REPACK_STAT-SP_NONE-clear-objects diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake index 5478862..0ed9063 100644 --- a/config/cmake/CTestScript.cmake +++ b/config/cmake/CTestScript.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 11bf39c..902ddd3 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -28,6 +28,18 @@ if (HDF5_STRICT_FORMAT_CHECKS) endif () MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) +#----------------------------------------------------------------------------- +# Option for --enable-threadsafe +#----------------------------------------------------------------------------- +# Recursive RW locks are not supported on Windows (yet) +if (NOT WINDOWS) + option (HDF5_USE_RECURSIVE_RW_LOCKS "Whether to use recursive RW locks for thread-safety" OFF) + if (HDF5_USE_RECURSIVE_RW_LOCKS) + set (${HDF_PREFIX}_USE_RECURSIVE_RW_LOCKS 1) + endif () + MARK_AS_ADVANCED (HDF5_USE_RECURSIVE_RW_LOCKS) +endif () + # ---------------------------------------------------------------------- # Decide whether the data accuracy has higher priority during data # conversions. If not, some hard conversions will still be prefered even @@ -61,6 +73,31 @@ if (HDF5_ENABLE_CODESTACK) endif () MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK) +# ---------------------------------------------------------------------- +# Check if they would like to use file locking by default +#----------------------------------------------------------------------------- +option (HDF5_USE_FILE_LOCKING "Use file locking by default (mainly for SWMR)" ON) +if (HDF5_USE_FILE_LOCKING) + set (${HDF_PREFIX}_USE_FILE_LOCKING 1) +endif () + +# ---------------------------------------------------------------------- +# Check if they would like to ignore file locks when disabled on a file system +#----------------------------------------------------------------------------- +option (HDF5_IGNORE_DISABLED_FILE_LOCKS "Ignore file locks when disabled on file system" ON) +if (HDF5_IGNORE_DISABLED_FILE_LOCKS) + set (${HDF_PREFIX}_IGNORE_DISABLED_FILE_LOCKS 1) +endif () + +# Set the libhdf5.settings file variable +if (HDF5_IGNORE_DISABLED_FILE_LOCKS AND HDF5_USE_FILE_LOCKING) + set (HDF5_FILE_LOCKING_SETTING "best-effort") +elseif (HDF5_IGNORE_DISABLED_FILE_LOCKS) + set (HDF5_FILE_LOCKING_SETTING "yes") +else () + set (HDF5_FILE_LOCKING_SETTING "no") +endif () + #----------------------------------------------------------------------------- # Are we going to use HSIZE_T #----------------------------------------------------------------------------- @@ -140,14 +177,18 @@ if (NOT WINDOWS) add_definitions ("-D_GNU_SOURCE") else () set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) endif () else () set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) @@ -167,33 +208,157 @@ option (HDF5_ENABLE_ROS3_VFD "Build the ROS3 Virtual File Driver" OFF) list (APPEND LINK_LIBS ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) INCLUDE_DIRECTORIES (${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) else () - message (STATUS "The Read-Only S3 VFD was requested but cannot be built.\nPlease check that openssl and cURL are available on your\nsystem, and/or re-configure without option HDF5_ENABLE_ROS3_VFD.") + message (WARNING "The Read-Only S3 VFD was requested but cannot be built.\nPlease check that openssl and cURL are available on your\nsystem, and/or re-configure without option HDF5_ENABLE_ROS3_VFD.") endif () endif () +# ---------------------------------------------------------------------- +# Check whether we can build the Mirror VFD +# Header-check flags set in config/cmake_ext_mod/ConfigureChecks.cmake +# ---------------------------------------------------------------------- +option (HDF5_ENABLE_MIRROR_VFD "Build the Mirror Virtual File Driver" OFF) +if (H5FD_ENABLE_MIRROR_VFD) + if ( ${HDF_PREFIX}_HAVE_NETINET_IN_H AND + ${HDF_PREFIX}_HAVE_NETDB_H AND + ${HDF_PREFIX}_HAVE_ARPA_INET_H AND + ${HDF_PREFIX}_HAVE_SYS_SOCKET_H AND + ${HDF_PREFIX}_HAVE_FORK) + set (${HDF_PREFIX}_HAVE_MIRROR_VFD 1) + else() + message(WARNING "The socket-based Mirror VFD was requested but cannot be built. System prerequisites are not met.") + endif() +endif() + #----------------------------------------------------------------------------- # Check if C has __float128 extension #----------------------------------------------------------------------------- -CHECK_TYPE_SIZE("__float128" ${HDF_PREFIX}_SIZEOF___FLOAT128) -if (${${HDF_PREFIX}_SIZEOF___FLOAT128}) +HDF_CHECK_TYPE_SIZE(__float128 _SIZEOF___FLOAT128) +if (${_SIZEOF___FLOAT128}) set (${HDF_PREFIX}_HAVE_FLOAT128 1) + set (${HDF_PREFIX}_SIZEOF___FLOAT128 ${_SIZEOF___FLOAT128}) else () set (${HDF_PREFIX}_HAVE_FLOAT128 0) set (${HDF_PREFIX}_SIZEOF___FLOAT128 0) endif () -CHECK_TYPE_SIZE("_Quad" ${HDF_PREFIX}_SIZEOF__QUAD) -if (NOT ${${HDF_PREFIX}_SIZEOF__QUAD}) +HDF_CHECK_TYPE_SIZE(_Quad _SIZEOF__QUAD) +if (NOT ${_SIZEOF__QUAD}) set (${HDF_PREFIX}_SIZEOF__QUAD 0) +else () + set (${HDF_PREFIX}_SIZEOF__QUAD ${_SIZEOF__QUAD}) endif () #----------------------------------------------------------------------------- +# The provided CMake C macros don't provide a general compile/run function +# so this one is used. +#----------------------------------------------------------------------------- +set (RUN_OUTPUT_PATH_DEFAULT ${CMAKE_BINARY_DIR}) +macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR) + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Detecting C ${FUNCTION_NAME}") + endif () + file (WRITE + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c + ${SOURCE_CODE} + ) + TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c + COMPILE_DEFINITIONS "-D_SIZEOF___FLOAT128=${H5_SIZEOF___FLOAT128};-D_HAVE_QUADMATH_H=${H5_HAVE_QUADMATH_H}" + COMPILE_OUTPUT_VARIABLE COMPILEOUT + RUN_OUTPUT_VARIABLE OUTPUT_VAR + ) + + set (${RETURN_VAR} ${OUTPUT_VAR}) + + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + message (VERBOSE "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") + message (VERBOSE "Test COMPILE_OUTPUT ${COMPILEOUT} ") + message (VERBOSE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + message (VERBOSE "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ") + message (VERBOSE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + endif () + + if (${COMPILE_RESULT_VAR}) + if (${RUN_RESULT_VAR} MATCHES 0) + set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION_NAME}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing C ${FUNCTION_NAME} - OK") + endif () + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining if the C ${FUNCTION_NAME} exists passed with the following output:\n" + "${OUTPUT_VAR}\n\n" + ) + else () + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing C ${FUNCTION_NAME} - Fail") + endif () + set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION_NAME}") + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining if the C ${FUNCTION_NAME} exists failed with the following output:\n" + "${OUTPUT_VAR}\n\n") + endif () + else () + message (FATAL_ERROR "Compilation of C ${FUNCTION_NAME} - Failed") + endif () +endmacro () + +set (PROG_SRC + " +#include <float.h>\n\ +#include <stdio.h>\n\ +#define CHECK_FLOAT128 _SIZEOF___FLOAT128\n\ +#if CHECK_FLOAT128!=0\n\ +#if _HAVE_QUADMATH_H!=0\n\ +#include <quadmath.h>\n\ +#endif\n\ +#ifdef FLT128_DIG\n\ +#define C_FLT128_DIG FLT128_DIG\n\ +#else\n\ +#define C_FLT128_DIG 0\n\ +#endif\n\ +#else\n\ +#define C_FLT128_DIG 0\n\ +#endif\n\ +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n\ +#define C_LDBL_DIG DECIMAL_DIG\n\ +#else\n\ +#define C_LDBL_DIG LDBL_DIG\n\ +#endif\n\nint main() {\nFILE *pFile = fopen(\"pac_Cconftest.out\",\"w\")\\\;\nfprintf(pFile, \"\\%d\\\;\\%d\\\;\", C_LDBL_DIG, C_FLT128_DIG)\\\;\n\nreturn 0\\\;\n}\n + " +) + +C_RUN ("maximum decimal precision for C" ${PROG_SRC} PROG_RES) +file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_Cconftest.out" PROG_OUTPUT4) +message (STATUS "Testing maximum decimal precision for C - ${PROG_OUTPUT4}") + +# dnl The output from the above program will be: +# dnl -- long double decimal precision -- __float128 decimal precision + +list (GET PROG_OUTPUT4 0 H5_LDBL_DIG) +list (GET PROG_OUTPUT4 1 H5_FLT128_DIG) + +if (${HDF_PREFIX}_SIZEOF___FLOAT128 EQUAL 0 OR FLT128_DIG EQUAL 0) + set (${HDF_PREFIX}_HAVE_FLOAT128 0) + set (${HDF_PREFIX}_SIZEOF___FLOAT128 0) + set (_PAC_C_MAX_REAL_PRECISION ${H5_LDBL_DIG}) +else () + set (_PAC_C_MAX_REAL_PRECISION ${H5_FLT128_DIG}) +endif () +if (NOT ${_PAC_C_MAX_REAL_PRECISION}) + set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION 0) +else () + set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${_PAC_C_MAX_REAL_PRECISION}) +endif () +message (STATUS "maximum decimal precision for C var - ${${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION}") + +#----------------------------------------------------------------------------- # Macro to determine the various conversion capabilities #----------------------------------------------------------------------------- macro (H5ConversionTests TEST msg) if (NOT DEFINED ${TEST}) - # message (STATUS "===> ${TEST}") TRY_RUN (${TEST}_RUN ${TEST}_COMPILE ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_DIR}/ConversionTests.c @@ -203,17 +368,23 @@ macro (H5ConversionTests TEST msg) if (${TEST}_COMPILE) if (${TEST}_RUN MATCHES 0) set (${TEST} 1 CACHE INTERNAL ${msg}) - message (STATUS "${msg}... yes") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... yes") + endif () else () set (${TEST} "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" ) endif () else () set (${TEST} "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" ) diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c index 6d597a0..f80959f 100644 --- a/config/cmake/ConversionTests.c +++ b/config/cmake/ConversionTests.c @@ -5,7 +5,7 @@ * 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://support.hdfgroup.org/ftp/HDF5/releases. * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/config/cmake/H5cxx_config.h.in b/config/cmake/H5cxx_config.h.in index d1dd42b..b5ae8ce 100644 --- a/config/cmake/H5cxx_config.h.in +++ b/config/cmake/H5cxx_config.h.in @@ -5,7 +5,7 @@ * 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://support.hdfgroup.org/ftp/HDF5/releases. * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 120c023..e163d3a 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -5,7 +5,7 @@ * 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://support.hdfgroup.org/ftp/HDF5/releases. * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -26,16 +26,13 @@ /* Define if using a Windows compiler (i.e. Visual Studio) */ #cmakedefine H5_HAVE_VISUAL_STUDIO @H5_HAVE_VISUAL_STUDIO@ -/* Define if building universal (internal helper macro) */ -#cmakedefine H5_AC_APPLE_UNIVERSAL_BUILD @H5_AC_APPLE_UNIVERSAL_BUILD@ - /* Define if C++ compiler recognizes offsetof */ #cmakedefine H5_CXX_HAVE_OFFSETOF @CXX_HAVE_OFFSETOF@ /* Define the default plugins path to compile */ #cmakedefine H5_DEFAULT_PLUGINDIR "@H5_DEFAULT_PLUGINDIR@" -/* Define if `dev_t' is a scalar */ +/* Define if dev_t is a scalar */ #cmakedefine H5_DEV_T_IS_SCALAR @H5_DEV_T_IS_SCALAR@ /* Define to dummy `main' function (if any) required to link to the Fortran @@ -91,6 +88,9 @@ /* Define to 1 if you have the `alarm' function. */ #cmakedefine H5_HAVE_ALARM @H5_HAVE_ALARM@ +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#cmakedefine H5_HAVE_ARPA_INET_H @H5_HAVE_ARPA_INET_H@ + /* Define to 1 if you have the `asprintf' function. */ #cmakedefine H5_HAVE_ASPRINTF @H5_HAVE_ASPRINTF@ @@ -264,27 +264,33 @@ /* Define to 1 if you have the `lstat' function. */ #cmakedefine H5_HAVE_LSTAT @H5_HAVE_LSTAT@ -/* Define to 1 if you have the <mach/mach_time.h> header file. */ -#cmakedefine H5_HAVE_MACH_MACH_TIME_H @H5_HAVE_MACH_MACH_TIME_H@ - /* Define if the map API (H5M) should be compiled */ #cmakedefine H5_HAVE_MAP_API @H5_HAVE_MAP_API@ /* Define to 1 if you have the <memory.h> header file. */ #cmakedefine H5_HAVE_MEMORY_H @H5_HAVE_MEMORY_H@ +/* Define whether the Mirror virtual file driver (VFD) will be compiled */ +#cmakedefine H5_HAVE_MIRROR_VFD @H5_HAVE_MIRROR_VFD@ + /* Define if we have MPE support */ #cmakedefine H5_HAVE_MPE @H5_HAVE_MPE@ /* Define to 1 if you have the <mpe.h> header file. */ #cmakedefine H5_HAVE_MPE_H @H5_HAVE_MPE_H@ -/* Define if MPI_Comm_c2f and MPI_Comm_f2c exists */ +/* Define if MPI_Comm_c2f and MPI_Comm_f2c exist */ #cmakedefine H5_HAVE_MPI_MULTI_LANG_Comm @H5_HAVE_MPI_MULTI_LANG_Comm@ -/* Define if MPI_Info_c2f and MPI_Info_f2c exists */ +/* Define if MPI_Info_c2f and MPI_Info_f2c exist */ #cmakedefine H5_HAVE_MPI_MULTI_LANG_Info @H5_HAVE_MPI_MULTI_LANG_Info@ +/* Define to 1 if you have the <netdb.h> header file. */ +#cmakedefine H5_HAVE_NETDB_H @H5_HAVE_NETDB_H@ + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#cmakedefine H5_HAVE_NETINET_IN_H @H5_HAVE_NETINET_IN_H@ + /* Define to 1 if you have the <openssl/evp.h> header file. */ #cmakedefine H5_HAVE_OPENSSL_EVP_H @H5_HAVE_OPENSSL_EVP_H@ @@ -412,9 +418,6 @@ /* Define to 1 if you have the <sys/stat.h> header file. */ #cmakedefine H5_HAVE_SYS_STAT_H @H5_HAVE_SYS_STAT_H@ -/* Define to 1 if you have the <sys/timeb.h> header file. */ -#cmakedefine H5_HAVE_SYS_TIMEB_H @H5_HAVE_SYS_TIMEB_H@ - /* Define to 1 if you have the <sys/time.h> header file. */ #cmakedefine H5_HAVE_SYS_TIME_H @H5_HAVE_SYS_TIME_H@ @@ -483,6 +486,9 @@ /* Define if the compiler understands __inline__ */ #cmakedefine H5_HAVE___INLINE__ @H5_HAVE___INLINE__@ +/* Define if the library will ignore file locks when disabled */ +#cmakedefine H5_IGNORE_DISABLED_FILE_LOCKS @H5_IGNORE_DISABLED_FILE_LOCKS@ + /* Define if the high-level library headers should be included in hdf5.h */ #cmakedefine H5_INCLUDE_HL @H5_INCLUDE_HL@ @@ -509,7 +515,7 @@ #cmakedefine H5_LT_OBJDIR @H5_LT_OBJDIR@ /* Define to enable internal memory allocation sanity checking. */ -/* #cmakedefine H5_MEMORY_ALLOC_SANITY_CHECK @H5_MEMORY_ALLOC_SANITY_CHECK@ ** Define in CMakeLists.txt */ +#cmakedefine H5_MEMORY_ALLOC_SANITY_CHECK @H5_MEMORY_ALLOC_SANITY_CHECK@ /* Define if we can violate pointer alignment restrictions */ #cmakedefine H5_NO_ALIGNMENT_RESTRICTIONS @H5_NO_ALIGNMENT_RESTRICTIONS@ @@ -539,10 +545,10 @@ #define H5_PACKAGE_VERSION "@HDF5_PACKAGE_VERSION_STRING@" /* Determine the maximum decimal precision in C */ -#cmakedefine H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@ +#define H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@ /* Define Fortran Maximum Real Decimal Precision */ -#cmakedefine H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@ +#define H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@ /* Width for printf() for type `long long' or `__int64', use `ll' */ #cmakedefine H5_PRINTF_LL_WIDTH @H5_PRINTF_LL_WIDTH@ @@ -599,6 +605,7 @@ #cmakedefine H5_SIZEOF_INT_LEAST8_T @H5_SIZEOF_INT_LEAST8_T@ #if !defined(__APPLE__) + /* The size of `size_t', as computed by sizeof. */ #cmakedefine H5_SIZEOF_SIZE_T @H5_SIZEOF_SIZE_T@ @@ -608,8 +615,17 @@ /* The size of `long', as computed by sizeof. */ #cmakedefine H5_SIZEOF_LONG @H5_SIZEOF_LONG@ +/* The size of `long double', as computed by sizeof. */ +#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + #else - # if defined(__LP64__) && __LP64__ + + /* On Apple, to support Universal Binaries (where multiple CPU + architectures exist in one library/executable), we can't assume + the machine doing the compiling has the same endianness or type + sizes as all the various architectures (PowerPC, Intel, ARM). */ + + # if defined(__LP64__) && __LP64__ #define H5_SIZEOF_LONG 8 #define H5_SIZEOF_SIZE_T 8 #define H5_SIZEOF_SSIZE_T 8 @@ -619,10 +635,15 @@ #define H5_SIZEOF_SSIZE_T 4 # endif -#endif + # if defined(__i386__) || defined(__x86_64__) + #define H5_SIZEOF_LONG_DOUBLE 16 + # elif defined(__aarch64__) + #define H5_SIZEOF_LONG_DOUBLE 8 + # else + #cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + # endif -/* The size of `long double', as computed by sizeof. */ -#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ +#endif /* Define size of long long and/or __int64 bit integer type only if the type exists. */ @@ -720,6 +741,12 @@ /* Define using v1.12 public API symbols by default */ #cmakedefine H5_USE_112_API_DEFAULT @H5_USE_112_API_DEFAULT@ +/* Define if the library will use file locking */ +#cmakedefine H5_USE_FILE_LOCKING @H5_USE_FILE_LOCKING@ + +/* Define if the library will use recursive RW locks for thread safety */ +#cmakedefine H5_USE_RECURSIVE_RW_LOCKS @H5_USE_RECURSIVE_RW_LOCKS@ + /* Define if a memory checking tool will be used on the library, to cause library to be very picky about memory operations and also disable the internal free list manager code. */ diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 007bc29..090524a 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # diff --git a/config/cmake/HDF5PluginCache.cmake b/config/cmake/HDF5PluginCache.cmake new file mode 100644 index 0000000..3b085dd --- /dev/null +++ b/config/cmake/HDF5PluginCache.cmake @@ -0,0 +1,29 @@ +# This is the CMakeCache file. + +######################## +# EXTERNAL cache entries +######################## + +# examples are the tests for plugins +set (H5PL_BUILD_TESTING ON CACHE BOOL "Enable h5pl testing" FORCE) +set (BUILD_EXAMPLES ON CACHE BOOL "Build h5pl Examples" FORCE) + +set (HDF5_HDF5_HEADER "h5pubconf.h" CACHE STRING "Name of HDF5 header" FORCE) +set (HDF5_LINK_LIBS ${HDF5_LIBSH_TARGET} CACHE STRING "hdf5 target" FORCE) +#set (HDF5_INCLUDE_DIR $<TARGET_PROPERTY:${HDF5_LIBSH_TARGET},INCLUDE_DIRECTORIES> CACHE PATH "hdf5 include dirs" FORCE) +set (HDF5_INCLUDE_DIR "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}" CACHE PATH "hdf5 include dirs" FORCE) +set (HDF5_INCLUDE_DIRS "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}" CACHE PATH "hdf5 include dirs" FORCE) +set (HDF5_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "hdf5 build folder" FORCE) + +set (HDF5_DUMP_EXECUTABLE $<TARGET_FILE:h5dump-shared> CACHE STRING "hdf5 h5dump target" FORCE) +set (HDF5_REPACK_EXECUTABLE $<TARGET_FILE:h5repack-shared> CACHE STRING "hdf5 h5repack target" FORCE) + +set (H5PL_ALLOW_EXTERNAL_SUPPORT "${HDF5_ALLOW_EXTERNAL_SUPPORT}" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) + +set (H5PL_GIT_URL "https://github.com/HDFGroup/hdf5_plugins.git" CACHE STRING "Use plugins from HDF repository" FORCE) +set (H5PL_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (H5PL_TGZ_NAME "${PLUGIN_TGZ_NAME}" CACHE STRING "Use plugins from compressed file" FORCE) + +set (PL_PACKAGE_NAME "${PLUGIN_PACKAGE_NAME}" CACHE STRING "Name of plugins package" FORCE) +set (H5PL_CPACK_ENABLE OFF CACHE BOOL "Enable the CPACK include and components" FORCE) diff --git a/config/cmake/HDF5PluginMacros.cmake b/config/cmake/HDF5PluginMacros.cmake new file mode 100644 index 0000000..4e05399 --- /dev/null +++ b/config/cmake/HDF5PluginMacros.cmake @@ -0,0 +1,108 @@ +#------------------------------------------------------------------------------- +# Plugins must be built SHARED +#------------------------------------------------------------------------------- +macro (EXTERNAL_PLUGIN_LIBRARY compress_type) + if (${compress_type} MATCHES "GIT") + FetchContent_Declare (PLUGIN + GIT_REPOSITORY ${PLUGIN_URL} + GIT_TAG ${PLUGIN_BRANCH} + ) + elseif (${compress_type} MATCHES "TGZ") + FetchContent_Declare (PLUGIN + URL ${PLUGIN_URL} + URL_HASH "" + ) + endif () + FetchContent_GetProperties(PLUGIN) + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") + endif () + if(NOT PLUGIN_POPULATED) + FetchContent_Populate(PLUGIN) + include (${HDF_RESOURCES_DIR}/HDF5PluginCache.cmake) + set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) + add_subdirectory(${plugin_SOURCE_DIR} ${plugin_BINARY_DIR}) + if (ENABLE_BLOSC) + add_dependencies (h5blosc ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_blosc ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_blosc PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_BSHUF) + add_dependencies (h5bshuf ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_bshuf ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_bshuf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_BZIP2) + add_dependencies (h5bz2 ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_bzip2 ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_bzip2 PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_JPEG) + add_dependencies (h5jpeg ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_jpeg ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_jpeg PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_LZ4) + add_dependencies (h5lz4 ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_lz4 ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_lz4 PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_LZF) + add_dependencies (h5lzf ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_lzf ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_lzf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_MAFISC) + add_dependencies (h5mafisc ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_mafisc ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_mafisc PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_SZF) + add_dependencies (h5szf ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_sz ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_sz PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_ZFP) + add_dependencies (h5zfp ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_zfp ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_zfp PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + endif () + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") + endif () + set (PLUGIN_BINARY_DIR "${plugin_BINARY_DIR}") + set (PLUGIN_SOURCE_DIR "${plugin_SOURCE_DIR}") + set (PLUGIN_LIBRARY "PLUGIN") + set (PLUGIN_FOUND 1) +endmacro () + +#------------------------------------------------------------------------------- +macro (FILTER_OPTION plname) + string(TOLOWER ${plname} PLUGIN_NAME) + option (ENABLE_${plname} "Enable Library Building for ${plname} plugin" ON) + if (ENABLE_${plname}) + option (HDF_${plname}_USE_EXTERNAL "Use External Library Building for ${PLUGIN_NAME} plugin" 0) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + set (HDF_${plname}_USE_EXTERNAL 1 CACHE BOOL "Use External Library Building for ${PLUGIN_NAME} plugin" FORCE) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + set (HDF_${plname}_URL ${HDF_${plname}_GIT_URL}) + set (HDF_${plname}_BRANCH ${HDF_${plname}_GIT_BRANCH}) + elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (NOT TGZPATH) + set (TGZPATH ${H5PL_SOURCE_DIR}) + endif () + set (HDF_${plname}_URL ${TGZPATH}/${HDF_${plname}_TGZ_NAME}) + endif () + endif () + add_subdirectory (${plname}) + set_global_variable (H5PL_LIBRARIES_TO_EXPORT "${H5PL_LIBRARIES_TO_EXPORT};${H5${plname}_LIBRARIES_TO_EXPORT}") + endif () +endmacro () + +#------------------------------------------------------------------------------- +macro (PACKAGE_PLUGIN_LIBRARY compress_type) + if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") + message (STATUS "Filter PLUGIN is to be packaged") + endif () +endmacro () diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index c5d8200..e192ec4 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -41,7 +41,9 @@ else () # so this one is used. #----------------------------------------------------------------------------- macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 RETURN_VAR) - message (STATUS "Detecting Fortran ${FUNCTION_NAME}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Detecting Fortran ${FUNCTION_NAME}") + endif () file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 "${SOURCE_CODE}" @@ -55,18 +57,24 @@ macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 if (${COMPILE_RESULT_VAR}) set(${RETURN_VAR} ${RUN_RESULT_VAR}) if (${RUN_RESULT_VAR} MATCHES 0) - message (STATUS "Testing Fortran ${FUNCTION_NAME} - OK") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION_NAME} - OK") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION_NAME} exists passed\n" ) else () - message (STATUS "Testing Fortran ${FUNCTION_NAME} - Fail") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION_NAME} - Fail") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION_NAME} exists failed: ${RUN_RESULT_VAR}\n" ) endif () else () - message (STATUS "Compiling Fortran ${FUNCTION_NAME} - Fail") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Compiling Fortran ${FUNCTION_NAME} - Fail") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION_NAME} compiles failed: ${COMPILE_RESULT_VAR}\n" ) @@ -121,74 +129,12 @@ endif () # Determine the available KINDs for REALs and INTEGERs #----------------------------------------------------------------------------- -#READ_SOURCE ("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" SOURCE_CODE) -set (PROG_SRC_CODE - " - PROGRAM FC_AVAIL_KINDS - IMPLICIT NONE - INTEGER :: ik, jk, k, max_decimal_prec - INTEGER :: num_rkinds = 1, num_ikinds = 1 - INTEGER, DIMENSION(1:10) :: list_ikinds = -1 - INTEGER, DIMENSION(1:10) :: list_rkinds = -1 - - OPEN(8, FILE='pac_fconftest.out', FORM='formatted') - - ! Find integer KINDs - list_ikinds(num_ikinds)=SELECTED_INT_KIND(1) - DO ik = 2, 36 - k = SELECTED_INT_KIND(ik) - IF(k.LT.0) EXIT - IF(k.GT.list_ikinds(num_ikinds))THEN - num_ikinds = num_ikinds + 1 - list_ikinds(num_ikinds) = k - ENDIF - ENDDO - - DO k = 1, num_ikinds - WRITE(8,'(I0)', ADVANCE='NO') list_ikinds(k) - IF(k.NE.num_ikinds)THEN - WRITE(8,'(A)',ADVANCE='NO') ',' - ELSE - WRITE(8,'()') - ENDIF - ENDDO - - ! Find real KINDs - list_rkinds(num_rkinds)=SELECTED_REAL_KIND(1) - max_decimal_prec = 1 - - prec: DO ik = 2, 36 - exp: DO jk = 1, 17000 - k = SELECTED_REAL_KIND(ik,jk) - IF(k.LT.0) EXIT exp - IF(k.GT.list_rkinds(num_rkinds))THEN - num_rkinds = num_rkinds + 1 - list_rkinds(num_rkinds) = k - ENDIF - max_decimal_prec = ik - ENDDO exp - ENDDO prec - - DO k = 1, num_rkinds - WRITE(8,'(I0)', ADVANCE='NO') list_rkinds(k) - IF(k.NE.num_rkinds)THEN - WRITE(8,'(A)',ADVANCE='NO') ',' - ELSE - WRITE(8,'()') - ENDIF - ENDDO - - WRITE(8,'(I0)') max_decimal_prec - WRITE(8,'(I0)') num_ikinds - WRITE(8,'(I0)') num_rkinds - END PROGRAM FC_AVAIL_KINDS - " -) +READ_SOURCE ("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" SOURCE_CODE) if (NOT CMAKE_VERSION VERSION_LESS "3.14.0") - check_fortran_source_runs (${PROG_SRC_CODE} FC_AVAIL_KINDS_RESULT SRC_EXT f90) + check_fortran_source_runs (${SOURCE_CODE} FC_AVAIL_KINDS_RESULT SRC_EXT f90) else () FORTRAN_RUN ("REAL and INTEGER KINDs" - "${PROG_SRC_CODE}" + "${SOURCE_CODE}" XX YY FC_AVAIL_KINDS_RESULT @@ -252,7 +198,7 @@ foreach (KIND ${VAR}) USE ISO_C_BINDING IMPLICIT NONE INTEGER (KIND=${KIND}) a - OPEN(8,FILE='pac_validIntKinds.out',FORM='formatted') + OPEN(8,FILE='pac_validIntKinds.${KIND}.out',FORM='formatted') WRITE(8,'(I0)') ${FC_SIZEOF_A} CLOSE(8) END @@ -263,7 +209,7 @@ foreach (KIND ${VAR}) else () FORTRAN_RUN("INTEGER KIND SIZEOF" ${PROG_SRC_${KIND}} XX YY VALIDINTKINDS_RESULT_${KIND}) endif () - file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_validIntKinds.out" PROG_OUTPUT1) + file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_validIntKinds.${KIND}.out" PROG_OUTPUT1) string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") set (pack_int_sizeof "${pack_int_sizeof} ${PROG_OUTPUT1},") endforeach () @@ -281,7 +227,9 @@ string (REGEX REPLACE " " "" pack_int_sizeof "${pack_int_sizeof}") set (PAC_FC_ALL_INTEGER_KINDS_SIZEOF "\{${pack_int_sizeof}\}") -message (STATUS "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") +endif () # ********** # REALS # ********** @@ -299,7 +247,7 @@ foreach (KIND ${VAR} ) USE ISO_C_BINDING IMPLICIT NONE REAL (KIND=${KIND}) a - OPEN(8,FILE='pac_validRealKinds.out',FORM='formatted') + OPEN(8,FILE='pac_validRealKinds.${KIND}.out',FORM='formatted') WRITE(8,'(I0)') ${FC_SIZEOF_A} CLOSE(8) END @@ -310,7 +258,7 @@ foreach (KIND ${VAR} ) else () FORTRAN_RUN ("REAL KIND SIZEOF" ${PROG_SRC2_${KIND}} XX YY VALIDREALKINDS_RESULT_${KIND}) endif () - file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_validRealKinds.out" PROG_OUTPUT1) + file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_validRealKinds.${KIND}.out" PROG_OUTPUT1) string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") set (pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},") endforeach () @@ -365,7 +313,7 @@ if (NOT CMAKE_VERSION VERSION_LESS "3.14.0") else () FORTRAN_RUN ("SIZEOF NATIVE KINDs" ${PROG_SRC3} XX YY PAC_SIZEOF_NATIVE_KINDS_RESULT) endif () -file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_sizeof_native_kinds.out" PROG_OUTPUT) +file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_sizeof_native_kinds.out" PROG_OUTPUT3) # dnl The output from the above program will be: # dnl -- LINE 1 -- sizeof INTEGER # dnl -- LINE 2 -- kind of INTEGER @@ -375,14 +323,14 @@ file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_sizeof_native_kinds.out" PROG_OUTPUT) # dnl -- LINE 6 -- kind of DOUBLE PRECISION # Convert the string to a list of strings by replacing the carriage return with a semicolon -string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") +string (REGEX REPLACE "\n" ";" PROG_OUTPUT3 "${PROG_OUTPUT3}") -list (GET PROG_OUTPUT 0 PAC_FORTRAN_NATIVE_INTEGER_SIZEOF) -list (GET PROG_OUTPUT 1 PAC_FORTRAN_NATIVE_INTEGER_KIND) -list (GET PROG_OUTPUT 2 PAC_FORTRAN_NATIVE_REAL_SIZEOF) -list (GET PROG_OUTPUT 3 PAC_FORTRAN_NATIVE_REAL_KIND) -list (GET PROG_OUTPUT 4 PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF) -list (GET PROG_OUTPUT 5 PAC_FORTRAN_NATIVE_DOUBLE_KIND) +list (GET PROG_OUTPUT3 0 PAC_FORTRAN_NATIVE_INTEGER_SIZEOF) +list (GET PROG_OUTPUT3 1 PAC_FORTRAN_NATIVE_INTEGER_KIND) +list (GET PROG_OUTPUT3 2 PAC_FORTRAN_NATIVE_REAL_SIZEOF) +list (GET PROG_OUTPUT3 3 PAC_FORTRAN_NATIVE_REAL_KIND) +list (GET PROG_OUTPUT3 4 PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF) +list (GET PROG_OUTPUT3 5 PAC_FORTRAN_NATIVE_DOUBLE_KIND) if (NOT PAC_FORTRAN_NATIVE_INTEGER_SIZEOF) message (FATAL_ERROR "Failed to find SIZEOF NATIVE INTEGER KINDs for Fortran") @@ -424,124 +372,13 @@ endif () set (${HDF_PREFIX}_H5CONFIG_F_NUM_RKIND "INTEGER, PARAMETER :: num_rkinds = ${NUM_RKIND}") -string (REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS}) -string (REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) -set (${HDF_PREFIX}_H5CONFIG_F_RKIND "INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/${OUT_VAR}/)") - -string (REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) -string (REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) -set (${HDF_PREFIX}_H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${OUT_VAR}/)") - -ENABLE_LANGUAGE (C) - -if (NOT CMAKE_VERSION VERSION_LESS "3.14.0") -include (CheckCSourceRuns) -else () -#----------------------------------------------------------------------------- -# The provided CMake C macros don't provide a general compile/run function -# so this one is used. -#----------------------------------------------------------------------------- -macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR) - message (STATUS "Detecting C ${FUNCTION_NAME}") - if (HDF5_REQUIRED_LIBRARIES) - set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}") - else () - set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - endif () - file (WRITE - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c - ${SOURCE_CODE} - ) - TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR - ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c - CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}" - RUN_OUTPUT_VARIABLE OUTPUT_VAR - ) - - set (${RETURN_VAR} ${OUTPUT_VAR}) - - #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - #message (STATUS "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") - #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - #message (STATUS "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ") - #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - - if (${COMPILE_RESULT_VAR}) - if (${RUN_RESULT_VAR} MATCHES 1) - set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION_NAME}") - message (STATUS "Testing C ${FUNCTION_NAME} - OK") - file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the C ${FUNCTION_NAME} exists passed with the following output:\n" - "${OUTPUT_VAR}\n\n" - ) - else () - message (STATUS "Testing C ${FUNCTION_NAME} - Fail") - set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION_NAME}") - file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the C ${FUNCTION_NAME} exists failed with the following output:\n" - "${OUTPUT_VAR}\n\n") - endif () - else () - message (FATAL_ERROR "Compilation of C ${FUNCTION_NAME} - Failed") - endif () -endmacro () -endif () - -set (PROG_SRC - " -#include <float.h> -#include <stdio.h> -#define CHECK_FLOAT128 ${${HDF_PREFIX}_SIZEOF___FLOAT128} -#if CHECK_FLOAT128!=0 -# if ${${HDF_PREFIX}_HAVE_QUADMATH_H}!=0 -#include <quadmath.h> -# endif -# ifdef FLT128_DIG -#define C_FLT128_DIG FLT128_DIG -# else -#define C_FLT128_DIG 0 -# endif -#else -#define C_FLT128_DIG 0 -#endif -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#define C_LDBL_DIG DECIMAL_DIG -#else -#define C_LDBL_DIG LDBL_DIG -#endif - int main() { - printf(\"%d\\\\n%d\\\\n\", C_LDBL_DIG, C_FLT128_DIG)\\\; - return 1\\\; - } - " -) - -if (NOT CMAKE_VERSION VERSION_LESS "3.14.0") - check_c_source_runs (${PROG_SRC} PROG_OUTPUT) -else () - C_RUN ("maximum decimal precision for C" ${PROG_SRC} PROG_OUTPUT) -endif () - -# dnl The output from the above program will be: -# dnl -- LINE 1 -- long double decimal precision -# dnl -- LINE 2 -- __float128 decimal precision - -# Convert the string to a list of strings by replacing the carriage return with a semicolon -string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") - -list (GET PROG_OUTPUT 0 LDBL_DIG) -list (GET PROG_OUTPUT 1 FLT128_DIG) - -if (${HDF_PREFIX}_SIZEOF___FLOAT128 EQUAL 0 OR FLT128_DIG EQUAL 0) - set (${HDF_PREFIX}_HAVE_FLOAT128 0) - set (${HDF_PREFIX}_SIZEOF___FLOAT128 0) - set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${LDBL_DIG}) -else () - set(${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${FLT128_DIG}) -endif () +string (REGEX REPLACE "{" "" OUT_VAR1 ${PAC_FC_ALL_REAL_KINDS}) +string (REGEX REPLACE "}" "" OUT_VAR1 ${OUT_VAR1}) +set (${HDF_PREFIX}_H5CONFIG_F_RKIND "INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/${OUT_VAR1}/)") +string (REGEX REPLACE "{" "" OUT_VAR2 ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) +string (REGEX REPLACE "}" "" OUT_VAR2 ${OUT_VAR2}) +set (${HDF_PREFIX}_H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${OUT_VAR2}/)") # Setting definition if there is a 16 byte fortran integer string (FIND ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF} "16" pos) diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 3bcbf6c..c04bb5b 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -77,7 +77,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDN #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) -# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.12.6-Source") +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.12.7-Source") #endif() ############################################################################################################### diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake index 386e99c..236a814 100644 --- a/config/cmake/HDF5_Examples_options.cmake +++ b/config/cmake/HDF5_Examples_options.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -18,6 +18,7 @@ #### HDF_BUILD_CXX:BOOL=OFF ### #### HDF_BUILD_FORTRAN:BOOL=OFF ### #### HDF_BUILD_JAVA:BOOL=OFF ### +#### HDF_BUILD_FILTERS:BOOL=OFF ### #### BUILD_TESTING:BOOL=OFF ### #### HDF_ENABLE_PARALLEL:BOOL=OFF ### #### HDF_ENABLE_THREADSAFE:BOOL=OFF ### @@ -42,6 +43,12 @@ #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") ############################################################################################# +### enable FILTERS builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FILTERS:BOOL=ON") +### default HDF5_PLUGIN_PATH to where the filter libraries are located +#set(ENV{HDF5_PLUGIN_PATH} "${INSTALLDIR}/lib/plugin") + +############################################################################################# ### enable parallel program builds #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_PARALLEL:BOOL=ON") diff --git a/config/cmake/HDF5_Process_Flex_Files.cmake b/config/cmake/HDF5_Process_Flex_Files.cmake deleted file mode 100644 index 2595c39..0000000 --- a/config/cmake/HDF5_Process_Flex_Files.cmake +++ /dev/null @@ -1,95 +0,0 @@ -# -# 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://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# post process flex/bison files - -message (STATUS "File: ${GEN_DIR} ${FILE_PARSE} ${FILE_ANALYZE}") - -if (FILE_PARSE) - # fix H5LTparse.c to declare H5LTyyparse return type as an hid_t - # instead of int. Currently the generated function H5LTyyparse is - # generated with a return value of type int, which is a mapping to the - # flex yyparse function. The return value in the HL library should be - # an hid_t. - # I propose to not use flex to generate this function, but for now I am - # adding a perl command to find and replace this function declaration in - # H5LTparse.c. - file (READ ${GEN_DIR}/${FILE_PARSE}.c TEST_STREAM) - string (REGEX REPLACE "int yyparse" "hid_t yyparse" TEST_STREAM "${TEST_STREAM}") - string (REGEX REPLACE "int\nyyparse" "hid_t\nyyparse" TEST_STREAM "${TEST_STREAM}") - string (REGEX REPLACE "int H5LTyyparse" "hid_t H5LTyyparse" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${FILE_PARSE}.c "${TEST_STREAM}") - message (STATUS "replacing signature in H5LTparse.c") - - # Add code that disables warnings in the flex/bison-generated code. - # - # Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions - # will simply ignore them, but we want to avoid those warnings. - file (READ ${FILE_PARSE}.c TEST_STREAM) - file (WRITE ${FILE_PARSE}.c " -#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2\n -#pragma GCC diagnostic ignored \"-Wconversion\"\n -#pragma GCC diagnostic ignored \"-Wimplicit-function-declaration\"\n -#pragma GCC diagnostic ignored \"-Wlarger-than=\"\n -#pragma GCC diagnostic ignored \"-Wmissing-prototypes\"\n -#pragma GCC diagnostic ignored \"-Wnested-externs\"\n -#pragma GCC diagnostic ignored \"-Wold-style-definition\"\n -#pragma GCC diagnostic ignored \"-Wsign-compare\"\n -#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"\n -#pragma GCC diagnostic ignored \"-Wswitch-default\"\n -#pragma GCC diagnostic ignored \"-Wunused-function\"\n -#pragma GCC diagnostic ignored \"-Wunused-macros\"\n -#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n -#pragma GCC diagnostic ignored \"-Wredundant-decls\"\n -#elif defined __SUNPRO_CC\n -#pragma disable_warn\n -#elif defined _MSC_VER\n -#pragma warning(push, 1)\n -#endif\n - ") - file (APPEND ${FILE_PARSE}.c "${TEST_STREAM}") - message (STATUS "processed pragma in ${FILE_PARSE}") - file (READ ${GEN_DIR}/${FILE_PARSE}.h TEST_STREAM) - file (WRITE ${FILE_PARSE}.h "${TEST_STREAM}") -endif () - -if (FILE_ANALYZE) - # Add code that disables warnings in the flex/bison-generated code. - # - # Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions - # will simply ignore them, but we want to avoid those warnings. - file (READ ${GEN_DIR}/${FILE_ANALYZE} TEST_STREAM) - file (WRITE ${FILE_ANALYZE} " -#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2\n -#pragma GCC diagnostic ignored \"-Wconversion\"\n -#pragma GCC diagnostic ignored \"-Wimplicit-function-declaration\"\n -#pragma GCC diagnostic ignored \"-Wlarger-than=\"\n -#pragma GCC diagnostic ignored \"-Wmissing-prototypes\"\n -#pragma GCC diagnostic ignored \"-Wnested-externs\"\n -#pragma GCC diagnostic ignored \"-Wold-style-definition\"\n -#pragma GCC diagnostic ignored \"-Wsign-compare\"\n -#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"\n -#pragma GCC diagnostic ignored \"-Wswitch-default\"\n -#pragma GCC diagnostic ignored \"-Wunused-function\"\n -#pragma GCC diagnostic ignored \"-Wunused-macros\"\n -#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n -#pragma GCC diagnostic ignored \"-Wredundant-decls\"\n -#elif defined __SUNPRO_CC\n -#pragma disable_warn\n -#elif defined _MSC_VER\n -#pragma warning(push, 1)\n -#endif\n - ") - file (APPEND ${FILE_ANALYZE} "${TEST_STREAM}") - message (STATUS "processed pragma in ${FILE_ANALYZE}") -endif () diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake new file mode 100644 index 0000000..64ec010 --- /dev/null +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -0,0 +1,307 @@ +# +# 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. +# +set(CMAKE_CXX_STANDARD 98) +set(CMAKE_CXX_STANDARD_REQUIRED TRUE) +set(CMAKE_CXX_EXTENSIONS OFF) + +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Warnings Configuration: CXX default: ${CMAKE_CXX_FLAGS}") +endif () +#----------------------------------------------------------------------------- +# Compiler specific flags : Shouldn't there be compiler tests for these +#----------------------------------------------------------------------------- +if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") + if (${HDF_CFG_NAME} MATCHES "Debug") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") + endif () + else () + 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 () + +#----------------------------------------------------------------------------- +# Option to allow the user to disable compiler warnings +#----------------------------------------------------------------------------- +if (HDF5_DISABLE_COMPILER_WARNINGS) + message (STATUS "....Compiler warnings are suppressed") + # MSVC uses /w to suppress warnings. It also complains if another + # warning level is given, so remove it. + if (MSVC) + set (HDF5_WARNINGS_BLOCKED 1) + if (CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") + endif () + endif () + if (WIN32) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + endif () + + # Most compilers use -w to suppress warnings. + if (NOT HDF5_WARNINGS_BLOCKED) + if (CMAKE_CXX_COMPILER_LOADED) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# HDF5 library compile options +#----------------------------------------------------------------------------- + +if (NOT MSVC AND NOT MINGW) + if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + list (APPEND HDF5_CMAKE_CXX_FLAGS "-erroff=%none -DBSD_COMP") + else () + # General flags + # + # Note that some of the flags listed here really should be developer + # flags (listed in a separate variable, below) but we put them here + # because they are not raised by the current code and we'd like to + # know if they do start showing up. + # + # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) + # warnings that are emitted. If you need it, add it at configure time. + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general") + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0) + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/15") + endif() + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/18") + endif() + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED + AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + # add the general CXX flags for g++ compiler versions 4.8 and above. + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general") + else () + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-general") + endif () + endif () + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "PGI") + list (APPEND HDF5_CMAKE_CXX_FLAGS "-Minform=inform") + endif () + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}") + endif () + endif () + + #----------------------------------------------------------------------------- + # Option to allow the user to enable developer warnings + # Developer warnings (suggestions from gcc, not code problems) + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_DEV_WARNINGS) + message (STATUS "....HDF5 developer group warnings are enabled") + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/developer-general") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") + endif () + else () + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") + endif () + endif () + + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... Only needed for gcc 4.X + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last") + endif () + + # Append more extra warning flags that only gcc 4.8+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.8") + if (HDF5_ENABLE_DEV_WARNINGS) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8") + else () + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8") + endif () + endif () + + # Append more extra warning flags that only gcc 4.9+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.9") + endif () + + # Append more extra warning flags that only gcc 5.1+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-5") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5") + else () + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-5") + endif () + endif () + + # Append more extra warning flags that only gcc 6.x+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/6") + endif () + + # Append more extra warning flags that only gcc 7.x+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXxFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7") + if (HDF5_ENABLE_DEV_WARNINGS) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7") + #else () + # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7") + endif () + endif () + + # Append more extra warning flags that only gcc 8.x+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") + else () + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-8") + endif () + if (HDF5_ENABLE_DEV_WARNINGS) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") + else () + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8") + endif () + endif () + + # Append more extra warning flags that only gcc 9.x+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-9") + endif () + + # Append more extra warning flags that only gcc 9.3+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.3) + # do not use C warnings, gnu-warnings 9.3, no cxx warniings + # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9.3") + endif () + + # Append more extra warning flags that only gcc 10.x+ knows about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_DEV_WARNINGS) + # Use the C warnings as CXX warnings are the same + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-10") + #else () + # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-10") + endif () + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable all warnings +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_ALL_WARNINGS) + message (STATUS "....All Warnings are enabled") + if (MSVC) + if (HDF5_ENABLE_DEV_WARNINGS) + if (CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall" "/wd4668") + endif () + else () + if (CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3" "/wd4100" "/wd4706" "/wd4127") + endif () + endif () + else () + if (CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS}) + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# This is in here to help some of the GCC based IDES like Eclipse +# and code blocks parse the compiler errors and warnings better. +#----------------------------------------------------------------------------- +if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") +endif () + +#----------------------------------------------------------------------------- +# Option for --enable-symbols +# This option will force/override the default setting for all configurations +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_SYMBOLS MATCHES "YES") + if(CMAKE_CXX_COMPILER_LOADED) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + endif () + endif () +elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO") + if(CMAKE_CXX_COMPILER_LOADED) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wl,-s") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# Option for --enable-profiling +# This option will force/override the default setting for all configurations +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_PROFILING) + if(CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS "${PROFILE_CXXFLAGS}") + endif () +endif () + +#----------------------------------------------------------------------------- +# Option for --enable-optimization +# This option will force/override the default setting for all configurations +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_OPTIMIZATION) + if(CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS "${OPTIMIZE_CXXFLAGS}") + endif () +endif () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 17b0854..e38a92b 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -5,35 +5,20 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED TRUE) -macro (ADD_H5_FLAGS h5_flag_var infile) - file (STRINGS ${infile} TEST_FLAG_STREAM) - #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") - list (LENGTH TEST_FLAG_STREAM len_flag) - if (len_flag GREATER 0) - math (EXPR _FP_LEN "${len_flag} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET TEST_FLAG_STREAM ${line} str_flag) - string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") - #message (STATUS "str_flag=${str_flag}") - if (str_flag) - set (${h5_flag_var} "${${h5_flag_var}} ${str_flag}") - endif () - endforeach () - endif () - #message (STATUS "h5_flag_var=${${h5_flag_var}}") -endmacro () - set (CMAKE_C_FLAGS "${CMAKE_C99_STANDARD_COMPILE_OPTION} ${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_SANITIZER_FLAGS} ${CMAKE_C_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}") -message (STATUS "Warnings Configuration: default: ${CMAKE_C_FLAGS} : ${CMAKE_CXX_FLAGS}") + +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Warnings Configuration: default: ${CMAKE_C_FLAGS} : ${CMAKE_CXX_FLAGS}") +endif () #----------------------------------------------------------------------------- # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- @@ -47,17 +32,19 @@ 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 () - endif () -endif () -if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") - if (${HDF_CFG_NAME} MATCHES "Debug") - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") - endif () - else () - 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") + 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 () @@ -74,10 +61,6 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) set (HDF5_WARNINGS_BLOCKED 1) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") - endif () endif () if (WIN32) add_definitions (-D_CRT_SECURE_NO_WARNINGS) @@ -91,19 +74,28 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) # Most compilers use -w to suppress warnings. if (NOT HDF5_WARNINGS_BLOCKED) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") - endif () endif () endif () #----------------------------------------------------------------------------- -# CDash is configured to only allow 3000 warnings, so -# break into groups (from the config/gnu-flags file) +# HDF5 library compile options #----------------------------------------------------------------------------- -if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) + +if (NOT MSVC AND NOT MINGW) + #----------------------------------------------------------------------------- + # Option to allow the user to interpret certain warnings as errors + # + # This should NOT be on by default as it can cause a lot of conflicts with + # new operating systems and compiler versions. Header files that are out of + # our control (MPI, HDFS, etc.) can also raise warnings. + #----------------------------------------------------------------------------- + option (HDF5_ENABLE_WARNINGS_AS_ERRORS "Interpret some warnings as errors" OFF) + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + message (STATUS "...some warnings will be interpreted as errors") + endif () + if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") + list (APPEND HDF5_CMAKE_C_FLAGS "-erroff=%none -DBSD_COMP") else () # General flags # @@ -115,250 +107,162 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) # warnings that are emitted. If you need it, add it at configure time. if (CMAKE_C_COMPILER_ID STREQUAL "Intel") - ADD_H5_FLAGS (CMAKE_C_FLAGS_GENERAL "${HDF5_SOURCE_DIR}/config/intel-warnings-general") - message (STATUS "CMAKE_C_FLAGS_GENERAL=${CMAKE_C_FLAGS_GENERAL}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_GENERAL}") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wreturn-type -Wstrict-prototypes -Wuninitialized") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunknown-pragmas -Wunused-function -Wunused-variable") + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general") + if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/15") + endif() # this is just a failsafe - set (H5_CFLAGS0 "${H5_CFLAGS0} -finline-functions") + list (APPEND H5_CFLAGS "-finline-functions") if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0) - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wsign-compare -Wtrigraphs -Wwrite-strings") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/18") endif() elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - ADD_H5_FLAGS (CMAKE_C_FLAGS_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-general") - message (STATUS "CMAKE_C_FLAGS_GENERAL=${CMAKE_C_FLAGS_GENERAL}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_GENERAL}") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wbad-function-cast -Wcast-align") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wdeclaration-after-statement -Wdisabled-optimization") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-declarations") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wswitch-default") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunused-macros -Wunsafe-loop-optimizations") + # Add general CFlags for GCC versions 4.8 and above + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") + else () + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-general") + endif () + endif () # gcc automatically inlines based on the optimization level # this is just a failsafe - set (H5_CFLAGS0 "${H5_CFLAGS0} -finline-functions") - message (STATUS "H5_CFLAGS0=${H5_CFLAGS0}") + list (APPEND H5_CFLAGS "-finline-functions") + elseif (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general") + else () + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/noerror-general") + endif () + elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI") + list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform") + endif () + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") endif () endif () - #----------------------------------------------------------------------------- - # Option to allow the user to enable developer warnings - # Developer warnings (suggestions from gcc, not code problems) - #----------------------------------------------------------------------------- - option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF) - if (HDF5_ENABLE_DEV_WARNINGS) - message (STATUS "....HDF5 developer group warnings are enabled") - if (CMAKE_C_COMPILER_ID STREQUAL "Intel") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Winline -Wreorder -Wport -Wstrict-aliasing") - elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - ADD_H5_FLAGS (CMAKE_C_FLAGS_DEV_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-developer-general") - set (H5_CFLAGS0 "${H5_CFLAGS0} ${CMAKE_C_FLAGS_DEV_GENERAL}") - endif () - else () - if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - ADD_H5_FLAGS (CMAKE_C_FLAGS_NO_DEV_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-no-developer-general") - set (H5_CFLAGS0 "${H5_CFLAGS0} ${CMAKE_C_FLAGS_NO_DEV_GENERAL}") - endif () + #----------------------------------------------------------------------------- + # Option to allow the user to enable developer warnings + # Developer warnings (suggestions from gcc, not code problems) + #----------------------------------------------------------------------------- + option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF) + if (HDF5_ENABLE_DEV_WARNINGS) + message (STATUS "....HDF5 developer group warnings are enabled") + if (CMAKE_C_COMPILER_ID STREQUAL "Intel") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/developer-general") + elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") + elseif (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") endif () - - - if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - # Append warning flags that only gcc 4.3+ knows about - # - # Technically, variable-length arrays are part of the C99 standard, but - # we should approach them a bit cautiously... -QAK - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wlogical-op -Wlarger-than=2560 -Wvla") - - # Append more extra warning flags that only gcc 4.4+ know about - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") + else () + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") + elseif (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") endif () + endif () - # Append more extra warning flags that only gcc 4.5+ know about - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wstrict-overflow=5 -Wjump-misses-init") - if (HDF5_ENABLE_DEV_WARNINGS) - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunsuffixed-float-constants") - else () - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wno-unsuffixed-float-constants") - endif () + if (CMAKE_C_COMPILER_ID STREQUAL "GNU") + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... Only needed for gcc 4.X + if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last") endif () - # Append more extra warning flags that only gcc 4.6+ know about - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdouble-promotion -Wtrampolines") + # Append more extra warning flags that only gcc 4.8+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8") if (HDF5_ENABLE_DEV_WARNINGS) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=const") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8") else () - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=const") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8") endif () endif () - # Append more extra warning flags that only gcc 4.7+ know about - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wstack-usage=8192 -Wvector-operation-performance") - if (HDF5_ENABLE_DEV_WARNINGS) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") - else () - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn") - endif () + # Append more extra warning flags that only gcc 4.9+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9") endif () - # Append more extra warning flags that only gcc 4.8+ know about - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) - if (HDF5_ENABLE_DEV_WARNINGS) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=format") + # Append more extra warning flags that only gcc 5.x+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/5") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5") else () - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=format") + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5") endif () endif () - # Append more extra warning flags that only gcc 4.9+ know about - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdate-time") + # Append more extra warning flags that only gcc 6.x+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/6") endif () - # Append more extra warning flags that only gcc 5.1+ know about - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1) - set (H5_CFLAGS3 "${H5_CFLAGS3} -Warray-bounds=2 -Wc99-c11-compat") + # Append more extra warning flags that only gcc 7.x+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/7") + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7") + #else () + # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7") + endif () endif () - # Append more extra warning flags that only gcc 6.x+ know about - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized") + # Append more extra warning flags that only gcc 8.x+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") + endif () + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") + else () + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8") + endif () endif () - # Append more extra warning flags that only gcc 7.x+ know about - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0) - set (H5_CFLAGS4 "${H5_CFLAGS4} -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=1 -Wimplicit-fallthrough=5 -Wrestrict") + # Append more extra warning flags that only gcc 9.x+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9") endif () - # Append more extra warning flags that only gcc 8.x+ know about - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0) - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wattribute-alias -Wcast-align=strict -Wshift-overflow=2 -Wno-suggest-attribute=cold -Wno-suggest-attribute=malloc") + # Append more extra warning flags that only gcc 9.3+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.3) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9.3") endif () - # Append more extra warning flags that only gcc 9.x+ know about - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0) - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wattribute-alias=2 -Wmissing-profile") + # Append more extra warning flags that only gcc 10.x+ knows about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-10") + #else () + # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-10") + endif () endif () -elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Minform=inform") + endif () endif () #----------------------------------------------------------------------------- # Option to allow the user to enable all warnings #----------------------------------------------------------------------------- -option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) +option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" ON) if (HDF5_ENABLE_ALL_WARNINGS) message (STATUS "....All Warnings are enabled") if (MSVC) if (HDF5_ENABLE_DEV_WARNINGS) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /wd4668") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /wd4668") - endif () + list (APPEND HDF5_CMAKE_C_FLAGS "/Wall" "/wd4668") else () string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") - endif () - endif () - else () - if (CMAKE_COMPILER_IS_GNUCC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2}") - endif () - endif () -endif () - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF) -if (HDF5_ENABLE_GROUPZERO_WARNINGS) - message (STATUS "....Group Zero warnings are enabled") - if (MSVC) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") - endif () - else () - if (CMAKE_COMPILER_IS_GNUCC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS0}") - endif () - endif () -endif () - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) -if (HDF5_ENABLE_GROUPONE_WARNINGS) - message (STATUS "....Group One warnings are enabled") - if (MSVC) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") - endif () - else () - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") - endif () -endif () - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) -if (HDF5_ENABLE_GROUPTWO_WARNINGS) - message (STATUS "....Group Two warnings are enabled") - if (MSVC) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") - endif () - else () - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") - endif () -endif () - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) -if (HDF5_ENABLE_GROUPTHREE_WARNINGS) - message (STATUS "....Group Three warnings are enabled") - if (MSVC) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + list (APPEND HDF5_CMAKE_C_FLAGS "/W3" "/wd4100" "/wd4706" "/wd4127") endif () else () - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") - endif () -endif () - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) -if (HDF5_ENABLE_GROUPFOUR_WARNINGS) - message (STATUS "....Group Four warnings are enabled") - if (NOT MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS}) endif () endif () @@ -369,9 +273,6 @@ endif () if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") endif () -if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") -endif () #----------------------------------------------------------------------------- # Option for --enable-asserts @@ -401,26 +302,12 @@ if (HDF5_ENABLE_SYMBOLS MATCHES "YES") elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fno-omit-frame-pointer") endif () - if(CMAKE_CXX_COMPILER_LOADED) - if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") - elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") - endif () - endif () elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO") if (CMAKE_C_COMPILER_ID STREQUAL "Intel") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-s") elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s") endif () - if(CMAKE_CXX_COMPILER_LOADED) - if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wl,-s") - elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") - endif () - endif () endif () MARK_AS_ADVANCED (HDF5_ENABLE_SYMBOLS) @@ -430,10 +317,7 @@ MARK_AS_ADVANCED (HDF5_ENABLE_SYMBOLS) #----------------------------------------------------------------------------- option (HDF5_ENABLE_PROFILING "Enable profiling flags independently from the build mode." OFF) if (HDF5_ENABLE_PROFILING) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PROFILE_CFLAGS}") - if(CMAKE_CXX_COMPILER_LOADED) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PROFILE_CXXFLAGS}") - endif () + list (APPEND HDF5_CMAKE_C_FLAGS "${PROFILE_CFLAGS}") endif () MARK_AS_ADVANCED (HDF5_ENABLE_PROFILING) @@ -443,9 +327,6 @@ MARK_AS_ADVANCED (HDF5_ENABLE_PROFILING) #----------------------------------------------------------------------------- option (HDF5_ENABLE_OPTIMIZATION "Enable optimization flags/settings independently from the build mode" OFF) if (HDF5_ENABLE_OPTIMIZATION) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPTIMIZE_CFLAGS}") - if(CMAKE_CXX_COMPILER_LOADED) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPTIMIZE_CXXFLAGS}") - endif () + list (APPEND HDF5_CMAKE_C_FLAGS "${OPTIMIZE_CFLAGS}") endif () MARK_AS_ADVANCED (HDF5_ENABLE_OPTIMIZATION) diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake new file mode 100644 index 0000000..18ab621 --- /dev/null +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -0,0 +1,124 @@ +# +# 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. +# + +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to disable compiler warnings +#----------------------------------------------------------------------------- +if (HDF5_DISABLE_COMPILER_WARNINGS) + message (STATUS "....Compiler warnings are suppressed") + # MSVC uses /w to suppress warnings. It also complains if another + # warning level is given, so remove it. + if (MSVC) + set (HDF5_WARNINGS_BLOCKED 1) + if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /warn:none") + endif () + endif () + if (WIN32) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + endif () + # Borland uses -w- to suppress warnings. + if (BORLAND) + set (HDF5_WARNINGS_BLOCKED 1) + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w-") + endif () + + # Most compilers use -w to suppress warnings. + if (NOT HDF5_WARNINGS_BLOCKED) + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w") + endif () +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 +# break into groups (from the config/gnu-flags file) +#----------------------------------------------------------------------------- +if (NOT MSVC AND NOT MINGW) + # General flags + if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/ifort-general") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-stand:f03" "-free") + elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-general") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ffree-form" "-fimplicit-none") + if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0 AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6) + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-std=f2008ts") + else () + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-std=f2008") + endif () + elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-Mfreeform" "-Mdclchk" "-Mstandard" "-Mallocatable=03") + endif () + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") + endif () + + if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") + + # Append more extra warning flags that only gcc 4.8+ knows about + if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.8) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.8") + endif () + + # Append more extra warning flags that only gcc 4.9+ knows about + #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.9) + # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.9") + #endif () + + # Append more extra warning flags that only gcc 5.x+ knows about + if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5") + endif () + + # Append more extra warning flags that only gcc 6.x+ knows about + if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 6.0) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-6") + endif () + + # Append more extra warning flags that only gcc 7.x+ knows about + #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0) + # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-7") + #endif () + + # Append more extra warning flags that only gcc 8.x+ knows about + if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-8") + endif () + + # Append more extra warning flags that only gcc 9.x+ knows about + #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 9.0) + # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-9") + #endif () + endif () +else () + if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") + #ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-ifort-general") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "/warn:all" "/stand:f03" "/free") + endif () +endif () + diff --git a/config/cmake/PkgInfo.in b/config/cmake/PkgInfo.in index e530f88..ae54035 100644 --- a/config/cmake/PkgInfo.in +++ b/config/cmake/PkgInfo.in @@ -1 +1 @@ -FMWK????
\ No newline at end of file +FMWK???? diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index 3afebc2..bc14e99 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -17,6 +17,18 @@ The contents of this directory are: README.txt - This file @HDF5_PACKAGE_NAME@-@HDF5_PACKAGE_VERSION@-@BINARY_SYSTEM_NAME@.@BINARY_INSTALL_ENDING@ - HDF5 Install Package +This binary was built with the ZLIB and SZIP/Libaec external libraries and are +included for convenience. Libaec is an unrestricted open-source replacement for SZIP +(version 1.0.4, Encoder ENABLED). + +The official ZLIB and SZIP/Libaec pages are at: + + ZLIB: https://git.savannah.gnu.org/cgit/gzip.git/ + https://git.savannah.gnu.org/cgit/gzip.git/tree/COPYING + SZIP/Libaec: https://gitlab.dkrz.de/k202009/libaec + https://gitlab.dkrz.de/k202009/libaec/-/blob/master/LICENSE.txt + + Installation =========================================================================== 1. Execute @HDF5_PACKAGE_NAME@-@HDF5_PACKAGE_VERSION@-@BINARY_SYSTEM_NAME@.@BINARY_INSTALL_ENDING@ diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index 78d8277..15cffba 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 5254115..e423deb 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -21,8 +21,13 @@ set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace (can be empty)" FORCE) +set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build C++ support" FORCE) + set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) +set (HDF5_INSTALL_MOD_FORTRAN "NO" CACHE STRING "Copy FORTRAN mod files to include directory (NO SHARED STATIC)" FORCE) +set_property (CACHE HDF5_INSTALL_MOD_FORTRAN PROPERTY STRINGS NO SHARED STATIC) + set (HDF5_BUILD_GENERATORS ON CACHE BOOL "Build Test Generators" FORCE) set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) @@ -37,13 +42,141 @@ set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) +set (HDF5_MINGW_STATIC_GCC_LIBS ON CACHE BOOL "Statically link libgcc/libstdc++" FORCE) + set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) - set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) +set (SZAEC_TGZ_NAME "LIBAEC.tar.gz" CACHE STRING "Use SZip AEC from compressed file" FORCE) +set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) - +set (LIBAEC_PACKAGE_NAME "libaec" CACHE STRING "Name of AEC SZIP package" FORCE) set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) + +####################### +# filter plugin options +####################### +set (PLUGIN_TGZ_NAME "hdf5_plugins.tar.gz" CACHE STRING "Use PLUGINS from compressed file" FORCE) + +set (PLUGIN_PACKAGE_NAME "pl" CACHE STRING "Name of PLUGIN package" FORCE) + +############ +# bitshuffle +########### + +set (BSHUF_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/bitshuffle.git" CACHE STRING "Use BSHUF from HDF repository" FORCE) +set (BSHUF_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (BSHUF_TGZ_NAME "bitshuffle.tar.gz" CACHE STRING "Use BSHUF from compressed file" FORCE) + +set (BSHUF_PACKAGE_NAME "bshuf" CACHE STRING "Name of BSHUF package" FORCE) + +####### +# blosc +####### + +set (BLOSC_GIT_URL "https://github.com/Blosc/c-blosc.git" CACHE STRING "Use BLOSC from Github" FORCE) +set (BLOSC_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (BLOSC_TGZ_NAME "c-blosc.tar.gz" CACHE STRING "Use BLOSC from compressed file" FORCE) + +set (BLOSC_PACKAGE_NAME "blosc" CACHE STRING "Name of BLOSC package" FORCE) + +set (ZLIB_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/zlib.git" CACHE STRING "Use ZLIB from HDF repo" FORCE) +set (ZLIB_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) + +set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + +####### +# bzip2 +###### +# +set (BZ2_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/bzip2.git" CACHE STRING "Use BZ2 from HDF repository" FORCE) +set (BZ2_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (BZ2_TGZ_NAME "BZ2.tar.gz" CACHE STRING "Use BZ2 from compressed file" FORCE) + +set (BZ2_PACKAGE_NAME "bz2" CACHE STRING "Name of BZ2 package" FORCE) + +####### +# fpzip +####### + +set (FPZIP_GIT_URL "https://https://github.com/LLNL/fpzip" CACHE STRING "Use FPZIP from github repository" FORCE) +set (FPZIP_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (FPZIP_TGZ_NAME "fpzip.tar.gz" CACHE STRING "Use FPZIP from compressed file" FORCE) + +set (FPZIP_PACKAGE_NAME "fpzip" CACHE STRING "Name of FPZIP package" FORCE) + +###### +# jpeg +###### + +set (JPEG_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/jpeg.git" CACHE STRING "Use JPEG from HDF repository" FORCE) +set (JPEG_GIT_BRANCH "jpeg9c" CACHE STRING "" FORCE) + +#set (JPEG_TGZ_NAME "JPEG9c.tar.gz" CACHE STRING "Use JPEG from compressed file" FORCE) +set (JPEG_TGZ_NAME "JPEG.tar.gz" CACHE STRING "Use JPEG from compressed file" FORCE) + +set (JPEG_PACKAGE_NAME "jpeg" CACHE STRING "Name of JPEG package" FORCE) + +###### +# lz4 +###### + +set (BUILD_LZ4_LIBRARY_SOURCE ON CACHE BOOL "build the lz4 library within the plugin" FORCE) + +set (LZ4_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/lz4.git" CACHE STRING "Use LZ4 from HDF repository" FORCE) +set (LZ4_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (LZ4_TGZ_NAME "lz4.tar.gz" CACHE STRING "Use LZ4 from compressed file" FORCE) + +set (LZ4_PACKAGE_NAME "lz4" CACHE STRING "Name of LZ4 package" FORCE) + +###### +# lzf +###### + +set (LZF_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/lzf.git" CACHE STRING "Use LZF from HDF repository" FORCE) +set (LZF_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (LZF_TGZ_NAME "lzf.tar.gz" CACHE STRING "Use LZF from compressed file" FORCE) + +set (LZF_PACKAGE_NAME "lzf" CACHE STRING "Name of LZF package" FORCE) + +######## +# mafisc +######## + +#set (BUILD_MAFISC_LIBRARY_SOURCE OFF CACHE BOOL "build the mafisc library within the plugin" FORCE) + +#set (MAFISC_PACKAGE_NAME "mafisc" CACHE STRING "Name of MAFISC package" FORCE) + +###### +# szf +###### + +set (SZF_GIT_URL "https://github.com/disheng222/SZ" CACHE STRING "Use SZ from github repository" FORCE) +set (SZF_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (SZF_TGZ_NAME "szf.tar.gz" CACHE STRING "Use SZ from compressed file" FORCE) + +set (SZF_PACKAGE_NAME "szf" CACHE STRING "Name of SZ package" FORCE) + +###### +# zfp +###### + +set (ZFP_GIT_URL "https://github.com/LLNL/zfp.git" CACHE STRING "Use ZFP from Github" FORCE) +set (ZFP_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (ZFP_TGZ_NAME "zfp.tar.gz" CACHE STRING "Use ZFP from compressed file" FORCE) + +set (ZFP_PACKAGE_NAME "zfp" CACHE STRING "Name of ZFP package" FORCE) + diff --git a/config/cmake/fileCompareTest.cmake b/config/cmake/fileCompareTest.cmake index d913da0..4a8dc09 100644 --- a/config/cmake/fileCompareTest.cmake +++ b/config/cmake/fileCompareTest.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -24,9 +24,6 @@ endif () if (NOT TEST_FUNCTION) message (FATAL_ERROR "Require TEST_FUNCTION (LT,LTEQ,EQ,GTEQ,GT) to be defined") endif () -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif () set (TEST_ONE_SIZE 0) set (TEST_TWO_SIZE 0) @@ -53,7 +50,9 @@ if (TEST_STRINGS STREQUAL "YES") RESULT_VARIABLE TEST_RESULT ) - message (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}-${TEST_O_STRING_LEN}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}-${TEST_O_STRING_LEN}") + endif () # if the return value is !=${TEST_EXPECT} bail out if (NOT TEST_RESULT EQUAL TEST_EXPECT) message (FATAL_ERROR "Failed: The output of ${TEST_FOLDER}/${TEST_ONEFILE} did not match ${TEST_FOLDER}/${TEST_TWOFILE}.\n${TEST_ERROR}") @@ -66,31 +65,41 @@ else () file (SIZE ${TEST_FOLDER}/${TEST_TWOFILE} TEST_TWO_SIZE) if (TEST_FUNCTION MATCHES "LT") if (TEST_ONE_SIZE LESS TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT less ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "LTEQ") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSES "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT less or equal ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "EQ") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was equal ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was equal ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT equal ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "GTEQ") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT greater or equal ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "GT") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT greater ${TEST_FOLDER}/${TEST_TWOFILE}") endif () diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index 575c1ab..20ce630 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -33,7 +33,7 @@ else() endif() if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND - (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR)) + (PACKAGE_FIND_VERSION_MINOR STRLESS_EQUAL CVF_VERSION_MINOR)) set(PACKAGE_VERSION_COMPATIBLE TRUE) else() set(PACKAGE_VERSION_COMPATIBLE FALSE) diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index b5a12a6..4d02c9c 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -39,6 +39,7 @@ set (${HDF5_PACKAGE_NAME}_BUILD_JAVA @HDF5_BUILD_JAVA@) set (${HDF5_PACKAGE_NAME}_BUILD_TOOLS @HDF5_BUILD_TOOLS@) set (${HDF5_PACKAGE_NAME}_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) set (${HDF5_PACKAGE_NAME}_ENABLE_THREADSAFE @HDF5_ENABLE_THREADSAFE@) +set (${HDF5_PACKAGE_NAME}_ENABLE_PLUGIN_SUPPORT @HDF5_ENABLE_PLUGIN_SUPPORT@) set (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@) set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@) set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) @@ -114,7 +115,7 @@ if (NOT TARGET "@HDF5_PACKAGE@") include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) endif () if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) - include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) + include (@PACKAGE_SHARE_INSTALL_DIR@/@SZ_PACKAGE_NAME@/@SZ_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) endif () include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) endif () diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 41570eb..2ca1b75 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -49,7 +49,7 @@ endif () message (STATUS "COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=${LOG_LEVEL} -Djava.library.path=\"${TEST_LIBRARY_DIRECTORY}\" -cp \"${TEST_CLASSPATH}\" ${TEST_ARGS} ${TEST_PROGRAM} ${ARGN}") -if (WIN32 OR MINGW) +if (WIN32) set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -131,7 +131,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) @@ -202,7 +202,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) diff --git a/config/cmake/jvolTest.cmake b/config/cmake/jvolTest.cmake index 3a3877b..b12c358 100644 --- a/config/cmake/jvolTest.cmake +++ b/config/cmake/jvolTest.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -54,7 +54,7 @@ message (STATUS "USING ${TEST_VOL} ON COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.sl set (ENV{HDF5_VOL_CONNECTOR} "${TEST_VOL}") -if (WIN32 OR MINGW) +if (WIN32) set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -136,7 +136,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list(LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) @@ -207,7 +207,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list(LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) diff --git a/config/cmake/libh5cc.in b/config/cmake/libh5cc.in index f462d56..c98d9ca 100644 --- a/config/cmake/libh5cc.in +++ b/config/cmake/libh5cc.in @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. ## @@ -29,4 +29,4 @@ printf 'dir is %s\n' "$dir" export PKG_CONFIG_PATH=$dir/lib/pkgconfig -@_PKG_CONFIG_COMPILER@ `pkg-config --define-variable=prefix=$dir --cflags --libs @_PKG_CONFIG_LIBNAME@-@_PKG_CONFIG_VERSION@` $@ +@_PKG_CONFIG_COMPILER@ `pkg-config --define-variable=prefix=$dir --cflags --libs @_PKG_CONFIG_LIBNAME@` $@ diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 8397d68..dd345b4 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -38,7 +38,7 @@ Languages: H5_CPPFLAGS: @H5_CPPFLAGS@ AM_CPPFLAGS: @AM_CPPFLAGS@ CFLAGS: @CMAKE_C_FLAGS@ - H5_CFLAGS: @H5_CFLAGS@ + H5_CFLAGS: @HDF5_CMAKE_C_FLAGS@ AM_CFLAGS: @AM_CFLAGS@ Shared C Library: @H5_ENABLE_SHARED_LIB@ Static C Library: @H5_ENABLE_STATIC_LIB@ @@ -46,7 +46,7 @@ Languages: Fortran: @HDF5_BUILD_FORTRAN@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @CMAKE_Fortran_COMPILER@ @CMAKE_Fortran_COMPILER_VERSION@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @CMAKE_Fortran_FLAGS@ -@BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @H5_FCFLAGS@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @HDF5_CMAKE_Fortran_FLAGS@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Shared Fortran Library: @H5_ENABLE_SHARED_LIB@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Static Fortran Library: @H5_ENABLE_STATIC_LIB@ @@ -54,7 +54,7 @@ Languages: C++: @HDF5_BUILD_CPP_LIB@ @BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CMAKE_CXX_COMPILER@ @CMAKE_CXX_COMPILER_VERSION@ @BUILD_CXX_CONDITIONAL_TRUE@ C++ Flags: @CMAKE_CXX_FLAGS@ -@BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @H5_CXXFLAGS@ +@BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @HDF5_CMAKE_CXX_FLAGS@ @BUILD_CXX_CONDITIONAL_TRUE@ AM C++ Flags: @AM_CXXFLAGS@ @BUILD_CXX_CONDITIONAL_TRUE@ Shared C++ Library: @H5_ENABLE_SHARED_LIB@ @BUILD_CXX_CONDITIONAL_TRUE@ Static C++ Library: @H5_ENABLE_STATIC_LIB@ @@ -70,12 +70,13 @@ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@ High-level library: @HDF5_BUILD_HL_LIB@ Build HDF5 Tests: @BUILD_TESTING@ Build HDF5 Tools: @HDF5_BUILD_TOOLS@ - Threadsafety: @HDF5_ENABLE_THREADSAFE@ + Threadsafety: @HDF5_ENABLE_THREADSAFE@ (recursive RW locks: @HDF5_USE_RECURSIVE_RW_LOCKS@) Default API mapping: @DEFAULT_API_VERSION@ With deprecated public symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@ I/O filters (external): @EXTERNAL_FILTERS@ MPE: @H5_HAVE_LIBLMPE@ Direct VFD: @H5_HAVE_DIRECT@ + Mirror VFD: @H5_HAVE_MIRROR_VFD@ (Read-Only) S3 VFD: @H5_HAVE_ROS3_VFD@ (Read-Only) HDFS VFD: @H5_HAVE_LIBHDFS@ dmalloc: @H5_HAVE_LIBDMALLOC@ @@ -84,5 +85,6 @@ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@ Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@ Memory allocation sanity checks: @HDF5_MEMORY_ALLOC_SANITY_CHECK@ Function Stack Tracing: @HDF5_ENABLE_CODESTACK@ + Use file locking: @HDF5_FILE_LOCKING_SETTING@ Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@ Optimization Instrumentation: @HDF5_Enable_Instrument@ diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 1608202..dd0c9ec 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -51,11 +51,13 @@ set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) +set (SZAEC_TGZ_NAME "LIBAEC.tar.gz" CACHE STRING "Use SZip AEC from compressed file" FORCE) +set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE) set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE) set (CTEST_CONFIGURATION_TYPE "Debug" CACHE STRING "Build Debug" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) - +set (LIBAEC_PACKAGE_NAME "libaec" CACHE STRING "Name of AEC SZIP package" FORCE) set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index e3659f6..b142ade 100644 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 92a3472..50709ec 100644 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -5,13 +5,13 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### -### BUILD_GENERATOR required [Unix, VS2017, VS201764, VS2015, VS201564, VS2013, VS201364] ### +### BUILD_GENERATOR required [Unix, VS2019, VS201964, VS2017, VS201764, VS2015, VS201564] ### ### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ### ############################################################################################# @@ -21,6 +21,7 @@ cmake_minimum_required (VERSION 3.12) # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log # where valid options for OPTION are: # BUILD_GENERATOR - The cmake build generator: +# MinGW * MinGW Makefiles # Unix * Unix Makefiles # VS2019 * Visual Studio 16 2019 # VS201964 * Visual Studio 16 2019 @@ -36,7 +37,7 @@ cmake_minimum_required (VERSION 3.12) # CTEST_SOURCE_NAME - source folder ############################################################################## -set (CTEST_SOURCE_VERSION "1.12.0") +set (CTEST_SOURCE_VERSION "1.12.1") set (CTEST_SOURCE_VERSEXT "") ############################################################################## @@ -67,7 +68,7 @@ endif () # build generator must be defined if (NOT DEFINED BUILD_GENERATOR) - message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2019, VS201964, VS2017, or VS201764, VS2015, VS201564") endif () ################################################################### @@ -104,7 +105,7 @@ endif () ######### Following describes compiler ############ if (NOT DEFINED HPC) if (NOT DEFINED BUILD_GENERATOR) - message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2019, VS201964, VS2017, or VS201764, VS2015, VS201564") endif () if (WIN32 AND NOT MINGW) set (SITE_OS_NAME "Windows") @@ -162,12 +163,16 @@ if (NOT DEFINED HPC) set (SITE_COMPILER_NAME "vs2012") set (SITE_COMPILER_VERSION "11") else () - message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2019, VS201964, VS2017, or VS201764, VS2015, VS201564") endif () ## Set the following to unique id your computer ## set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else () - set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + if (MINGW) + set (CTEST_CMAKE_GENERATOR "MinGW Makefiles") + else () + set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + endif () ## Set the following to unique id your computer ## if (APPLE) set (CTEST_SITE "MAC.XXXX") @@ -199,7 +204,7 @@ endif () #set (LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### #set (LOCAL_UPDATE "TRUE") -set (REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") +set (REPOSITORY_URL "https://github.com/HDFGroup/hdf5.git") set (REPOSITORY_BRANCH "hdf5_1_12") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index 6171e97..532cf6a 100644 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -57,7 +57,9 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=GIT") ### ext libs on system #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=NO") +#set(ENV{ZLIB_ROOT} "some_location") #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") +#set(ENV{SZIP_ROOT} "some_location") #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") ### disable using ext zlib @@ -67,7 +69,7 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") #### package examples #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-1.12.6-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}") +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-1.12.7-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}") ############################################################################################# ### enable parallel builds diff --git a/config/cmake/scripts/HPC/bsub-HDF5options.cmake b/config/cmake/scripts/HPC/bsub-HDF5options.cmake index 7473e8a..37fdb8b 100644 --- a/config/cmake/scripts/HPC/bsub-HDF5options.cmake +++ b/config/cmake/scripts/HPC/bsub-HDF5options.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # diff --git a/config/cmake/scripts/HPC/qsub-HDF5options.cmake b/config/cmake/scripts/HPC/qsub-HDF5options.cmake index 34eba1b..fe33546 100644 --- a/config/cmake/scripts/HPC/qsub-HDF5options.cmake +++ b/config/cmake/scripts/HPC/qsub-HDF5options.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # diff --git a/config/cmake/scripts/HPC/raybsub-HDF5options.cmake b/config/cmake/scripts/HPC/raybsub-HDF5options.cmake index fa1ec4a..89ce4f0 100644 --- a/config/cmake/scripts/HPC/raybsub-HDF5options.cmake +++ b/config/cmake/scripts/HPC/raybsub-HDF5options.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # diff --git a/config/cmake/scripts/HPC/sbatch-HDF5options.cmake b/config/cmake/scripts/HPC/sbatch-HDF5options.cmake index 3205a1c..ddf4858 100644 --- a/config/cmake/scripts/HPC/sbatch-HDF5options.cmake +++ b/config/cmake/scripts/HPC/sbatch-HDF5options.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index c02669d..e6a278c 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index c07d005..f5a4e3e 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # diff --git a/config/cmake/volTest.cmake b/config/cmake/volTest.cmake index e735109..27ef8a2 100644 --- a/config/cmake/volTest.cmake +++ b/config/cmake/volTest.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 52cb7dd..004aded 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -20,21 +20,7 @@ include (CheckSymbolExists) include (CheckTypeSize) include (CheckVariableExists) include (TestBigEndian) - -#----------------------------------------------------------------------------- -# APPLE/Darwin setup -#----------------------------------------------------------------------------- -if (APPLE) - list (LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) - if (ARCH_LENGTH GREATER 1) - set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE) - message (FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" - "due to technical reasons. The best approach would be build each architecture in separate directories" - "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'" - "variable has been set to a blank value which will build the default architecture for this system.") - endif () - set (${HDF_PREFIX}_AC_APPLE_UNIVERSAL_BUILD 0) -endif () +include (CheckStructHasMember) # Check for Darwin (not just Apple - we also want to catch OpenDarwin) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") @@ -68,6 +54,7 @@ if (MINGW) set (WINDOWS 1) # MinGW tries to imitate Windows set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1) + set (__USE_MINGW_ANSI_STDIO 1) endif () if (WIN32 AND NOT MINGW) @@ -136,15 +123,11 @@ CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H) CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H) CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) -# Darwin -CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H) - # Windows CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H) if (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H) endif () -CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" ${HDF_PREFIX}_HAVE_SYS_TIMEB_H) if (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H) @@ -165,6 +148,8 @@ CHECK_INCLUDE_FILE_CONCAT ("memory.h" ${HDF_PREFIX}_HAVE_MEMORY_H) CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${HDF_PREFIX}_HAVE_DLFCN_H) CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" ${HDF_PREFIX}_HAVE_INTTYPES_H) CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" ${HDF_PREFIX}_HAVE_NETINET_IN_H) +CHECK_INCLUDE_FILE_CONCAT ("netdb.h" ${HDF_PREFIX}_HAVE_NETDB_H) +CHECK_INCLUDE_FILE_CONCAT ("arpa/inet.h" ${HDF_PREFIX}_HAVE_ARPA_INET_H) # _Bool type support CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H) @@ -224,7 +209,9 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) ) endif () - #message (STATUS "Performing ${OTHER_TEST}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Performing ${OTHER_TEST}") + endif () try_compile (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c @@ -234,9 +221,13 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) ) if (${OTHER_TEST}) set (${HDF_PREFIX}_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") - message (STATUS "Performing Other Test ${OTHER_TEST} - Success") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Other Test ${OTHER_TEST} - Success") + endif () else () - message (STATUS "Performing Other Test ${OTHER_TEST} - Failed") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Other Test ${OTHER_TEST} - Failed") + endif () set (${HDF_PREFIX}_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing Other Test ${OTHER_TEST} failed with the following output:\n" @@ -273,11 +264,11 @@ if (MINGW OR NOT WINDOWS) # systems. # POSIX feature information can be found in the gcc manual at: # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200112L) + set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200809L) # Need to add this so that O_DIRECT is visible for the direct # VFD on Linux systems. - set (HDF_EXTRA_C_FLAGS -D_GNU_SOURCE) + set (HDF_EXTRA_C_FLAGS ${HDF_EXTRA_C_FLAGS} -D_GNU_SOURCE) option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) if (HDF_ENABLE_LARGE_FILE AND NOT DEFINED TEST_LFS_WORKS_RUN) @@ -297,17 +288,23 @@ if (MINGW OR NOT WINDOWS) set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) set (LARGEFILE 1) set (HDF_EXTRA_FLAGS ${HDF_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) - message (STATUS "${msg}... yes") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... yes") + endif () else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Run failed with the following exit code:\n ${TEST_LFS_WORKS_RUN}\n" ) endif () else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Compile failed\n" ) @@ -328,7 +325,7 @@ if (MINGW OR NOT WINDOWS) CHECK_FUNCTION_EXISTS (fseeko ${HDF_PREFIX}_HAVE_FSEEKO) - HDF_FUNCTION_TEST (HAVE_STAT64_STRUCT) + CHECK_STRUCT_HAS_MEMBER("struct stat64" st_blocks "sys/types.h;sys/stat.h" HAVE_STAT64_STRUCT) if (HAVE_STAT64_STRUCT) CHECK_FUNCTION_EXISTS (stat64 ${HDF_PREFIX}_HAVE_STAT64) endif () @@ -340,11 +337,15 @@ endif () macro (HDF_CHECK_TYPE_SIZE type var) set (aType ${type}) set (aVar ${var}) -# message (STATUS "Checking size of ${aType} and storing into ${aVar}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Checking size of ${aType} and storing into ${aVar}") + endif () CHECK_TYPE_SIZE (${aType} ${aVar}) if (NOT ${aVar}) set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") -# message (STATUS "Size of ${aType} was NOT Found") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Size of ${aType} was NOT Found") + endif () endif () endmacro () @@ -438,14 +439,18 @@ if (MINGW OR NOT WINDOWS) #----------------------------------------------------------------------------- # Check a bunch of time functions #----------------------------------------------------------------------------- + CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff "time.h" ${HDF_PREFIX}_HAVE_TM_GMTOFF) + CHECK_STRUCT_HAS_MEMBER("struct tm" __tm_gmtoff "time.h" ${HDF_PREFIX}_HAVE___TM_GMTOFF) + CHECK_STRUCT_HAS_MEMBER("struct tm" tm_sec "sys/types.h;sys/time.h;time.h" ${HDF_PREFIX}_TIME_WITH_SYS_TIME) + if (${HDF_PREFIX}_HAVE_SYS_TIME_H) + CHECK_STRUCT_HAS_MEMBER("struct tm" tz_minuteswest "sys/types.h;sys/time.h;time.h" ${HDF_PREFIX}_HAVE_STRUCT_TIMEZONE) + else () + CHECK_STRUCT_HAS_MEMBER("struct tm" tz_minuteswest "sys/types.h;time.h" ${HDF_PREFIX}_HAVE_STRUCT_TIMEZONE) + endif () CHECK_FUNCTION_EXISTS (gettimeofday ${HDF_PREFIX}_HAVE_GETTIMEOFDAY) foreach (time_test - HAVE_TM_GMTOFF - HAVE___TM_GMTOFF # HAVE_TIMEZONE - HAVE_STRUCT_TIMEZONE GETTIMEOFDAY_GIVES_TZ - TIME_WITH_SYS_TIME HAVE_TM_ZONE HAVE_STRUCT_TM_TM_ZONE ) @@ -453,20 +458,19 @@ if (MINGW OR NOT WINDOWS) endforeach () if (NOT CYGWIN AND NOT MINGW) HDF_FUNCTION_TEST (HAVE_TIMEZONE) -# HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) endif () # ---------------------------------------------------------------------- # Does the struct stat have the st_blocks field? This field is not Posix. # - HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) + CHECK_STRUCT_HAS_MEMBER("struct stat" st_blocks "sys/types.h;sys/stat.h" ${HDF_PREFIX}_HAVE_STAT_ST_BLOCKS) # ---------------------------------------------------------------------- # How do we figure out the width of a tty in characters? # CHECK_FUNCTION_EXISTS (ioctl ${HDF_PREFIX}_HAVE_IOCTL) - HDF_FUNCTION_TEST (HAVE_STRUCT_VIDEOCONFIG) - HDF_FUNCTION_TEST (HAVE_STRUCT_TEXT_INFO) + CHECK_STRUCT_HAS_MEMBER ("struct videoconfig" numtextcols "" ${HDF_PREFIX}_HAVE_STRUCT_VIDEOCONFIG) + CHECK_STRUCT_HAS_MEMBER ("struct text_info" screenwidth "" ${HDF_PREFIX}_HAVE_STRUCT_TEXT_INFO) CHECK_FUNCTION_EXISTS (_getvideoconfig ${HDF_PREFIX}_HAVE__GETVIDEOCONFIG) CHECK_FUNCTION_EXISTS (gettextinfo ${HDF_PREFIX}_HAVE_GETTEXTINFO) CHECK_FUNCTION_EXISTS (_scrsize ${HDF_PREFIX}_HAVE__SCRSIZE) @@ -571,7 +575,9 @@ endif () #----------------------------------------------------------------------------- if (WINDOWS) if (NOT HDF_NO_IOEO_TEST) - message (STATUS "Checking for InitOnceExecuteOnce:") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for InitOnceExecuteOnce:") + endif () if (NOT DEFINED ${HDF_PREFIX}_HAVE_IOEO) if (LARGEFILE) set (CMAKE_REQUIRED_DEFINITIONS @@ -600,7 +606,9 @@ if (WINDOWS) # if the return value was 0 then it worked if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) set (${HDF_PREFIX}_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") - message (STATUS "Performing Test InitOnceExecuteOnce - Success") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Test InitOnceExecuteOnce - Success") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" "${OUTPUT}\n" @@ -612,7 +620,9 @@ if (WINDOWS) set (${HDF_PREFIX}_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") endif () - message (STATUS "Performing Test InitOnceExecuteOnce - Failed") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Test InitOnceExecuteOnce - Failed") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing InitOnceExecuteOnce Test failed with the following output:\n" "${OUTPUT}\n" @@ -635,7 +645,9 @@ endforeach () #----------------------------------------------------------------------------- if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "unknown") set (PRINT_LL_FOUND 0) - message (STATUS "Checking for appropriate format for 64 bit long:") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for appropriate format for 64 bit long:") + endif () set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH") if (${HDF_PREFIX}_SIZEOF_LONG_LONG) set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") @@ -652,7 +664,9 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${${HDF_PREFIX}_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") set (PRINT_LL_FOUND 1) else () - message (STATUS "Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") + endif () endif () else () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log @@ -661,9 +675,13 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " endif () if (PRINT_LL_FOUND) - message (STATUS "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") + endif () else () - message (STATUS "Checking for appropriate format for 64 bit long: not found") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for appropriate format for 64 bit long: not found") + endif () set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll" ) diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index 8f882b4..846a3d1 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -118,7 +118,9 @@ if (NOT SZIP_FOUND) "SZip was not found. Make sure SZIP_LIBRARY and SZIP_INCLUDE_DIR are set or set the SZIP_INSTALL environment variable." ) if (NOT SZIP_FIND_QUIETLY) - message (STATUS "${SZIP_DIR_MESSAGE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${SZIP_DIR_MESSAGE}") + endif () else () if (SZIP_FIND_REQUIRED) message (FATAL_ERROR "SZip was NOT found and is Required by this project") diff --git a/config/cmake_ext_mod/GetTimeOfDayTest.cpp b/config/cmake_ext_mod/GetTimeOfDayTest.cpp index 5fd7c04..b35efa5 100644 --- a/config/cmake_ext_mod/GetTimeOfDayTest.cpp +++ b/config/cmake_ext_mod/GetTimeOfDayTest.cpp @@ -5,7 +5,7 @@ * 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://support.hdfgroup.org/ftp/HDF5/releases. * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/config/cmake_ext_mod/HDFCXXTests.cpp b/config/cmake_ext_mod/HDFCXXTests.cpp index 1b98092..08ccb34 100644 --- a/config/cmake_ext_mod/HDFCXXTests.cpp +++ b/config/cmake_ext_mod/HDFCXXTests.cpp @@ -5,67 +5,11 @@ * 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://support.hdfgroup.org/ftp/HDF5/releases. * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME - -#include <iostream> - -int main(void) { return 0; } - -#endif - - -#ifdef HDF_NO_NAMESPACE - -namespace HDF { -int fnord; -} - -int main(void) { - using namespace HDF; - fnord = 37; - return 0; -} - -#endif - -#ifdef HDF_NO_STD - -#include <string> - -using namespace std; - -int main(void) { - string myString("testing namespace std"); - return 0; -} - -#endif - -#ifdef BOOL_NOTDEFINED -int main(void) { - bool flag; - return 0; -} - -#endif - -#ifdef NO_STATIC_CAST - -int main(void) { - float test_float; - int test_int; - test_float = 37.0; - test_int = static_cast <int> (test_float); - return 0; -} - -#endif - #ifdef CXX_HAVE_OFFSETOF #include <stdio.h> diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 9df2b4b..821ac2d 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -20,7 +20,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) GIT_TAG ${JPEG_BRANCH} INSTALL_COMMAND "" CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DBUILD_SHARED_LIBS:BOOL=OFF -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -39,7 +39,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) URL_MD5 "" INSTALL_COMMAND "" CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DBUILD_SHARED_LIBS:BOOL=OFF -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -62,14 +62,6 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-static JPEG) set (JPEG_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-static") set (JPEG_LIBRARIES ${JPEG_STATIC_LIBRARY}) - if (BUILD_SHARED_LIBS) - # Create imported target jpeg-shared - add_library(${HDF_PACKAGE_NAMESPACE}jpeg-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}jpeg-shared "jpeg" SHARED "") - add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-shared JPEG) - set (JPEG_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-shared") - set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_SHARED_LIBRARY}) - endif () set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") set (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") @@ -97,7 +89,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) GIT_TAG ${SZIP_BRANCH} INSTALL_COMMAND "" CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DBUILD_SHARED_LIBS:BOOL=OFF -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -117,7 +109,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) URL_MD5 "" INSTALL_COMMAND "" CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DBUILD_SHARED_LIBS:BOOL=OFF -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -134,21 +126,23 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) endif () externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) -##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) +##include (${BINARY_DIR}/${SZ_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target szip-static - add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-static "szip" STATIC "") - add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-static SZIP) - set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-static") - set (SZIP_LIBRARIES ${SZIP_STATIC_LIBRARY}) - if (BUILD_SHARED_LIBS) - # Create imported target szip-shared - add_library(${HDF_PACKAGE_NAMESPACE}szip-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-shared "szip" SHARED "") - add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-shared SZIP) - set (SZIP_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-shared") - set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_SHARED_LIBRARY}) + if (USE_LIBAEC) + add_library(${HDF_PACKAGE_NAMESPACE}sz-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}sz-static "sz" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}sz-static SZIP) + add_library(${HDF_PACKAGE_NAMESPACE}aec-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}aec-static "aec" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}aec-static SZIP) + set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}sz-static;${HDF_PACKAGE_NAMESPACE}aec-static") + else () + add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-static "szip" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-static SZIP) + set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-static") endif () + set (SZIP_LIBRARIES ${SZIP_STATIC_LIBRARY}) set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") @@ -158,11 +152,15 @@ endmacro () #------------------------------------------------------------------------------- macro (PACKAGE_SZIP_LIBRARY compress_type) + set (SZIP_HDR "SZconfig") + if (USE_LIBAEC) + set (SZIP_HDR "libaec_Export") + endif () add_custom_target (SZIP-GenHeader-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/${SZIP_HDR}.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/${SZIP_HDR}.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SZIP_HDR}.h) if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") add_dependencies (SZIP-GenHeader-Copy SZIP) endif () @@ -176,7 +174,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) GIT_TAG ${ZLIB_BRANCH} INSTALL_COMMAND "" CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DBUILD_SHARED_LIBS:BOOL=OFF -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -195,7 +193,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) URL_MD5 "" INSTALL_COMMAND "" CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DBUILD_SHARED_LIBS:BOOL=OFF -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -224,14 +222,6 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-static ZLIB) set (ZLIB_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-static") set (ZLIB_LIBRARIES ${ZLIB_STATIC_LIBRARY}) - if (BUILD_SHARED_LIBS) - # Create imported target zlib-shared - add_library(${HDF_PACKAGE_NAMESPACE}zlib-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-shared ${ZLIB_LIB_NAME} SHARED "") - add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-shared ZLIB) - set (ZLIB_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-shared") - set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY}) - endif () set (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") set (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index fee6def..ae0ebca 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -28,7 +28,9 @@ macro (SET_HDF_BUILD_TYPE) endif() endif() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message (STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Setting build type to 'RelWithDebInfo' as none was specified.") + endif() set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" @@ -126,10 +128,6 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} ) - #get_property (target_name TARGET ${libtarget} PROPERTY OUTPUT_NAME) - #get_property (target_name_debug TARGET ${libtarget} PROPERTY OUTPUT_NAME_DEBUG) - #get_property (target_name_rwdi TARGET ${libtarget} PROPERTY OUTPUT_NAME_RELWITHDEBINFO) - #message (STATUS "${target_name} : ${target_name_debug} : ${target_name_rwdi}") if (${libtype} MATCHES "STATIC") if (WIN32) @@ -143,8 +141,8 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) endif () endif () - #----- Use MSVC Naming conventions for Shared Libraries - if (MINGW AND ${libtype} MATCHES "SHARED") + option (HDF5_MSVC_NAMING_CONVENTION "Use MSVC Naming conventions for Shared Libraries" OFF) + if (HDF5_MSVC_NAMING_CONVENTION AND MINGW AND ${libtype} MATCHES "SHARED") set_target_properties (${libtarget} PROPERTIES IMPORT_SUFFIX ".lib" IMPORT_PREFIX "" @@ -343,7 +341,7 @@ macro (HDF_DIR_PATHS package_prefix) set (${package_prefix}_INSTALL_INCLUDE_DIR include) endif () if (NOT ${package_prefix}_INSTALL_DATA_DIR) - if (NOT WIN32) + if (NOT MSVC) if (APPLE) if (${package_prefix}_BUILD_FRAMEWORKS) set (${package_prefix}_INSTALL_EXTRA_DIR ../SharedSupport) @@ -353,12 +351,13 @@ macro (HDF_DIR_PATHS package_prefix) set (${package_prefix}_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) endif () set (${package_prefix}_INSTALL_DATA_DIR share) - set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake) else () set (${package_prefix}_INSTALL_DATA_DIR ".") - set (${package_prefix}_INSTALL_CMAKE_DIR cmake) endif () endif () + if (NOT ${package_prefix}_INSTALL_CMAKE_DIR) + set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake) + endif () # Always use full RPATH, i.e. don't skip the full RPATH for the build tree set (CMAKE_SKIP_BUILD_RPATH FALSE) @@ -427,5 +426,49 @@ macro (HDF_DIR_PATHS package_prefix) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) endif () endif () + + if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + if (CMAKE_HOST_UNIX) + set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + CACHE PATH "Install path prefix, prepended onto install directories." FORCE) + else () + GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) + set (CMAKE_INSTALL_PREFIX + "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + CACHE PATH "Install path prefix, prepended onto install directories." FORCE) + set (CMAKE_GENERIC_PROGRAM_FILES) + endif () + endif () + +#----------------------------------------------------------------------------- +# Setup pre-3.14 FetchContent +#----------------------------------------------------------------------------- + if(${CMAKE_VERSION} VERSION_LESS 3.14) + macro(FetchContent_MakeAvailable NAME) + FetchContent_GetProperties(${NAME}) + if(NOT ${NAME}_POPULATED) + FetchContent_Populate(${NAME}) + add_subdirectory(${${NAME}_SOURCE_DIR} ${${NAME}_BINARY_DIR}) + endif() + endmacro() + endif() +endmacro () + +macro (ADD_H5_FLAGS h5_flag_var infile) + file (STRINGS ${infile} TEST_FLAG_STREAM) + #message (TRACE "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") + list (LENGTH TEST_FLAG_STREAM len_flag) + if (len_flag GREATER 0) + math (EXPR _FP_LEN "${len_flag} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET TEST_FLAG_STREAM ${line} str_flag) + string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") + #message (TRACE "str_flag=${str_flag}") + if (str_flag) + list (APPEND ${h5_flag_var} "${str_flag}") + endif () + endforeach () + endif () + #message (TRACE "h5_flag_var=${${h5_flag_var}}") endmacro () diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 0b9b530..2d7e1b4 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -5,7 +5,7 @@ * 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://support.hdfgroup.org/ftp/HDF5/releases. * + * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -88,25 +88,6 @@ int main(void) } #endif - -#ifdef TIME_WITH_SYS_TIME -/* Time with sys/time test */ - -#include <sys/types.h> -#include <sys/time.h> -#include <time.h> - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} - -#endif - #ifdef STDC_HEADERS #include <stdlib.h> #include <stdarg.h> @@ -162,26 +143,6 @@ main () #endif /* HAVE_FUNCTION */ -#ifdef HAVE_TM_GMTOFF - -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#endif -#include <time.h> -SIMPLE_TEST(struct tm tm; tm.tm_gmtoff=0); - -#endif /* HAVE_TM_GMTOFF */ - -#ifdef HAVE___TM_GMTOFF - -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#endif -#include <time.h> -SIMPLE_TEST(struct tm tm; tm.__tm_gmtoff=0); - -#endif /* HAVE_TM___GMTOFF */ - #ifdef HAVE_TIMEZONE #ifdef HAVE_SYS_TIME_H @@ -192,24 +153,6 @@ SIMPLE_TEST(timezone=0); #endif /* HAVE_TIMEZONE */ -#ifdef HAVE_STRUCT_TIMEZONE - -#include <sys/types.h> -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#endif -#include <time.h> -SIMPLE_TEST(struct timezone tz; tz.tz_minuteswest=0); - -#endif /* HAVE_STRUCT_TIMEZONE */ - -#ifdef HAVE_STAT_ST_BLOCKS - -#include <sys/stat.h> -SIMPLE_TEST(struct stat sb; sb.st_blocks=0); - -#endif /* HAVE_STAT_ST_BLOCKS */ - #ifdef PRINTF_LL_WIDTH #ifdef HAVE_LONG_LONG @@ -235,7 +178,7 @@ int DebugReport(int reportType, char* message, int* returnValue) int main(void) { - char *llwidthArgs[] = { "I64", "l64", "l", "L", "q", "ll", NULL }; + char *llwidthArgs[] = { "I64", "l64", "ll", "l", "L", "q", NULL }; char *s = malloc(128); char **currentArg = NULL; LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576; @@ -319,16 +262,6 @@ int main() } #endif -#ifdef HAVE_STAT64_STRUCT -#include <sys/types.h> -#include <sys/stat.h>], -struct stat64 sb; -int main() -{ - return 0; -} -#endif - #ifdef TEST_DIRECT_VFD_WORKS #include <sys/types.h> #include <sys/stat.h> @@ -432,18 +365,6 @@ int main () #endif /* HAVE_IOEO */ -#ifdef HAVE_STRUCT_VIDEOCONFIG - -SIMPLE_TEST(struct videoconfig w; w.numtextcols=0); - -#endif /* HAVE_STRUCT_VIDEOCONFIG */ - -#ifdef HAVE_STRUCT_TEXT_INFO - -SIMPLE_TEST(struct text_info w; w.screenwidth=0); - -#endif /* HAVE_STRUCT_TEXT_INFO */ - #if defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE ) #ifndef __cplusplus #if defined( HAVE_INLINE ) diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake index 8d98147..580c409 100644 --- a/config/cmake_ext_mod/HDFUseCXX.cmake +++ b/config/cmake_ext_mod/HDFUseCXX.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -70,7 +70,9 @@ macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) ) endif () - #message (STATUS "Performing ${OTHER_TEST}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Performing ${OTHER_TEST}") + endif () TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFCXXTests.cpp @@ -80,9 +82,13 @@ macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) ) if (${OTHER_TEST} EQUAL 0) set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") - message (STATUS "Performing CXX Test ${OTHER_TEST} - Success") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing CXX Test ${OTHER_TEST} - Success") + endif () else () - message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing CXX Test ${OTHER_TEST} - Failed") + endif () set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" @@ -97,11 +103,6 @@ endmacro () #----------------------------------------------------------------------------- if (CMAKE_CXX_COMPILER_LOADED) foreach (cxx_test - OLD_HEADER_FILENAME - HDF_NO_NAMESPACE - HDF_NO_STD - BOOL_NOTDEFINED - NO_STATIC_CAST CXX_HAVE_OFFSETOF ) HDF_CXX_FUNCTION_TEST (${cxx_test}) diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 0a6a092..9cbcd76 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -135,7 +135,9 @@ else () # so this one is used for a sizeof test. #----------------------------------------------------------------------------- macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) - message (STATUS "Testing Fortran ${FUNCTION}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION}") + endif () if (HDF5_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}") @@ -153,13 +155,17 @@ else () OUTPUT_VARIABLE OUTPUT ) - # message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - # message (STATUS "Test result ${OUTPUT}") - # message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # message (TRACE "Test result ${OUTPUT}") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # endif () if (${RESULT_VAR}) set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") - message (STATUS "Testing Fortran ${FUNCTION} - OK") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION} - OK") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n" diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index b011ae8..631fca6 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -16,18 +16,12 @@ if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") endif () -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif () if (NOT TEST_FOLDER) message (FATAL_ERROR "Require TEST_FOLDER to be defined") endif () if (NOT TEST_OUTPUT) message (FATAL_ERROR "Require TEST_OUTPUT to be defined") endif () -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif () if (NOT TEST_FILTER) message (STATUS "Optional TEST_FILTER to be defined") endif () @@ -46,7 +40,7 @@ endif () message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}") if (TEST_LIBRARY_DIRECTORY) - if (WIN32 OR MINGW) + if (WIN32) set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -55,7 +49,9 @@ endif () if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") - #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") + endif () endif () # run the test program, capture the stdout/stderr and the result var @@ -105,7 +101,7 @@ if (TEST_ERRREF) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 2b8b6b0..f552dcd 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -5,7 +5,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. # @@ -38,7 +38,7 @@ endif () message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}") if (TEST_LIBRARY_DIRECTORY) - if (WIN32 OR MINGW) + if (WIN32) set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -212,7 +212,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) @@ -283,7 +283,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) diff --git a/config/commence.am b/config/commence.am index a16eee5..96c2fc2 100644 --- a/config/commence.am +++ b/config/commence.am @@ -8,7 +8,7 @@ ## 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://support.hdfgroup.org/ftp/HDF5/releases. +## 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. @@ -44,15 +44,15 @@ LIBH5CPP_HL=$(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la # Install directories that automake doesn't know about docdir = $(exec_prefix)/doc -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -62,11 +62,11 @@ H5CC_PP=${DESTDIR}$(bindir)/h5pcc H5FC=${DESTDIR}$(bindir)/h5fc H5FC_PP=${DESTDIR}$(bindir)/h5pfc H5CPP=${DESTDIR}$(bindir)/h5c++ - + # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. @@ -96,9 +96,9 @@ CHECK_CLEANFILES=*.chkexe *.chklog *.clog *.clog2 # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - check-passthrough-vol install-doc lib progs tests uninstall-doc \ - _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + check-passthrough-vol install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help trace doxygen help: @$(top_srcdir)/bin/makehelp diff --git a/config/conclude.am b/config/conclude.am index 58c2934..9b2298c 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -8,7 +8,7 @@ ## 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://support.hdfgroup.org/ftp/HDF5/releases. +## 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. @@ -25,8 +25,8 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) -TESTS = $(TEST_PROG) $(TEST_SCRIPT) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +TESTS = $(TEST_PROG) $(TEST_SCRIPT) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) @@ -198,7 +198,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ fi; \ fi - + # The dummysh.chkexe here prevents the target from being # empty if there are no tests in the current directory. # $${log} is the log file. diff --git a/config/conclude_fc.am b/config/conclude_fc.am index 15d04a7..26f9232 100644 --- a/config/conclude_fc.am +++ b/config/conclude_fc.am @@ -8,7 +8,7 @@ ## 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://support.hdfgroup.org/ftp/HDF5/releases. +## 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. diff --git a/config/cygwin b/config/cygwin index 6ead871..8343138 100644 --- a/config/cygwin +++ b/config/cygwin @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. diff --git a/config/examples.am b/config/examples.am index 247dfa8..03108ef 100644 --- a/config/examples.am +++ b/config/examples.am @@ -8,7 +8,7 @@ ## 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://support.hdfgroup.org/ftp/HDF5/releases. +## 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. @@ -33,7 +33,7 @@ ## INSTALL_TOP_FILES ## ## EXAMPLEDIR -## The directory into which examples should be installed. +## The directory into which examples should be installed. ## ## Build rules for $(EXTRA_PROG). ## Dependencies for example programs. @@ -62,7 +62,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -109,7 +109,7 @@ installcheck-local: H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \ else \ $(MAKE) $(AM_MAKEFLAGS) check; \ - fi + fi @if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \ echo "============================"; \ echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \ diff --git a/config/freebsd b/config/freebsd index 9a9348b..7f25ba8 100644 --- a/config/freebsd +++ b/config/freebsd @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. @@ -18,19 +18,26 @@ # # See BlankForm in this directory for details. -# The default compiler is `gcc' +# The default compiler is 'cc' if test "X-" = "X-$CC"; then - CC=gcc - CC_BASENAME=gcc + CC=cc + CC_BASENAME=cc fi -# Figure out C compiler flags +# Figure out clang C compiler flags +. $srcdir/config/clang-flags + +# Figure out GNU C compiler flags . $srcdir/config/gnu-flags # Figure out Intel C compiler flags . $srcdir/config/intel-flags # The default Fortran 90 compiler +# No default Fortran compiler for clang. flang exists on +# FreeBSD as a port, but this is tied to an ancient LLVM +# and lacks Fortran 2003 features which causes configure +# to fail. if test "X-" = "X-$FC"; then case $CC_BASENAME in gcc*|pgcc*) @@ -54,3 +61,16 @@ fi # Figure out Intel F90 compiler flags . $srcdir/config/intel-fflags +# The default C++ compiler + +# The default compiler is 'c++'. +if test -z "$CXX"; then + CXX=c++ + CXX_BASENAME=c++ +fi + +# Figure out Clang CXX compiler flags +. $srcdir/config/clang-cxxflags + +# Figure out GNU CXX compiler flags +. $srcdir/config/gnu-cxxflags diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index f8a6d8c..b2ba08d 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -1,4 +1,4 @@ -# -*- shell-script -*- +# -*- shell-script -*- # # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. @@ -17,19 +17,51 @@ # if the compiler is not GNU; otherwise `cxx_flags_set' is set to `yes' # +# +# For now, do not promote any warnings to errors. +# +PROMOTE_ERRORS_DFLT=no + +# +# This filter rewrites -Werror= as -W, in that way demoting warnings +# promoted to errors back to warnings, if PROMOTE_ERRORS is no. +# +demote_errors() +{ + if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then + sed 's,-Werror=,-W,g' + else + cat + fi +} + +# +# Prepend `$srcdir/config/gnu-warnings/` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_gnu_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} + done) + IFS=' ' echo "$*" +} + # Get the compiler version in a way that works for g++ # unless a compiler version is already known # # cxx_vendor: The compiler name: g++ # cxx_version: Version number: 2.91.60, 2.7.2.1 # -if test X = "X$cxx_flags_set"; then +if test "X-" = "X-$cxx_flags_set"; then # PathScale compiler spits out gcc version string too. Need to # filter it out. # icc beginning with version 12 includes a "gcc version compatiblilty" - # string, causing the gcc H5_CFLAGS to be erroneously added. The line + # string, causing the gcc H5_CXXFLAGS to be erroneously added. The line # "grep -v 'icc version'" causes the discarding of any output - # containing 'icc version'. The cc_version for icc is correctly determined + # containing 'icc version'. The cxx_version for icc is correctly determined # and flags added in the intel-flags script. cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 | grep -v 'PathScale' |\ grep -v '^icc.*version' |\ @@ -37,26 +69,28 @@ if test X = "X$cxx_flags_set"; then cxx_vendor=`echo $cxx_version |sed 's/\([a-z]*\).*/\1/'` cxx_version=`echo $cxx_version |sed 's/[-a-z]//g'` if test X = "X$cxx_vendor" -a X != "X$cxx_version"; then - cxx_vendor=g++ + cxx_vendor=g++ fi if test "-" != "$cxx_vendor-$cxx_version"; then - echo "compiler '$CXX' is GNU $cxx_vendor-$cxx_version" + echo "compiler '$CXX' is GNU $cxx_vendor-$cxx_version" fi - # Some version numbers + # Get the compiler version numbers 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 -f3 -d.` - test -n "$cc_vers_major" || cxx_vers_major=0 - test -n "$cc_vers_minor" || cxx_vers_minor=0 - test -n "$cc_vers_patch" || cxx_vers_patch=0 + 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 -# Common g++ flags for various situations -case "$cxx_vendor-$cxx_version" in - g++*) - # Architecture-specific flags +if test "X-g++" = "X-$cxx_vendor"; then + + ############################### + # Architecture-specific flags # + ############################### + arch= case "$host_os-$host_cpu" in # FreeBSD sets the information from "uname -m" to the general machine @@ -84,742 +118,169 @@ case "$cxx_vendor-$cxx_version" in ;; esac - # Host-specific flags - case "`hostname`" in - sleipnir.ncsa.uiuc.edu) - arch="$arch -pipe" - ;; - esac - - # General (copied from H5_CFLAGS) - H5_CXXFLAGS="$H5_CXXFLAGS $arch -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wredundant-decls -Winline" - # C++-specific - H5_CXXFLAGS="$H5_CXXFLAGS -Wsign-promo -Woverloaded-virtual -Wold-style-cast -Weffc++ -Wreorder -Wnon-virtual-dtor -Wctor-dtor-privacy -Wabi" + H5_CXXFLAGS="$H5_CXXFLAGS $arch" + + ############## + # Production # + ############## - # Production # NDEBUG is handled explicitly by the configure script - case "$cxx_vendor-$cxx_version" in - g++-[34].*) + if test $cxx_vers_major -le 4; then PROD_CXXFLAGS= - ;; - g++-[56].*) + else PROD_CXXFLAGS="-fstdarg-opt" - ;; - *) - PROD_CXXFLAGS="-finline-functions" - ;; - esac + fi + + ######### + # Debug # + ######### - # Debug # NDEBUG is handled explicitly by the configure script - # -g is hanled by the symbols flags - case "$cxx_vendor-$cxx_version" in - g++-[56].*) - DEBUG_CXXFLAGS="-ftrapv -fno-common" - ;; - *) + # -g is handled by the symbols flags + if test $cxx_vers_major -le 4; then DEBUG_CXXFLAGS= - ;; - esac + else + DEBUG_CXXFLAGS="-ftrapv -fno-common" + fi + + ######################## + # Enhanced Diagnostics # + ######################## + + if test $cxx_vers_major -ge 10; then + NO_DIAGS_CXXFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color" + fi + DIAGS_CXXFLAGS= + + ########### + # Symbols # + ########### - # Symbols NO_SYMBOLS_CXXFLAGS="-s" SYMBOLS_CXXFLAGS="-g" - # Profile + ############# + # Profiling # + ############# + PROFILE_CXXFLAGS="-pg" - # Optimization - case "$cxx_vendor-$cxx_version" in - g++-[34].*) + ################ + # Optimization # + ################ + + if test $cxx_vers_major -le 4; then HIGH_OPT_CXXFLAGS="-O3" DEBUG_OPT_CXXFLAGS= - ;; - g++-[56].*) + else HIGH_OPT_CXXFLAGS="-O3" DEBUG_OPT_CXXFLAGS="-Og" - ;; - *) - HIGH_OPT_CXXFLAGS="-O" - DEBUG_OPT_CXXFLAGS= - ;; - esac + fi NO_OPT_CXXFLAGS="-O0" - # Flags are set - cxx_flags_set=yes - ;; -esac - -# Version-specific g++ flags -# -# Please follow the pattern below by adding new versions at the top, copying -# the information from the previous version and adding modifications to that. -case "$cxx_vendor-$cxx_version" in - -# Closer to the g++ 5.2 release, we should check for additional flags to -# include and break it out into it's own section, like the other versions -# below. -QAK - g++-[56]*) - - # Append warning flags from gcc-3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2" - - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow" - - # Append more extra warning flags that only gcc 4.3+ know about - # - # Technically, variable-length arrays are part of the C99 standard, but - # we should approach them a bit cautiously... -QAK - H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - - # Append more extra warning flags that only gcc 4.5+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5" - - # Append more extra warning flags that only gcc 4.6+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" - - # Append more extra warning flags that only gcc 4.7+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" - - # Append more extra warning flags that only gcc 4.8+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wsuggest-attribute=format" - - # Append more extra warning flags that only gcc 4.9+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wdate-time -Wopenmp-simd" - - # (There was no release of gcc 5.0) - - # Append more extra warning flags that only gcc 5.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Warray-bounds=2" - ;; - - g++-4.9*) - # Append warning flags - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2" - - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" - - # Append warning flags from gcc 3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" - - # Append warning flags from gcc 3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow" - - # Append more extra warning flags that only gcc 4.3+ know about - # - # Technically, variable-length arrays are part of the C99 standard, but - # we should approach them a bit cautiously... -QAK - H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - - # Append more extra warning flags that only gcc 4.5+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5" - - # Append more extra warning flags that only gcc 4.6+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" - - # Append more extra warning flags that only gcc 4.7+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" - - # Append more extra warning flags that only gcc 4.8+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wsuggest-attribute=format" - - # Append more extra warning flags that only gcc 4.9+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wdate-time -Wopenmp-simd" - ;; - - g++-4.8*) - # Append warning flags - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2" - - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow" - - # Append more extra warning flags that only gcc 4.3+ know about - # - # Technically, variable-length arrays are part of the C99 standard, but - # we should approach them a bit cautiously... -QAK - H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - - # Append more extra warning flags that only gcc 4.5+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5" - - # Append more extra warning flags that only gcc 4.6+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" - - # Append more extra warning flags that only gcc 4.7+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" - - # Append more extra warning flags that only gcc 4.8+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wsuggest-attribute=format" - ;; - - g++-4.7*) - # Append warning flags - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" + ############ + # Warnings # + ############ - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2" - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" + ########### + # General # + ########### - # Append warning flags from gcc-3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" + # Add various general warning flags in gnu-warnings for gcc versions 4.8 and later. + if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8 -o $cxx_vers_major -ge 5; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-general)" + H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments cxx-error-general)" + H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments cxx-noerror-general)" - # Append warning flags from gcc-3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" + ###################### + # Developer warnings # + ###################### - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" + # Use the C warnings as CXX warnings are the same + NO_DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments no-developer-general) + DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments developer-general) - # Append more extra warning flags that only gcc 4.0+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow" - - # Append more extra warning flags that only gcc 4.3+ know about - # - # Technically, variable-length arrays are part of the C99 standard, but - # we should approach them a bit cautiously... -QAK - H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - - # Append more extra warning flags that only gcc 4.5+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5" - - # Append more extra warning flags that only gcc 4.6+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" - - # Append more extra warning flags that only gcc 4.7+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" - ;; - - g++-4.6*) - # Disable warnings about using 'long long' type - H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2" - - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ knows about - H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow" - - # Append more extra warning flags that only gcc 4.3+ know about - # - # Technically, variable-length arrays are part of the C99 standard, but - # we should approach them a bit cautiously... -QAK - H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - - # Append more extra warning flags that only gcc 4.5+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-aliasing -Wstrict-overflow=5" - - # Append more extra warning flags that only gcc 4.6+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" - ;; - - g++-4.5*) - # Disable warnings about using 'long long' type - H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2" - - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ knows about - H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow" - - # Append more extra warning flags that only gcc 4.3+ know about - # - # Technically, variable-length arrays are part of the C99 standard, but - # we should approach them a bit cautiously... -QAK - H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - - # Append more extra warning flags that only gcc 4.5+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-aliasing -Wstrict-overflow=5" - ;; - - g++-4.4*) - # Disable warnings about using 'long long' type - H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2" - - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow" - - # Append more extra warning flags that only gcc 4.3+ know about - # - # Technically, variable-length arrays are part of the C99 standard, but - # we should approach them a bit cautiously... -QAK - H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - ;; - - g++-4.3*) - # Disable warnings about using 'long long' type - H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2" - - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations -Wvolatile-register-var" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow" - - # Append more extra warning flags that only gcc 4.3+ know about - # - # Technically, variable-length arrays are part of the C99 standard, but - # we should approach them a bit cautiously... -QAK - H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wvla" - ;; - - g++-4.2*) - # Disable warnings about using 'long long' type - H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2" - - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations -Wvolatile-register-var" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow" - ;; - - g++-4.1.*) - # Disable warnings about using 'long long' type - H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2" - - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" + fi - # Append more extra warning flags that only gcc 4.0+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" + ####################### + # gcc 4 special cases # + ####################### - # Append more extra warning flags that only gcc 4.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations -Wvolatile-register-var" - ;; + # GCC 4.8 through the end of GCC 4 series + if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then + # Use the C warnings as CXX warnings are the same + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8-4.last)" + fi - g++-4.0*) - # Disable warnings about using 'long long' type - H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long" + ############################# + # Version-specific warnings # + ############################# - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" + # gcc >= 4.8 + if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-4.8)" + # Use the C warnings as CXX warnings are the same + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.8)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.8)" + fi - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" + # gcc >= 4.9 + if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 9; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-4.9)" + fi - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CXXFLAGS="$CXXFLAGS -Wformat=2" + # gcc >= 5 + if test $cxx_vers_major -ge 5; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-5)" + H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments cxx-error-5)" + H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments cxx-noerror-5)" + fi - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" + # gcc >= 6 + if test $cxx_vers_major -ge 6; then + # Use the C warnings as CXX warnings are the same + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 6)" + fi - # Append warning flags from gcc-3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" + # gcc >= 7 + if test $cxx_vers_major -ge 7; then + # Use the C warnings as CXX warnings are the same + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 7)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-7)" + fi - # Append warning flags from gcc-3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" + # gcc 8 + if test $cxx_vers_major -ge 8; then + # Use the C warnings as CXX warnings are the same + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 8)" + #H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-8)" + #H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments noerror-8)" + # Use the C warnings as CXX warnings are the same + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-8)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-8)" + fi - # Append more extra warning flags that only gcc 4.0+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - ;; + # gcc 9 + if test $cxx_vers_major -ge 9; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-9)" + fi - g++-3.4*) - # Disable warnings about using 'long long' type - H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long" + # gcc >= 9.3 + # no cxx warnings, do NOT use C warnings - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" + # gcc >= 10 + if test $cxx_vers_major -ge 10; then + # Use the C warnings as CXX warnings are the same + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-10)" + fi - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CXXFLAGS="$CXXFLAGS -Wformat=2" - - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" - - # Append more extra warning flags that only gcc3.4+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - ;; - - g++-3.3*) - # Disable warnings about using 'long long' type - H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CXXFLAGS="$CXXFLAGS -Wformat=2" - - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" - - # Append more extra warning flags that only gcc3.3+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" - ;; - - g++-3.2*) - # Disable warnings about using 'long long' type - H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append more extra warning flags that only gcc3.2+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CXXFLAGS="$CXXFLAGS -Wformat=2" - - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" - ;; - - g++-3*) - # Disable warnings about using 'long long' type - H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long" - - # Append some extra warning flags that only gcc3+ know about - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" - ;; -esac + ################# + # Flags are set # + ################# + cxx_flags_set=yes +fi # Clear cxx info if no flags set if test "X$cxx_flags_set" = "X"; then diff --git a/config/gnu-fflags b/config/gnu-fflags index 185a4c6..ec4fcab 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. @@ -17,6 +17,20 @@ # if the compiler is not GNU; otherwise `f9x_flags_set' is set to `yes' # +# +# Prepend `$srcdir/config/gnu-warnings/` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_gnu_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} + done) + IFS=' ' echo "$*" +} + # Get the compiler version in a way that works for GNU fortran # gfortran unless a compiler version is already known # @@ -91,12 +105,21 @@ if test "X-gfortran" = "X-$f9x_vendor"; then DEBUG_FCFLAGS="-fbounds-check" fi + ######################## + # Enhanced Diagnostics # + ######################## + + if test $f9x_vers_major -ge 10; then + NO_DIAGS_FCFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color" + fi + DIAGS_FCFLAGS= + ########### # Symbols # ########### - SYMBOLS_FCFLAGS="-g" NO_SYMBOLS_FCFLAGS="-s" + SYMBOLS_FCFLAGS="-g" ############# # Profiling # @@ -125,57 +148,34 @@ if test "X-gfortran" = "X-$f9x_vendor"; then # General # ########### - H5_FCFLAGS="$H5_FCFLAGS -pedantic -Wall -Wextra -Wunderflow -Wimplicit-interface -Wsurprising" - H5_FCFLAGS="$H5_FCFLAGS -Waliasing -Wcharacter-truncation" + H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-general)" ############################# # Version-specific warnings # ############################# - # gfortran 4.3 (nothing new) - - # gfortran 4.4 - if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 4; then - H5_FCFLAGS="$H5_FCFLAGS -Warray-temporaries -Wintrinsics-std" - fi - - # gfortran 4.5 - if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 5; then - H5_FCFLAGS="$H5_FCFLAGS -Wimplicit-procedure" - fi - - # gfortran 4.6 (nothing new) - - # gfortran 4.7 - if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 7; then - H5_FCFLAGS="$H5_FCFLAGS -Wreal-q-constant -Wfunction-elimination" - fi - - # gfortran 4.8 + # gfortran >= 4.8 if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 8; then - H5_FCFLAGS="$H5_FCFLAGS -Wrealloc-lhs -Wrealloc-lhs-all" - # Turn off warnings for passing non-ANSI types to BIND(). - # We pass a lot of hid_t, etc. types so this generates a LOT of spurious warnings. - H5_FCFLAGS="$H5_FCFLAGS -Wno-c-binding-type" + H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.8)" fi # gfortran 4.9 (nothing new) - # gfortran 5 + # gfortran >= 5 if test $f9x_vers_major -ge 5; then - H5_FCFLAGS="$H5_FCFLAGS -Wuse-without-only" + H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-5)" fi - # gfortran 6 + # gfortran >= 6 if test $f9x_vers_major -ge 6; then - H5_FCFLAGS="$H5_FCFLAGS -Winteger-division" + H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-6)" fi # gfortran 7 (nothing new) - # gfortran 8 + # gfortran >= 8 if test $f9x_vers_major -ge 8; then - H5_FCFLAGS="$H5_FCFLAGS -Wfrontend-loop-interchange" + H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-8)" fi # gfortran 9 (nothing new) diff --git a/config/gnu-flags b/config/gnu-flags index ca8d363..3e4ceb2 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. @@ -18,20 +18,37 @@ # # -# Prepend `$srcdir/config/gnu-` to the filename suffix(es) given as +# For now, do not promote any warnings to errors. +# +PROMOTE_ERRORS_DFLT=no + +# +# This filter rewrites -Werror= as -W, in that way demoting warnings +# promoted to errors back to warnings, if PROMOTE_ERRORS is no. +# +demote_errors() +{ + if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then + sed 's,-Werror=,-W,g' + else + cat + fi +} + +# +# Prepend `$srcdir/config/gnu-warnings/` to the filename suffix(es) given as # subroutine argument(s), remove comments starting with # and ending # at EOL, replace spans of whitespace (including newlines) with spaces, # and re-emit the file(s) thus filtered on the standard output stream. # -load_gcc_arguments() +load_gnu_arguments() { set -- $(for arg; do - sed 's,#.*$,,' $srcdir/config/gnu-${arg} + sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} done) IFS=' ' echo "$*" } - # Get the compiler version in a way that works for gcc # unless a compiler version is already known # @@ -101,12 +118,16 @@ if test "X-gcc" = "X-$cc_vendor"; then esac case "$host_os-$host_cpu" in - # cygwin needs the "-std=c99" flag removed, so make - # a specific case for Cygwin without the flag and a default - # case to add the flag everywhere else + # Cygwin needs the "-std=c99" flag removed. cygwin-*) ;; - + # On Solaris, gcc needs the gnu99 standard to pick up certain POSIX + # things. Do NOT use this as the gcc norm as this encourages the use + # of non-standard gcc extensions. + *solaris*) + H5_CFLAGS="$H5_CFLAGS -std=gnu99" + ;; + # Everybody else gets c99 as the standard. *) H5_CFLAGS="$H5_CFLAGS -std=c99" ;; @@ -137,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 # ########### @@ -171,140 +201,86 @@ if test "X-gcc" = "X-$cc_vendor"; then # General # ########### - # Note that some of the flags listed here really should be developer - # flags (listed in a separate variable, below) but we put them here - # because they are not raised by the current code and we'd like to - # know if they do start showing up. - # - # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) - # warnings that are emitted. If you need it, add it from the - # environment variable at configure time. - # - # NOTE: Disable the -Wformat-nonliteral from -Wformat=2 here and re-add - # it to the developer flags. - # - # NOTE: Due to the divergence in the C and C++, we're dropping support for - # compiling the C library with a C++ compiler and dropping the -Wc++-compat - # warning. - H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments warnings-general)" - H5_CFLAGS="$H5_CFLAGS -Wbad-function-cast -Wcast-align" - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wdisabled-optimization" - H5_CFLAGS="$H5_CFLAGS -Wmissing-declarations" - H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked" - H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wswitch-default" - H5_CFLAGS="$H5_CFLAGS -Wunused-macros -Wunsafe-loop-optimizations" - - ###################### - # Developer warnings # - ###################### - - # (suggestions from gcc, not code problems) - # NOTE: -Wformat-nonliteral added back in here (from being disabled in H5_CFLAGS) - NO_DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments warnings-no-developer-general) - DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments warnings-developer-general) + # Add various general warning flags in gnu-warnings for gcc versions 4.8 and later. + if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8 -o $cc_vers_major -gt 4; then + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)" + H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)" + H5_NECFLAGS="$H5_NECFLAGS $(load_gnu_arguments noerror-general)" - ####################### - # gcc 4 special cases # - ####################### + ###################### + # Developer warnings # + ###################### - # Disable warnings about using the 'long long' type w/ gcc 4.6 and earlier - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then - H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - fi + NO_DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments no-developer-general) + DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments developer-general) - # -Wvolatile-register-var was later incorporated into -Wall and - # only needs to be specified explicitly for gcc 4.2-4.3 - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then - H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var" fi - # -Wstrict-aliasing was later incorporated into -Wall and - # only needs to be specified explicitly for gcc 4.5-4.6 - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then - H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing" - fi - - # The non-valued form of -Wstrict-overflow is used in gcc 4.2-4.4 - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -a $cc_vers_major -eq 4 -a $cc_vers_minor -le 4; then - H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow" - fi + ####################### + # gcc 4 special cases # + ####################### - # -Wvla was later incorporated into -Wpedantic and - # only needs to be specified explicitly for gcc 4 - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then - H5_CFLAGS="$H5_CFLAGS -Wvla" + # GCC 4.8 through the end of GCC 4 series + if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.8-4.last)" fi ############################# # Version-specific warnings # ############################# - # gcc 4.3 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then - H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560" - fi - - # gcc 4.4 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then - H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - fi - - # gcc 4.5 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then - H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - fi - - # gcc 4.6 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 6; then - H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" - fi - - # gcc 4.7 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 7; then - H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" - fi - - # gcc 4.8 + # gcc >= 4.8 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.8)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.8)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.8)" fi - # gcc 4.9 + # gcc >= 4.9 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 9; then - H5_CFLAGS="$H5_CFLAGS -Wdate-time" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.9)" fi - # gcc 5 + # gcc >= 5 if test $cc_vers_major -ge 5; then - H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 5)" + H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-5)" + H5_NECFLAGS="$H5_NECFLAGS $(load_gnu_arguments noerror-5)" fi - # gcc 6 + # gcc >= 6 if test $cc_vers_major -ge 6; then - H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 6)" fi - # gcc 7 + # gcc >= 7 if test $cc_vers_major -ge 7; then - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wstringop-overflow=2" - H5_CFLAGS="$H5_CFLAGS -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wrestrict" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-7)" fi # gcc 8 if test $cc_vers_major -ge 8; then - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wstringop-overflow=4 -Wsuggest-attribute=cold -Wsuggest-attribute=malloc" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=cold -Wno-suggest-attribute=malloc" - H5_CFLAGS="$H5_CFLAGS -Wattribute-alias -Wcast-align=strict -Wshift-overflow=2" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 8)" + H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-8)" + H5_NECFLAGS="$H5_NECFLAGS $(load_gnu_arguments noerror-8)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-8)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-8)" fi # gcc 9 if test $cc_vers_major -ge 9; then - H5_CFLAGS="$H5_CFLAGS -Wattribute-alias=2 -Wmissing-profile" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 9)" + fi + + # gcc >= 9.3 + if test $cc_vers_major -ge 10 -o $cc_vers_major -eq 9 -a $cc_vers_minor -ge 3; then + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 9.3)" + fi + + # gcc >= 10 + if test $cc_vers_major -ge 10; then + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-10)" fi ################# @@ -318,3 +294,4 @@ if test "X$cc_flags_set" = "X"; then cc_vendor= cc_version= fi + diff --git a/config/gnu-warnings-no-developer-general b/config/gnu-warnings-no-developer-general deleted file mode 100644 index 85dc0a3..0000000 --- a/config/gnu-warnings-no-developer-general +++ /dev/null @@ -1,4 +0,0 @@ --Wno-aggregate-return --Wno-inline --Wno-missing-format-attribute --Wno-missing-noreturn diff --git a/config/gnu-warnings/4.8 b/config/gnu-warnings/4.8 new file mode 100644 index 0000000..fa678ff --- /dev/null +++ b/config/gnu-warnings/4.8 @@ -0,0 +1,29 @@ +# warning flags added for GCC >= 4.3 +-Wlarger-than=2560 +-Wlogical-op + +# warning flags added for GCC >= 4.4 +-Wframe-larger-than=16384 +-Wpacked-bitfield-compat +-Wsync-nand + +# warning flag added for GCC >= 4.5 +-Wstrict-overflow=5 + +# This warning can only be truly addressed using the gcc extension of +# using D to indicate doubles (e.g., 1.23D). +-Wno-unsuffixed-float-constants + +# warning flags added for GCC >= 4.6 +-Wdouble-promotion +-Wtrampolines + +# warning flag added for GCC >= 4.7 +# +# -Wstack-usage=8192 warnings need to be swept up on a branch so +# that we can stop burdening the whole development team. +# +-Wstack-usage=8192 + +# warning flag added for GCC >= 4.8 +-Wmaybe-uninitialized diff --git a/config/gnu-warnings/4.8-4.last b/config/gnu-warnings/4.8-4.last new file mode 100644 index 0000000..2db90fb --- /dev/null +++ b/config/gnu-warnings/4.8-4.last @@ -0,0 +1,3 @@ +# -Wvla was later incorporated into -Wpedantic and +# only needs to be specified explicitly for gcc 4 +-Wvla diff --git a/config/gnu-warnings/4.9 b/config/gnu-warnings/4.9 new file mode 100644 index 0000000..78aa929 --- /dev/null +++ b/config/gnu-warnings/4.9 @@ -0,0 +1 @@ +-Wdate-time diff --git a/config/gnu-warnings/5 b/config/gnu-warnings/5 new file mode 100644 index 0000000..32cb196 --- /dev/null +++ b/config/gnu-warnings/5 @@ -0,0 +1,2 @@ +-Warray-bounds=2 +-Wc99-c11-compat diff --git a/config/gnu-warnings/6 b/config/gnu-warnings/6 new file mode 100644 index 0000000..736a446 --- /dev/null +++ b/config/gnu-warnings/6 @@ -0,0 +1,9 @@ +# +# Careful! -Wduplicated-cond, combined with HDF5's heavy use of +# macros, can make a lot of noise. +# +-Wduplicated-cond +-Whsa +-Wnormalized +-Wnull-dereference +-Wunused-const-variable diff --git a/config/gnu-warnings/7 b/config/gnu-warnings/7 new file mode 100644 index 0000000..9d5b44d --- /dev/null +++ b/config/gnu-warnings/7 @@ -0,0 +1,6 @@ +-Walloca +-Walloc-zero +-Wduplicated-branches +-Wformat-overflow=2 +-Wformat-truncation=1 +-Wrestrict diff --git a/config/gnu-warnings/8 b/config/gnu-warnings/8 new file mode 100644 index 0000000..5e7519d --- /dev/null +++ b/config/gnu-warnings/8 @@ -0,0 +1,3 @@ +-Wattribute-alias +-Wcast-align=strict +-Wshift-overflow=2 diff --git a/config/gnu-warnings/9 b/config/gnu-warnings/9 new file mode 100644 index 0000000..c084350 --- /dev/null +++ b/config/gnu-warnings/9 @@ -0,0 +1,2 @@ +-Wattribute-alias=2 +-Wmissing-profile diff --git a/config/gnu-warnings/9.3 b/config/gnu-warnings/9.3 new file mode 100644 index 0000000..f37fdd6 --- /dev/null +++ b/config/gnu-warnings/9.3 @@ -0,0 +1 @@ +-Wc11-c2x-compat diff --git a/config/gnu-warnings/cxx-4.8 b/config/gnu-warnings/cxx-4.8 new file mode 100644 index 0000000..744ebdc --- /dev/null +++ b/config/gnu-warnings/cxx-4.8 @@ -0,0 +1,26 @@ +# warning flags added for GCC >= 4.3 +-Wlarger-than=2560 +-Wlogical-op + +# warning flags added for GCC >= 4.4 +-Wframe-larger-than=16384 +-Wpacked-bitfield-compat +-Wsync-nand + +# warning flag added for GCC >= 4.5 +-Wstrict-overflow=5 + +# warning flags added for GCC >= 4.6 +-Wdouble-promotion +-Wtrampolines + +# warning flag added for GCC >= 4.7 +# +# -Wstack-usage=8192 warnings need to be swept up on a branch so +# that we can stop burdening the whole development team. +# +-Wstack-usage=8192 + +# warning flag added for GCC >= 4.8 +-Wmaybe-uninitialized + diff --git a/config/gnu-warnings/cxx-4.9 b/config/gnu-warnings/cxx-4.9 new file mode 100644 index 0000000..30553bd --- /dev/null +++ b/config/gnu-warnings/cxx-4.9 @@ -0,0 +1,2 @@ +-Wdate-time +-Wopenmp-simd diff --git a/config/gnu-warnings/cxx-5 b/config/gnu-warnings/cxx-5 new file mode 100644 index 0000000..723e448 --- /dev/null +++ b/config/gnu-warnings/cxx-5 @@ -0,0 +1 @@ +-Warray-bounds=2 diff --git a/config/gnu-warnings/cxx-9 b/config/gnu-warnings/cxx-9 new file mode 100644 index 0000000..8f843a4 --- /dev/null +++ b/config/gnu-warnings/cxx-9 @@ -0,0 +1,4 @@ +-Wattribute-alias=2 +-Wmissing-profile +# Turn this on when the C++ wrappers obey the Rule of Five +-Wno-deprecated-copy diff --git a/config/gnu-warnings/cxx-error-5 b/config/gnu-warnings/cxx-error-5 new file mode 100644 index 0000000..8cc8c9d --- /dev/null +++ b/config/gnu-warnings/cxx-error-5 @@ -0,0 +1,11 @@ +# +# In GCC 4.4.7, the compiler gripes about shadowed global +# declarations when a local variable uses the name of a +# function that's in a system header file. For some reason, +# later versions of GCC (e.g., 5.2.0) don't complain about +# the shadowed globals. Maybe later versions are less fussy? +# Anyway, the shadowing seems to be harmless, and GCC 4.4.7 +# is not a supported compiler, so let us promote shadowed globals +# warnings to errors only for GCC 5 and later. +# +-Werror=shadow diff --git a/config/gnu-warnings/cxx-error-general b/config/gnu-warnings/cxx-error-general new file mode 100644 index 0000000..85cd9a3 --- /dev/null +++ b/config/gnu-warnings/cxx-error-general @@ -0,0 +1,32 @@ +# +# HDF5 code should not trigger the following warnings under any +# circumstances, so ask the compiler to treat them as errors: +# +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/tcompound.cpp +# -Werror=cast-align +-Wcast-align +# NOTE: c++/src files are not compatible with these warnings as errors +# c++/src/H5Object.cpp +# -Werror=missing-declarations +-Wmissing-declarations +-Werror=packed +-Werror=redundant-decls +-Werror=switch +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/tattr.cpp +# -Werror=unused-but-set-variable +-Wunused-but-set-variable +-Werror=unused-function +-Werror=unused-variable +# NOTE: c++/src files are not compatible with these warnings as errors +# c++/src/H5Object.cpp,c++/src/H5StrType.cpp,c++/src/H5PredType.cpp +# -Werror=unused-parameter +-Wunused-parameter +# +# Other files not compatible +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/titerate.cpp,c++/test/tarray.cpp +# -Werror=missing-declarations +# c++/test/titerate.cpp,c++/test/tarray.cpp,c++/test/tlinks.cpp,c++/test/ttypes.cpp,c++/test/dsets.cpp +# -Werror=unused-parameter diff --git a/config/gnu-warnings/cxx-general b/config/gnu-warnings/cxx-general new file mode 100644 index 0000000..9548cc0 --- /dev/null +++ b/config/gnu-warnings/cxx-general @@ -0,0 +1,31 @@ +# Note that some of the flags listed here really should be developer +# flags (listed in separate files, gnu-warnings-developer*) but we put +# them here because they are not raised by the current code and we'd like to +# know if they do start showing up. +# +# NOTE: Don't add -Wpadded here since we can't/won't fix the (many) +# warnings that are emitted. If you need it, add it from the +# environment variable at configure time. +-Wall +-Wcast-qual +-Wconversion +-Wctor-dtor-privacy +-Weffc++ +-Wextra +-Wfloat-equal +-Wformat=2 +-Winit-self +-Winvalid-pch +-Wmissing-include-dirs +-Wno-format-nonliteral +-Wnon-virtual-dtor +-Wold-style-cast +-Woverloaded-virtual +-Wreorder +-Wshadow +-Wsign-promo +##-Wunreachable-code +-Wundef +##-Wvariadic-macros +-Wwrite-strings +-pedantic diff --git a/config/gnu-warnings/cxx-noerror-5 b/config/gnu-warnings/cxx-noerror-5 new file mode 100644 index 0000000..7bce3e8 --- /dev/null +++ b/config/gnu-warnings/cxx-noerror-5 @@ -0,0 +1,11 @@ +# +# In GCC 4.4.7, the compiler gripes about shadowed global +# declarations when a local variable uses the name of a +# function that's in a system header file. For some reason, +# later versions of GCC (e.g., 5.2.0) don't complain about +# the shadowed globals. Maybe later versions are less fussy? +# Anyway, the shadowing seems to be harmless, and GCC 4.4.7 +# is not a supported compiler, so let us promote shadowed globals +# warnings to errors only for GCC 5 and later. +# +-Wshadow diff --git a/config/gnu-warnings/cxx-noerror-general b/config/gnu-warnings/cxx-noerror-general new file mode 100644 index 0000000..8cc1d94 --- /dev/null +++ b/config/gnu-warnings/cxx-noerror-general @@ -0,0 +1,32 @@ +# +# HDF5 code should not trigger the following warnings under any +# circumstances, so ask the compiler to treat them as errors: +# +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/tcompound.cpp +# -Werror=cast-align +-Wcast-align +# NOTE: c++/src files are not compatible with these warnings as errors +# c++/src/H5Object.cpp +# -Werror=missing-declarations +-Wmissing-declarations +-Wpacked +-Wredundant-decls +-Wswitch +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/tattr.cpp +# -Werror=unused-but-set-variable +-Wunused-but-set-variable +-Wunused-function +-Wunused-variable +# NOTE: c++/src files are not compatible with these warnings as errors +# c++/src/H5Object.cpp,c++/src/H5StrType.cpp,c++/src/H5PredType.cpp +# -Werror=unused-parameter +-Wunused-parameter +# +# Other files not compatible +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/titerate.cpp,c++/test/tarray.cpp +# -Werror=missing-declarations +# c++/test/titerate.cpp,c++/test/tarray.cpp,c++/test/tlinks.cpp,c++/test/ttypes.cpp,c++/test/dsets.cpp +# -Werror=unused-parameter diff --git a/config/gnu-warnings/developer-10 b/config/gnu-warnings/developer-10 new file mode 100644 index 0000000..022c97f --- /dev/null +++ b/config/gnu-warnings/developer-10 @@ -0,0 +1,2 @@ +# New warning +-Warith-conversion diff --git a/config/gnu-warnings/developer-4.8 b/config/gnu-warnings/developer-4.8 new file mode 100644 index 0000000..bfd15a1 --- /dev/null +++ b/config/gnu-warnings/developer-4.8 @@ -0,0 +1,22 @@ +# developer warning flags added for GCC >= 4.5 +# +# -Wjump-misses-init makes lots of noise for a questionable benefit. +# Can jumping over an initialization in C cause any harm, if +# the variable is never *used* before it has been initialized? +# +-Wjump-misses-init + +# developer warning flag added for GCC >= 4.6 +-Wsuggest-attribute=const + +# developer warning flags added for GCC >= 4.7 +-Wsuggest-attribute=noreturn +-Wsuggest-attribute=pure +# +# It's not clear that -Wvector-operation-performance warnings are +# actionable, so they are demoted to "developer" warnings. +# +-Wvector-operation-performance + +# developer warning flag added for GCC >= 4.8 +-Wsuggest-attribute=format diff --git a/config/gnu-warnings/developer-7 b/config/gnu-warnings/developer-7 new file mode 100644 index 0000000..2a3ce7e --- /dev/null +++ b/config/gnu-warnings/developer-7 @@ -0,0 +1 @@ +-Wstringop-overflow=2 diff --git a/config/gnu-warnings/developer-8 b/config/gnu-warnings/developer-8 new file mode 100644 index 0000000..a2ba7ca --- /dev/null +++ b/config/gnu-warnings/developer-8 @@ -0,0 +1,3 @@ +-Wstringop-overflow=4 +-Wsuggest-attribute=cold +-Wsuggest-attribute=malloc diff --git a/config/gnu-warnings-developer-general b/config/gnu-warnings/developer-general index 698f0e0..b34c4b7 100644 --- a/config/gnu-warnings-developer-general +++ b/config/gnu-warnings/developer-general @@ -2,7 +2,12 @@ # NOTE: -Wformat-nonliteral added back in here (from being disabled in # H5_CFLAGS) -Waggregate-return +-Wdisabled-optimization -Wformat-nonliteral -Winline -Wmissing-format-attribute -Wmissing-noreturn +-Wswitch-default +-Wswitch-enum +-Wunsafe-loop-optimizations +-Wunused-macros diff --git a/config/gnu-warnings/error-5 b/config/gnu-warnings/error-5 new file mode 100644 index 0000000..f7e1138 --- /dev/null +++ b/config/gnu-warnings/error-5 @@ -0,0 +1,12 @@ +-Werror=incompatible-pointer-types +# +# In GCC 4.4.7, the compiler gripes about shadowed global +# declarations when a local variable uses the name of a +# function that's in a system header file. For some reason, +# later versions of GCC (e.g., 5.2.0) don't complain about +# the shadowed globals. Maybe later versions are less fussy? +# Anyway, the shadowing seems to be harmless, and GCC 4.4.7 +# is not a supported compiler, so let us promote shadowed globals +# warnings to errors only for GCC 5 and later. +# +-Werror=shadow diff --git a/config/gnu-warnings/error-8 b/config/gnu-warnings/error-8 new file mode 100644 index 0000000..2f54a4d --- /dev/null +++ b/config/gnu-warnings/error-8 @@ -0,0 +1,25 @@ +# NOTE: src/ files are not compatible with these warnings as errors +# src/H5Dchunk.c +# -Werror=cast-function-type +-Wcast-function-type +# +# For GCC 8, promote maybe-initialized warnings to an error. GCC 8 +# reports 0 maybe-uninitialized warnings where earlier versions +# make many false reports. GCC 8 seems to analyze calls to static +# in order to detect initializations that occur there. It's possible +# that GCC 8 only performs that analysis at -O3, though. +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDlog.c, +# -Werror=maybe-uninitialized +-Wmaybe-uninitialized +# NOTE: src/ files are not compatible with these warnings as errors +# src/H5Shyper.c,src/H5SL.c,src/H5Shyper.c +# -Werror=maybe-uninitialized +# NOTE: Test files are not compatible with these warnings as errors +# test/cache_common.c, +# -Werror=maybe-uninitialized +# NOTE: hl/src/ files are not compatible with these warnings as errors +# hl/src/H5DS.c, +# -Werror=maybe-uninitialized diff --git a/config/gnu-warnings/error-general b/config/gnu-warnings/error-general new file mode 100644 index 0000000..8405c40 --- /dev/null +++ b/config/gnu-warnings/error-general @@ -0,0 +1,90 @@ +# +# HDF5 code should not trigger the following warnings under any +# circumstances, so ask the compiler to treat them as errors: +# +-Werror=bad-function-cast +-Werror=implicit-function-declaration +-Werror=missing-declarations +-Werror=missing-prototypes +-Werror=nested-externs +-Werror=old-style-definition +-Werror=packed +-Werror=pointer-sign +-Werror=pointer-to-int-cast +-Werror=redundant-decls +-Werror=strict-prototypes +-Werror=switch +# +#-Werror=discarded-qualifiers +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDdirect.c,H5FDmpio.c,H5FDros3.c, +# -Werror=unused-function +# +-Wunused-function +# +# H5FDdrvr_module.h +# -Werror=unused-variable +# +-Wunused-variable +# +# H5VLpassthru.c +# -Werror=unused-parameter +# +-Wunused-parameter +# +# +# +# NOTE: Tools files are not compatible with these warnings as errors +# lib/h5tools.c +# -Werror=cast-align +# +-Wcast-align +# +# lib/h5diff_array.c +# -Werror=unused-but-set-variable +# +-Wunused-but-set-variable +# +# lib/h5tools_utils.c +# -Werror=unused-parameter +# +# +# NOTE: JNI files are not compatible with these warnings as errors +# jni/h5pDCPLImp.c,jni/nativeData.c,jni/h5util.c,jni/h5rImp.c +# jni/h5sImp.c,jni/h5tImp.c +# -Werror=cast-align +# jni/h5util.c +# -Werror=format(-overflow) +# +-Werror=format +# +# +#Examples and tests do not use the same set of extensive warning flags as libraries +# Here is a list of tests and examples that have issues with the stricter warnings as error +# +# NOTE: Test files are not compatible with these warnings as errors +# thread_id.c, +# -Werror=unused-function +# dsets.c +# -Werror=unused-parameter +# external.c,perform/sio_engine.c +# -Werror=format(-truncation) +# +# +# NOTE: Examples files are not compatible with these warnings as errors +# h5_vds-eiger.c,h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c,h5_vds-percival-unlim-maxmin.c +# h5_vds-percival.c,h5_read.c,h5_rdwt.c,h5_mount.c,h5_extend.c,h5_extend_write.c +# h5_write.c,h5_vds-simpleIO.c,h5_ref2reg_deprec.c,h5_crtgrp.c,h5_select.c +# h5_vds-percival-unlim.c,h5_crtatt.c,h5_group.c,h5_attribute.c,h5_crtdat.c +# h5_reference_deprec.c +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=strict-prototypes +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=old-style-definition +# h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c, +# -Werror=unused-variable +# h5_elink_unix2win.c,h5_extlink.c,h5_attribute.c +# -Werror=unused-parameter + diff --git a/config/gnu-warnings-general b/config/gnu-warnings/general index 9e67b71..a7a20b7 100644 --- a/config/gnu-warnings-general +++ b/config/gnu-warnings/general @@ -29,4 +29,4 @@ -Wshadow -Wundef -Wwrite-strings --pedantic
\ No newline at end of file +-pedantic diff --git a/config/gnu-warnings/gfort-4.8 b/config/gnu-warnings/gfort-4.8 new file mode 100644 index 0000000..9d880de --- /dev/null +++ b/config/gnu-warnings/gfort-4.8 @@ -0,0 +1,17 @@ +# warning flags added for gfortran >= 4.4 +-Warray-temporaries +-Wintrinsics-std + +# warning flag added for gfortran >= 4.5 +-Wimplicit-procedure + +# warning flags added for gfortran >= 4.7 +-Wreal-q-constant +-Wfunction-elimination + +# warning flags added for gfortran >= 4.8 +-Wrealloc-lhs +-Wrealloc-lhs-all +# Turn off warnings for passing non-ANSI types to BIND(). +# We pass a lot of hid_t, etc. types so this generates a LOT of spurious warnings. +-Wno-c-binding-type diff --git a/config/gnu-warnings/gfort-5 b/config/gnu-warnings/gfort-5 new file mode 100644 index 0000000..c5d3850 --- /dev/null +++ b/config/gnu-warnings/gfort-5 @@ -0,0 +1 @@ +-Wuse-without-only diff --git a/config/gnu-warnings/gfort-6 b/config/gnu-warnings/gfort-6 new file mode 100644 index 0000000..f70466c --- /dev/null +++ b/config/gnu-warnings/gfort-6 @@ -0,0 +1 @@ +-Winteger-division diff --git a/config/gnu-warnings/gfort-8 b/config/gnu-warnings/gfort-8 new file mode 100644 index 0000000..5097365 --- /dev/null +++ b/config/gnu-warnings/gfort-8 @@ -0,0 +1 @@ +-Wfrontend-loop-interchange diff --git a/config/intel-warnings-general b/config/gnu-warnings/gfort-general index f4ed24c..4028316 100644 --- a/config/intel-warnings-general +++ b/config/gnu-warnings/gfort-general @@ -2,9 +2,11 @@ # flags (listed in separate files, gnu-warnings-developer*) but we put # them here because they are not raised by the current code and we'd like to # know if they do start showing up. -# -# NOTE: Don't add -Wpadded here since we can't/won't fix the (many) -# warnings that are emitted. If you need it, add it from the -# environment variable at configure time. +-Waliasing -Wall --Wcheck
\ No newline at end of file +-Wcharacter-truncation +-Wextra +-Wimplicit-interface +-Wsurprising +-Wunderflow +-pedantic diff --git a/config/gnu-warnings/no-developer-4.8 b/config/gnu-warnings/no-developer-4.8 new file mode 100644 index 0000000..09a9a96 --- /dev/null +++ b/config/gnu-warnings/no-developer-4.8 @@ -0,0 +1,12 @@ +# no-developer warning flag added for GCC >= 4.5 +-Wno-jump-misses-init + +# no-developer warning flag added for GCC >= 4.6 +-Wno-suggest-attribute=const + +# no-developer warning flags added for GCC >= 4.7 +-Wno-suggest-attribute=noreturn +-Wno-suggest-attribute=pure + +# no-developer warning flag added for GCC >= 4.8 +-Wno-suggest-attribute=format diff --git a/config/gnu-warnings/no-developer-8 b/config/gnu-warnings/no-developer-8 new file mode 100644 index 0000000..2134bad --- /dev/null +++ b/config/gnu-warnings/no-developer-8 @@ -0,0 +1,2 @@ +-Wno-suggest-attribute=cold +-Wno-suggest-attribute=malloc diff --git a/config/gnu-warnings/no-developer-general b/config/gnu-warnings/no-developer-general new file mode 100644 index 0000000..18831dd --- /dev/null +++ b/config/gnu-warnings/no-developer-general @@ -0,0 +1,8 @@ +-Wno-aggregate-return +-Wno-inline +-Wno-missing-format-attribute +-Wno-missing-noreturn +# NOTE: -pedantic includes -Woverlength-strings which triggers a warning +# regarding the library settings string (H5libhdf5_settings). We'll turn +# it off here but leave it on in the developer flags. +-Wno-overlength-strings diff --git a/config/gnu-warnings/noerror-5 b/config/gnu-warnings/noerror-5 new file mode 100644 index 0000000..a7d40dd --- /dev/null +++ b/config/gnu-warnings/noerror-5 @@ -0,0 +1,12 @@ +-Wincompatible-pointer-types +# +# In GCC 4.4.7, the compiler gripes about shadowed global +# declarations when a local variable uses the name of a +# function that's in a system header file. For some reason, +# later versions of GCC (e.g., 5.2.0) don't complain about +# the shadowed globals. Maybe later versions are less fussy? +# Anyway, the shadowing seems to be harmless, and GCC 4.4.7 +# is not a supported compiler, so let us promote shadowed globals +# warnings to errors only for GCC 5 and later. +# +-Wshadow diff --git a/config/gnu-warnings/noerror-8 b/config/gnu-warnings/noerror-8 new file mode 100644 index 0000000..2f54a4d --- /dev/null +++ b/config/gnu-warnings/noerror-8 @@ -0,0 +1,25 @@ +# NOTE: src/ files are not compatible with these warnings as errors +# src/H5Dchunk.c +# -Werror=cast-function-type +-Wcast-function-type +# +# For GCC 8, promote maybe-initialized warnings to an error. GCC 8 +# reports 0 maybe-uninitialized warnings where earlier versions +# make many false reports. GCC 8 seems to analyze calls to static +# in order to detect initializations that occur there. It's possible +# that GCC 8 only performs that analysis at -O3, though. +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDlog.c, +# -Werror=maybe-uninitialized +-Wmaybe-uninitialized +# NOTE: src/ files are not compatible with these warnings as errors +# src/H5Shyper.c,src/H5SL.c,src/H5Shyper.c +# -Werror=maybe-uninitialized +# NOTE: Test files are not compatible with these warnings as errors +# test/cache_common.c, +# -Werror=maybe-uninitialized +# NOTE: hl/src/ files are not compatible with these warnings as errors +# hl/src/H5DS.c, +# -Werror=maybe-uninitialized diff --git a/config/gnu-warnings/noerror-general b/config/gnu-warnings/noerror-general new file mode 100644 index 0000000..f49d89a --- /dev/null +++ b/config/gnu-warnings/noerror-general @@ -0,0 +1,92 @@ +# +# These warnings will be treated as errors, using the error-general file, +# when HDF5_ENABLE_WARNINGS_AS_ERRORS is set to true for CMake or +# the --enable-warnings-as-errors option is specified for configure. +# Otherwise this file will be used to treat them as warnings. +# +-Wbad-function-cast +-Wimplicit-function-declaration +-Wmissing-declarations +-Wmissing-prototypes +-Wnested-externs +-Wold-style-definition +-Wpacked +-Wpointer-sign +-Wpointer-to-int-cast +-Wredundant-decls +-Wstrict-prototypes +-Wswitch +# +#-Werror=discarded-qualifiers +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDdirect.c,H5FDmpio.c,H5FDros3.c, +# -Werror=unused-function +# +-Wunused-function +# +# H5FDdrvr_module.h +# -Werror=unused-variable +# +-Wunused-variable +# +# H5VLpassthru.c +# -Werror=unused-parameter +# +-Wunused-parameter +# +# +# +# NOTE: Tools files are not compatible with these warnings as errors +# lib/h5tools.c +# -Werror=cast-align +# +-Wcast-align +# +# lib/h5diff_array.c +# -Werror=unused-but-set-variable +# +-Wunused-but-set-variable +# +# lib/h5tools_utils.c +# -Werror=unused-parameter +# +# +# NOTE: JNI files are not compatible with these warnings as errors +# jni/h5pDCPLImp.c,jni/nativeData.c,jni/h5util.c,jni/h5rImp.c +# jni/h5sImp.c,jni/h5tImp.c +# -Werror=cast-align +# jni/h5util.c +# -Werror=format(-overflow) +# +-Wformat +# +# +#Examples and tests do not use the same set of extensive warning flags as libraries +# Here is a list of tests and examples that have issues with the stricter warnings as error +# +# NOTE: Test files are not compatible with these warnings as errors +# thread_id.c, +# -Werror=unused-function +# dsets.c +# -Werror=unused-parameter +# external.c,perform/sio_engine.c +# -Werror=format(-truncation) +# +# +# NOTE: Examples files are not compatible with these warnings as errors +# h5_vds-eiger.c,h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c,h5_vds-percival-unlim-maxmin.c +# h5_vds-percival.c,h5_read.c,h5_rdwt.c,h5_mount.c,h5_extend.c,h5_extend_write.c +# h5_write.c,h5_vds-simpleIO.c,h5_ref2reg_deprec.c,h5_crtgrp.c,h5_select.c +# h5_vds-percival-unlim.c,h5_crtatt.c,h5_group.c,h5_attribute.c,h5_crtdat.c +# h5_reference_deprec.c +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=strict-prototypes +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=old-style-definition +# h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c, +# -Werror=unused-variable +# h5_elink_unix2win.c,h5_extlink.c,h5_attribute.c +# -Werror=unused-parameter + diff --git a/config/ibm-aix b/config/ibm-aix index 805ec34..b4a558d 100644 --- a/config/ibm-aix +++ b/config/ibm-aix @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. diff --git a/config/ibm-flags b/config/ibm-flags index 881b81c..ab4b8ff 100644 --- a/config/ibm-flags +++ b/config/ibm-flags @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. diff --git a/config/intel-cxxflags b/config/intel-cxxflags new file mode 100644 index 0000000..484100f --- /dev/null +++ b/config/intel-cxxflags @@ -0,0 +1,184 @@ +# -*- 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' +# + +# +# Prepend `$srcdir/config/intel-warnings/` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_intel_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/intel-warnings/${arg} + done) + IFS=' ' echo "$*" +} + +# 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 # + ########### + + H5_CXXFLAGS="$H5_CXXFLAGS $arch" + + ############## + # Production # + ############## + + PROD_CXXFLAGS= + + ######### + # Debug # + ######### + + # NDEBUG is handled explicitly in configure + # -g is handled by the symbols flags + DEBUG_CXXFLAGS= + + ########### + # Symbols # + ########### + + NO_SYMBOLS_CXXFLAGS="-Wl,-s" + SYMBOLS_CXXFLAGS="-g" + + ############# + # Profiling # + ############# + + PROFILE_CXXFLAGS="-p" + + ################ + # Optimization # + ################ + + HIGH_OPT_CXXFLAGS="-O3" + DEBUG_OPT_CXXFLAGS="-O0" + NO_OPT_CXXFLAGS="-O0" + + ############ + # Warnings # + ############ + + ########### + # General # + ########### + + # Add various general warning flags in intel-warnings. + # Use the C warnings as CXX warnings are the same + H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments general)" + + ###################### + # Developer warnings # + ###################### + + # Use the C warnings as CXX warnings are the same + #NO_DEVELOPER_WARNING_CXXFLAGS=$(load_intel_arguments no-developer-general) + #DEVELOPER_WARNING_CXXFLAGS=$(load_intel_arguments developer-general) + + ############################# + # Version-specific warnings # + ############################# + + # intel == 8.0 + if test $cxx_vers_major -eq 8 -a $cxx_vers_minor -eq 0; then + # v8.0 -O3 infinite loops when compiling test/tselect.c. Use -O2. + HIGH_OPT_CFLAGS="-O2" + fi + + # intel == 10 + if test $cxx_vers_major -eq 10; then + HIGH_OPT_CFLAGS="-O1" + fi + + # intel >= 15 + if test $cxx_vers_major -ge 15; then + # Use the C warnings as CXX warnings are the same + H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments 15)" + fi + + # intel >= 18 + if test $cxx_vers_major -ge 18; then + # Use the C warnings as CXX warnings are the same + H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments 18)" + fi + + # intel <= 19 + if test $cxx_vers_major -le 19; then + # Use the C warnings as CXX warnings are the same + H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments general-19)" + fi + + ################# + # Flags are set # + ################# + cxx_flags_set=yes +fi + +# Clear cxx info if no flags set +if test "X-$cxx_flags_set" = "X-"; then + cxx_vendor= + cxx_version= +fi diff --git a/config/intel-fflags b/config/intel-fflags index 8b1110e..42c1781 100644 --- a/config/intel-fflags +++ b/config/intel-fflags @@ -1,4 +1,4 @@ -# -*- shell-script -*- +# -*- shell-script -*- # # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. @@ -17,6 +17,20 @@ # if the compiler is not Intel; otherwise `f9x_flags_set' is set to `yes' # +# +# Prepend `$srcdir/config/intel-warnings/` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_intel_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/intel-warnings/${arg} + done) + IFS=' ' echo "$*" +} + # Get the compiler version in a way that works for ifort # ifort unless a compiler version is already known # @@ -42,13 +56,17 @@ if test X = "X$f9x_flags_set"; then fi fi -# Common Intel flags for various situations if test "X-ifort" = "X-$f9x_vendor"; then - # Insert section about version specific problems from gnu-flags here, if - # necessary. + + FC_BASENAME=ifort + F9XSUFFIXFLAG="" + FSEARCH_DIRS="" + + ############################### + # Architecture-specific flags # + ############################### arch= - # Architecture-specific flags # Nothing currently. (Uncomment code below and modify to add any) #case "$host_os-$host_cpu" in # *-i686) @@ -64,32 +82,58 @@ if test "X-ifort" = "X-$f9x_vendor"; then # ;; #esac - # General - FC_BASENAME=ifort - F9XSUFFIXFLAG="" - FSEARCH_DIRS="" - H5_FCFLAGS="$H5_FCFLAGS" + ############## + # Production # + ############## - # Production PROD_FCFLAGS= - # Debug + ######### + # Debug # + ######### + DEBUG_FCFLAGS="-check all" - # Symbols - SYMBOLS_FCFLAGS="-g" + ########### + # Symbols # + ########### + NO_SYMBOLS_FCFLAGS= + SYMBOLS_FCFLAGS="-g" + + ############# + # Profiling # + ############# - # Profiling - # Use this for profiling with gprof PROFILE_FCFLAGS="-p" - # Optimization + ################ + # Optimization # + ################ + HIGH_OPT_FCFLAGS="-O3" DEBUG_OPT_FCFLAGS= NO_OPT_FCFLAGS= - # Flags are set + ############ + # Warnings # + ############ + + ########### + # General # + ########### + + H5_FCFLAGS="$H5_FCFLAGS -stand:f03 -free" + H5_FCFLAGS="$H5_FCFLAGS $(load_intel_arguments ifort-general)" + + ############################# + # Version-specific warnings # + ############################# + + + ################# + # Flags are set # + ################# f9x_flags_set=yes fi @@ -99,4 +143,3 @@ if test "X-$f9x_flags_set" = "X-"; then f9x_version= fi - diff --git a/config/intel-flags b/config/intel-flags index 6b4e406..f46da0a 100644 --- a/config/intel-flags +++ b/config/intel-flags @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. @@ -18,7 +18,7 @@ # # -# Prepend `$srcdir/config/intel-` to the filename suffix(es) given as +# Prepend `$srcdir/config/intel-warnings/` to the filename suffix(es) given as # subroutine argument(s), remove comments starting with # and ending # at EOL, replace spans of whitespace (including newlines) with spaces, # and re-emit the file(s) thus filtered on the standard output stream. @@ -26,7 +26,7 @@ load_intel_arguments() { set -- $(for arg; do - sed 's,#.*$,,' $srcdir/config/intel-${arg} + sed 's,#.*$,,' $srcdir/config/intel-warnings/${arg} done) IFS=' ' echo "$*" } @@ -78,55 +78,101 @@ if test "X-icc" = "X-$cc_vendor"; then # ;; #esac - # General + ########### + # General # + ########### + # Default to C99 standard. H5_CFLAGS="$H5_CFLAGS $arch -std=c99" - H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments warnings-general)" - # Production + ############## + # Production # + ############## + PROD_CFLAGS= - # Debug + ######### + # Debug # + ######### + # NDEBUG is handled explicitly in configure DEBUG_CFLAGS= - # Symbols - SYMBOLS_CFLAGS="-g" + ########### + # Symbols # + ########### + NO_SYMBOLS_CFLAGS="-Wl,-s" + SYMBOLS_CFLAGS="-g" + + ############# + # Profiling # + ############# - # Profiling - # Use this for profiling with gprof PROFILE_CFLAGS="-p" - # Optimization + ################ + # Optimization # + ################ + HIGH_OPT_CFLAGS="-O3" DEBUG_OPT_CFLAGS="-O0" NO_OPT_CFLAGS="-O0" - # Flags are set - cc_flags_set=yes + ############ + # Warnings # + ############ -fi + ########### + # General # + ########### -# Version specific ICC flags -# -# Please follow the pattern below by adding new versions at the top, copying -# the information from the previous version and adding modifications to that. -# The default at the bottom will apply if no earlier version matches. -case "$cc_vendor-$cc_version" in - icc-1[5-6]*) - H5_CFLAGS="$H5_CFLAGS -Wcomment -Wdeprecated -Wextra-tokens -Wformat -Wformat-security -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith -Wreturn-type -Wshadow -Wstrict-prototypes -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-variable -Wwrite-strings" - ;; - icc-10*) - HIGH_OPT_CFLAGS="-O1" - ;; - icc-8.0*) + # Add various general warning flags in intel-warnings. + H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments general)" + + ###################### + # Developer warnings # + ###################### + + #NO_DEVELOPER_WARNING_CFLAGS=$(load_intel_arguments no-developer-general) + #DEVELOPER_WARNING_CFLAGS=$(load_intel_arguments developer-general) + + ############################# + # Version-specific warnings # + ############################# + + # intel == 8.0 + if test $cc_vers_major -eq 8 -a $cc_vers_minor -eq 0; then # v8.0 -O3 infinite loops when compiling test/tselect.c. Use -O2. HIGH_OPT_CFLAGS="-O2" - ;; - icc-*) - ;; -esac + fi + + # intel == 10 + if test $cc_vers_major -eq 10; then + HIGH_OPT_CFLAGS="-O1" + fi + + # intel >= 15 + if test $cc_vers_major -ge 15; then + H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments 15)" + fi + + # intel >= 18 + if test $cc_vers_major -ge 18; then + H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments 18)" + fi + + # intel <= 19 + # this file has warnings only available before oneapi versions + if test $cc_vers_major -le 19; then + H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments general-19)" + fi + + ################# + # Flags are set # + ################# + cc_flags_set=yes +fi # Clear cc info if no flags set if test "X-$cc_flags_set" = "X-"; then diff --git a/config/intel-warnings/15 b/config/intel-warnings/15 new file mode 100644 index 0000000..6746f97 --- /dev/null +++ b/config/intel-warnings/15 @@ -0,0 +1,19 @@ +-Wcomment +-Wdeprecated +-Wextra-tokens +-Wformat +-Wformat-security +-Wmain +-Wmissing-declarations +-Wmissing-prototypes +-Wp64 +-Wpointer-arith +-Wreturn-type +-Wshadow +-Wstrict-prototypes +-Wtrigraphs +-Wuninitialized +-Wunknown-pragmas +-Wunused-function +-Wunused-variable +-Wwrite-strings diff --git a/config/intel-warnings/18 b/config/intel-warnings/18 new file mode 100644 index 0000000..565b47a --- /dev/null +++ b/config/intel-warnings/18 @@ -0,0 +1,8 @@ +-Wextra-tokens +-Wformat +-Wformat-security +-Wic-pointer +-Wshadow +-Wsign-compare +-Wtrigraphs +-Wwrite-strings diff --git a/config/intel-warnings/developer-general b/config/intel-warnings/developer-general new file mode 100644 index 0000000..fae56f0 --- /dev/null +++ b/config/intel-warnings/developer-general @@ -0,0 +1,4 @@ +-Winline +-Wreorder +-Wport +-Wstrict-aliasing diff --git a/config/intel-warnings/general b/config/intel-warnings/general new file mode 100644 index 0000000..bd866b6 --- /dev/null +++ b/config/intel-warnings/general @@ -0,0 +1 @@ +-Wall diff --git a/config/intel-warnings/general-19 b/config/intel-warnings/general-19 new file mode 100644 index 0000000..e35af30 --- /dev/null +++ b/config/intel-warnings/general-19 @@ -0,0 +1,2 @@ +# this is only available before oneapi versions +-Wcheck diff --git a/config/intel-warnings/ifort-general b/config/intel-warnings/ifort-general new file mode 100644 index 0000000..a9da0e5 --- /dev/null +++ b/config/intel-warnings/ifort-general @@ -0,0 +1 @@ +-warn:all diff --git a/config/cmake/libhdf5.pc.in b/config/libhdf5.pc.in index 4a2ebaa..4a2ebaa 100644 --- a/config/cmake/libhdf5.pc.in +++ b/config/libhdf5.pc.in diff --git a/config/linux-gnu b/config/linux-gnu index 243b087..117fada 100644 --- a/config/linux-gnu +++ b/config/linux-gnu @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. diff --git a/config/linux-gnuaout b/config/linux-gnuaout index 243b087..117fada 100644 --- a/config/linux-gnuaout +++ b/config/linux-gnuaout @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. diff --git a/config/linux-gnueabihf b/config/linux-gnueabihf new file mode 100644 index 0000000..596bf3a --- /dev/null +++ b/config/linux-gnueabihf @@ -0,0 +1,16 @@ +# -*- 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. + +# ARM for Raspberry Pi, etc. +# This is the same as linux-gnulibc1 + +. $srcdir/config/linux-gnulibc1 diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 39225e7..d952c4e 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. @@ -42,6 +42,9 @@ fi # Figure out Intel C compiler flags . $srcdir/config/intel-flags +# Figure out Clang C compiler flags +. $srcdir/config/clang-flags + # Use default Fortran 90 compiler according to what C compiler is used. if test "X-" = "X-$FC"; then case $CC_BASENAME in @@ -61,6 +64,11 @@ if test "X-" = "X-$FC"; then FC=mpif90 FC_BASENAME=mpif90 ;; + clang*) + # clang has no fortran compiler. Use gfortran. + FC=gfortran + FC_BASENAME=gfortran + ;; esac else case $FC in @@ -191,9 +199,19 @@ 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 +# Figure out PGI CXX compiler flags +. $srcdir/config/pgi-cxxflags + +# Figure out Clang CXX compiler flags +. $srcdir/config/clang-cxxflags + # compiler version strings # check if the compiler_version_info is already set @@ -223,6 +241,11 @@ case $CC in sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'` ;; + *clang*) + cc_version_info="`$CC $CFLAGS $H5_CFLAGS --version 2>&1 |\ + grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`" + ;; + *) echo "No match to get cc_version_info for $CC" ;; @@ -298,6 +321,9 @@ fi # check if the compiler_version_info is already set if test -z "$cxx_version_info"; then case $CXX in + *pgc++*) + cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'pgc++'` + ;; *g++*) cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ grep 'GCC' | sed 's/\(.*(GCC) [-a-z0-9\. ]*\).*/\1/'` @@ -306,10 +332,6 @@ case $CXX in cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'Version' |\ sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'` ;; - *pgCC*) - cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'pgCC'` - ;; - *mpicxx*) cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 | grep 'version' |\ sed 's/^[a-z0-9]* for //' |\ @@ -317,6 +339,11 @@ case $CXX in cxx_version_info=`echo $cxx_version_info` ;; + *clang++*) + cxx_version_info="`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ + grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`" + ;; + *) echo "No match to get cxx_version_info for $CXX" ;; diff --git a/config/linux-gnulibc2 b/config/linux-gnulibc2 index 01a0d20..c7447a1 100644 --- a/config/linux-gnulibc2 +++ b/config/linux-gnulibc2 @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. diff --git a/config/lt_vers.am b/config/lt_vers.am index 3cca531..9f13fef 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -8,7 +8,7 @@ ## 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://support.hdfgroup.org/ftp/HDF5/releases. +## 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. ## @@ -16,8 +16,8 @@ # See libtool versioning documentation online. # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. -LT_VERS_INTERFACE = 200 -LT_VERS_AGE = 0 +LT_VERS_INTERFACE = 201 +LT_VERS_AGE = 1 LT_VERS_REVISION = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and @@ -39,31 +39,31 @@ LT_VERS_REVISION = 0 ## the effects of the H5_V1_x_COMPAT flag. ## ## Version numbers for wrapper shared library files. -LT_CXX_VERS_INTERFACE = 200 +LT_CXX_VERS_INTERFACE = 201 LT_CXX_VERS_REVISION = 0 -LT_CXX_VERS_AGE = 0 +LT_CXX_VERS_AGE = 1 -LT_F_VERS_INTERFACE = 200 +LT_F_VERS_INTERFACE = 201 LT_F_VERS_REVISION = 0 -LT_F_VERS_AGE = 0 +LT_F_VERS_AGE = 1 LT_HL_VERS_INTERFACE = 200 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 0 LT_HL_CXX_VERS_INTERFACE = 200 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 0 LT_HL_F_VERS_INTERFACE = 200 -LT_HL_F_VERS_REVISION = 0 +LT_HL_F_VERS_REVISION = 1 LT_HL_F_VERS_AGE = 0 -LT_JAVA_VERS_INTERFACE = 200 +LT_JAVA_VERS_INTERFACE = 201 LT_JAVA_VERS_REVISION = 0 -LT_JAVA_VERS_AGE = 0 +LT_JAVA_VERS_AGE = 1 -LT_TOOLS_VERS_INTERFACE = 200 +LT_TOOLS_VERS_INTERFACE = 201 LT_TOOLS_VERS_REVISION = 0 -LT_TOOLS_VERS_AGE = 0 +LT_TOOLS_VERS_AGE = 1 diff --git a/config/netbsd b/config/netbsd index 9a9348b..dae3734 100644 --- a/config/netbsd +++ b/config/netbsd @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. diff --git a/config/pgi-cxxflags b/config/pgi-cxxflags new file mode 100644 index 0000000..5fc74ae --- /dev/null +++ b/config/pgi-cxxflags @@ -0,0 +1,100 @@ +# -*- 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 +# PGI pgc++ compiler or a derivative. It is careful not to do anything +# if the compiler is not PGI; otherwise `cxx_flags_set' is set to `yes' +# + +# Get the compiler version in a way that works for pgc++ +# pgc++ unless a compiler version is already known +# +# cxx_vendor: The compiler name: pgc++ +# cxx_version: Version number: 5.0-2, 5.2-2 +# +if test X = "X$cxx_flags_set"; then + cxx_version="`$CXX $CXXFLAGS -V 2>&1 |grep '^pgc++ '`" + if test X != "X$cxx_version"; then + cxx_vendor=`echo $cxx_version |sed 's/\([a-z]*++\).*/\1/'` + cxx_version=`echo $cxx_version |sed 's/pgc++ \([-a-z0-9\.\-]*\).*/\1/'` + echo "compiler '$CXX' is PGI $cxx_vendor-$cxx_version" + + # Some version numbers + # PGI version numbers are of the form: "major.minor-patch" + cxx_vers_major=`echo $cxx_version | cut -f1 -d.` + cxx_vers_minor=`echo $cxx_version | cut -f2 -d. | cut -f1 -d-` + cxx_vers_patch=`echo $cxx_version | cut -f2 -d. | 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 PGI flags for various situations +if test "X-pgc++" = "X-$cxx_vendor"; then + + ########### + # General # + ########### + + H5_CXXFLAGS="$H5_CXXFLAGS -Minform=warn" + + ############## + # Production # + ############## + + PROD_CXXFLAGS= + + ######### + # Debug # + ######### + + # NDEBUG is handled explicitly in configure + # -g is handled by the symbols flags + DEBUG_CXXFLAGS="-Mbounds" + + ########### + # Symbols # + ########### + + NO_SYMBOLS_CXXFLAGS="-s" + SYMBOLS_CXXFLAGS="-g" + + ############# + # Profiling # + ############# + + PROFILE_CXXFLAGS="-Mprof=func,line" + # Use this for profiling with gprof + #PROFILE_CXXFLAGS="-pg" + + ################ + # Optimization # + ################ + + HIGH_OPT_CXXFLAGS="-O4" + DEBUG_OPT_CXXFLAGS="-gopt -O2" + NO_OPT_CXXFLAGS="-O0" + + ################# + # Flags are set # + ################# + cxx_flags_set=yes +fi + +# Clear cxx info if no flags set +if test "X-$cxx_flags_set" = "X-"; then + cxx_vendor= + cxx_version= +fi diff --git a/config/pgi-fflags b/config/pgi-fflags index 46f861d..6401d8d 100644 --- a/config/pgi-fflags +++ b/config/pgi-fflags @@ -1,4 +1,4 @@ -# -*- shell-script -*- +# -*- shell-script -*- # # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. @@ -45,11 +45,12 @@ fi # Common PGI flags for various situations if test "X-pgf90" = "X-$f9x_vendor"; then - # Insert section about version specific problems from gnu-flags here, if - # necessary. + + ############################### + # Architecture-specific flags # + ############################### arch= - # Architecture-specific flags # Nothing currently. (Uncomment code below and modify to add any) #case "$host_os-$host_cpu" in # *-i686) @@ -65,15 +66,10 @@ if test "X-pgf90" = "X-$f9x_vendor"; then # ;; #esac - # General - FC_BASENAME=pgf90 - Fortran_COMPILER_ID=PGI - F9XSUFFIXFLAG="" - FSEARCH_DIRS="" - # Uncomment the following to add something specific for FCFLAGS. - #FCFLAGS="$FCFLAGS" + ############## + # Production # + ############## - # Production # Check for MPI wrapper being used and tweak down compiler options # Comment out the Tweaking since it caused problems to mpich1.2.6. # Need to investigate the reasons to tweak. @@ -84,24 +80,55 @@ if test "X-pgf90" = "X-$f9x_vendor"; then #fi PROD_FCFLAGS="-fast -Mnoframe" - # Debug + ######### + # Debug # + ######### + DEBUG_FCFLAGS="-Mbounds -Mchkptr -Mdclchk" - # Symbols - SYMBOLS_FCFLAGS="-g" + ########### + # Symbols # + ########### + NO_SYMBOLS_FCFLAGS="-s" + SYMBOLS_FCFLAGS="-g" + + ############# + # Profiling # + ############# - # Profiling PROFILE_FCFLAGS="-Mprof=func,line" # Use this for profiling with gprof #PROFILE_FCFLAGS="-pg" - # Optimization + ################ + # Optimization # + ################ + HIGH_OPT_FCFLAGS= DEBUG_OPT_FCFLAGS= NO_OPT_FCFLAGS= - # Flags are set + ############ + # Warnings # + ############ + + ########### + # General # + ########### + + FC_BASENAME=pgf90 + Fortran_COMPILER_ID=PGI + F9XSUFFIXFLAG="" + FSEARCH_DIRS="" + # Uncomment the following to add something specific for FCFLAGS. + #FCFLAGS="$FCFLAGS" + + + + ################# + # Flags are set # + ################# f9x_flags_set=yes fi @@ -111,4 +138,3 @@ if test "X-$f9x_flags_set" = "X-"; then f9x_version= fi - diff --git a/config/pgi-flags b/config/pgi-flags index 52828c1..b197a1c 100644 --- a/config/pgi-flags +++ b/config/pgi-flags @@ -1,4 +1,4 @@ -# -*- shell-script -*- +# -*- shell-script -*- # # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. @@ -45,8 +45,8 @@ fi # Common PGI flags for various situations if test "X-pgcc" = "X-$cc_vendor"; then - # Insert section about version specific problems from gnu-flags here, if - # necessary. + # Insert section about version specific problems from compiler flags here, + # if necessary. arch= # Architecture-specific flags @@ -65,58 +65,59 @@ if test "X-pgcc" = "X-$cc_vendor"; then # ;; #esac - # General - H5_CFLAGS="$H5_CFLAGS $arch -c99 -Minform=inform" - - # Production - case "$cc_vendor-$cc_version" in - pgcc-10.6*) - PROD_CFLAGS= - ;; - pgcc-9.*) - PROD_CFLAGS= - ;; - *) - PROD_CFLAGS="-fast" - ;; - esac - - # Debug + ########### + # General # + ########### + + # Default to C99 standard. + H5_CFLAGS="$H5_CFLAGS $arch -c99 -Minform=warn" + + ############## + # Production # + ############## + + # NDEBUG is handled explicitly by the configure script + PROD_CFLAGS="-fast" + + ######### + # Debug # + ######### + # NDEBUG is handled explicitly by the configure script + # -g is handled by the symbols flags DEBUG_CFLAGS="-Mbounds" - # Symbols - SYMBOLS_CFLAGS="-g" + ########### + # Symbols # + ########### + NO_SYMBOLS_CFLAGS="-s" + SYMBOLS_CFLAGS="-g" + + ############# + # Profiling # + ############# - # Profiling PROFILE_CFLAGS="-Mprof=func,line" # Use this for profiling with gprof #PROFILE_CFLAGS="-pg" - # Optimization - case "$cc_vendor-$cc_version" in - # Tweak down compiler optimizations for v10.6, it has a bug - pgcc-10.6*) - HIGH_OPT_CFLAGS="-O1" - ;; - # Tweak down compiler optimizations for v9.x - pgcc-9.*) - HIGH_OPT_CFLAGS="-O1" - ;; - *) - HIGH_OPT_CFLAGS= - ;; - esac - DEBUG_OPT_CFLAGS= - NO_OPT_CFLAGS= - - # Flags are set + ################ + # Optimization # + ################ + + HIGH_OPT_CFLAGS="-O4" + DEBUG_OPT_CFLAGS="-gopt -O2" + NO_OPT_CFLAGS="-O0" + + ################# + # Flags are set # + ################# cc_flags_set=yes fi # Clear cc info if no flags set if test "X-$cc_flags_set" = "X-"; then - cc_vendor= - cc_version= + cc_vendor= + cc_version= fi diff --git a/config/sanitizer/formatting.cmake b/config/sanitizer/formatting.cmake new file mode 100644 index 0000000..5aaa2a6 --- /dev/null +++ b/config/sanitizer/formatting.cmake @@ -0,0 +1,92 @@ +# +# Copyright (C) 2019 by George Cave - gcave@stablecoder.ca +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# +# clang-format +# +find_program(CLANG_FORMAT_EXE "clang-format") +mark_as_advanced(FORCE CLANG_FORMAT_EXE) +if(CLANG_FORMAT_EXE) + message(STATUS "clang-format found: ${CLANG_FORMAT_EXE}") +else() + message(STATUS "clang-format not found!") +endif() + +# Generates a 'format' target using a custom name, files, and include +# directories all being parameters. +# +# Do note that in order for sources to be inherited properly, the source paths +# must be reachable from where the macro is called, or otherwise require a full +# path for proper inheritance. +# +# ~~~ +# Required: +# TARGET_NAME - The name of the target to create. +# +# Optional: ARGN - The list of targets OR files to format. Relative and absolute +# paths are accepted. +# ~~~ +function(clang_format TARGET_NAME) + if(CLANG_FORMAT_EXE) + set(FORMAT_FILES) + # Check through the ARGN's, determine existent files + foreach(item IN LISTS ARGN) + if(TARGET ${item}) + # If the item is a target, then we'll attempt to grab the associated + # source files from it. + get_target_property(_TARGET_TYPE ${item} TYPE) + if(NOT + _TARGET_TYPE + STREQUAL + "INTERFACE_LIBRARY") + get_property( + _TEMP + TARGET ${item} + PROPERTY SOURCES) + foreach(iter IN LISTS _TEMP) + if(EXISTS ${iter}) + set(FORMAT_FILES ${FORMAT_FILES} ${iter}) + endif() + endforeach() + endif() + elseif(EXISTS ${item}) + # Check if it's a full file path + set(FORMAT_FILES ${FORMAT_FILES} ${item}) + elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${item}) + # Check if it's based on the current source dir + set(FORMAT_FILES ${FORMAT_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/${item}) + endif() + endforeach() + + # Make the target + if(FORMAT_FILES) + if(TARGET ${TARGET_NAME}) + message( + ERROR + "Cannot create clang-format target '${TARGET_NAME}', already exists.") + else() + add_custom_target(${TARGET_NAME} COMMAND ${CLANG_FORMAT_EXE} -i -style=file ${FORMAT_FILES}) + + if(NOT TARGET format) + add_custom_target(format) + endif() + + add_dependencies(format ${TARGET_NAME}) + endif() + endif() + + endif() +endfunction() + diff --git a/config/sanitizer/sanitizers.cmake b/config/sanitizer/sanitizers.cmake index ecee2de..0803279 100644 --- a/config/sanitizer/sanitizers.cmake +++ b/config/sanitizer/sanitizers.cmake @@ -29,69 +29,66 @@ function(append value) endfunction() message(STATUS "USE_SANITIZER=${USE_SANITIZER}, CMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}") -if(USE_SANITIZER AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang") - set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +if(USE_SANITIZER) + if(INTEL_CLANG OR "${CMAKE_C_COMPILER_ID}" MATCHES "Clang") + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - append("-fno-omit-frame-pointer" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - message(STATUS "Building with sanitize, base flags=${CMAKE_C_SANITIZER_FLAGS}") + append("-fno-omit-frame-pointer" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + message(STATUS "Building with sanitize, base flags=${CMAKE_C_SANITIZER_FLAGS}") - if(UNIX) - - if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") - append("-O1" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - endif() + if(UNIX) + if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") + append("-O1" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + endif() - if(USE_SANITIZER MATCHES "([Aa]ddress);([Uu]ndefined)" - OR USE_SANITIZER MATCHES "([Uu]ndefined);([Aa]ddress)") - message(STATUS "Building with Address, Undefined sanitizers") - append("-fsanitize=address,undefined" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - set(MEMCHECK_TYPE AddressSanitizer) - elseif(USE_SANITIZER MATCHES "([Aa]ddress)") - # Optional: -fno-optimize-sibling-calls -fsanitize-address-use-after-scope - message(STATUS "Building with Address sanitizer") - append("-fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - set(MEMCHECK_TYPE AddressSanitizer) - elseif(USE_SANITIZER MATCHES "([Mm]emory([Ww]ith[Oo]rigins)?)") - # Optional: -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 - append("-fsanitize=memory" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - if(USE_SANITIZER MATCHES "([Mm]emory[Ww]ith[Oo]rigins)") - message(STATUS "Building with MemoryWithOrigins sanitizer") - append("-fsanitize-memory-track-origins" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + if(USE_SANITIZER MATCHES "([Aa]ddress);([Uu]ndefined)" + OR USE_SANITIZER MATCHES "([Uu]ndefined);([Aa]ddress)") + message(STATUS "Building with Address, Undefined sanitizers") + append("-fsanitize=address,undefined" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + set(MEMCHECK_TYPE AddressSanitizer) + elseif(USE_SANITIZER MATCHES "([Aa]ddress)") + # Optional: -fno-optimize-sibling-calls -fsanitize-address-use-after-scope + message(STATUS "Building with Address sanitizer") + append("-fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + set(MEMCHECK_TYPE AddressSanitizer) + elseif(USE_SANITIZER MATCHES "([Mm]emory([Ww]ith[Oo]rigins)?)") + # Optional: -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 + append("-fsanitize=memory" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + if(USE_SANITIZER MATCHES "([Mm]emory[Ww]ith[Oo]rigins)") + message(STATUS "Building with MemoryWithOrigins sanitizer") + append("-fsanitize-memory-track-origins" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + else() + message(STATUS "Building with Memory sanitizer") + endif() + set(MEMCHECK_TYPE MemorySanitizer) + elseif(USE_SANITIZER MATCHES "([Uu]ndefined)") + message(STATUS "Building with Undefined sanitizer") + append("-fsanitize=undefined" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + if(EXISTS "${BLACKLIST_FILE}") + append("-fsanitize-blacklist=${BLACKLIST_FILE}" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + endif() + set(MEMCHECK_TYPE UndefinedBehaviorSanitizer) + elseif(USE_SANITIZER MATCHES "([Tt]hread)") + message(STATUS "Building with Thread sanitizer") + append("-fsanitize=thread" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + set(MEMCHECK_TYPE ThreadSanitizer) + elseif(USE_SANITIZER MATCHES "([Ll]eak)") + message(STATUS "Building with Leak sanitizer") + append("-fsanitize=leak" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + set(MEMCHECK_TYPE LeakSanitizer) else() - message(STATUS "Building with Memory sanitizer") + message( + FATAL_ERROR "Unsupported value of USE_SANITIZER: ${USE_SANITIZER}") endif() - set(MEMCHECK_TYPE MemorySanitizer) - elseif(USE_SANITIZER MATCHES "([Uu]ndefined)") - message(STATUS "Building with Undefined sanitizer") - append("-fsanitize=undefined" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - if(EXISTS "${BLACKLIST_FILE}") - append("-fsanitize-blacklist=${BLACKLIST_FILE}" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + elseif(MSVC) + if(USE_SANITIZER MATCHES "([Aa]ddress)") + message(STATUS "Building with Address sanitizer") + append("-fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + else() + message(FATAL_ERROR "This sanitizer not yet supported in the MSVC environment: ${USE_SANITIZER}") endif() - set(MEMCHECK_TYPE UndefinedBehaviorSanitizer) - elseif(USE_SANITIZER MATCHES "([Tt]hread)") - message(STATUS "Building with Thread sanitizer") - append("-fsanitize=thread" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - set(MEMCHECK_TYPE ThreadSanitizer) - elseif(USE_SANITIZER MATCHES "([Ll]eak)") - message(STATUS "Building with Leak sanitizer") - append("-fsanitize=leak" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - set(MEMCHECK_TYPE LeakSanitizer) else() - message( - FATAL_ERROR "Unsupported value of USE_SANITIZER: ${USE_SANITIZER}") + message(FATAL_ERROR "USE_SANITIZER is not supported on this platform.") endif() - elseif(MSVC) - if(USE_SANITIZER MATCHES "([Aa]ddress)") - message(STATUS "Building with Address sanitizer") - append("-fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - else() - message( - FATAL_ERROR - "This sanitizer not yet supported in the MSVC environment: ${USE_SANITIZER}" - ) - endif() - else() - message(FATAL_ERROR "USE_SANITIZER is not supported on this platform.") endif() - endif() diff --git a/config/sanitizer/tools.cmake b/config/sanitizer/tools.cmake index a44022f..242e33f 100644 --- a/config/sanitizer/tools.cmake +++ b/config/sanitizer/tools.cmake @@ -1,5 +1,5 @@ # -# Copyright (C) 2018 by George Cave - gcave@stablecoder.ca +# Copyright (C) 2018-2020 by George Cave - gcave@stablecoder.ca # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of @@ -29,7 +29,7 @@ endmacro() # used as the options set. macro(include_what_you_use) if(IWYU AND IWYU_EXE) - set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "${IWYU_EXE};${IWYU_STRING}") + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_EXE} ${ARGN}) endif() endmacro() @@ -37,11 +37,12 @@ endmacro() # options set. macro(cppcheck) if(CPPCHECK AND CPPCHECK_EXE) - set(CMAKE_CXX_CPPCHECK "${CPPCHECK_EXE};${CPPCHECK_STRING}") + set(CMAKE_CXX_CPPCHECK ${CPPCHECK_EXE} ${ARGN}) endif() endmacro() find_program(CLANG_TIDY_EXE NAMES "clang-tidy") +mark_as_advanced(FORCE CLANG_TIDY_EXE) if(CLANG_TIDY_EXE) message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") if(NOT CLANG_TIDY) @@ -63,6 +64,7 @@ else() endif() find_program(IWYU_EXE NAMES "include-what-you-use") +mark_as_advanced(FORCE IWYU_EXE) if(IWYU_EXE) message(STATUS "include-what-you-use found: ${IWYU_EXE}") if(NOT IWYU) @@ -85,6 +87,7 @@ else() endif() find_program(CPPCHECK_EXE NAMES "cppcheck") +mark_as_advanced(FORCE CPPCHECK_EXE) if(CPPCHECK_EXE) message(STATUS "cppcheck found: ${CPPCHECK_EXE}") if(CPPECHECK) diff --git a/config/site-specific/BlankForm b/config/site-specific/BlankForm index 03d421c..04d5d0e 100644 --- a/config/site-specific/BlankForm +++ b/config/site-specific/BlankForm @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. diff --git a/config/solaris b/config/solaris index 656fee1..b7c7963 100644 --- a/config/solaris +++ b/config/solaris @@ -7,7 +7,7 @@ # 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://support.hdfgroup.org/ftp/HDF5/releases. +# 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. @@ -29,7 +29,9 @@ fi # Try solaris native compiler flags if test "X-" = "X-$cc_flags_set"; then - H5_CFLAGS="$H5_CFLAGS -erroff=%none -DBSD_COMP" + # HDF5 must be built with a C99 compiler on Solaris + # -erroff=%none turns on all warnings + H5_CFLAGS="$H5_CFLAGS -xc99=all -erroff=%none" # Production # NDEBUG is handled explicitly by the configure script @@ -41,17 +43,26 @@ if test "X-" = "X-$cc_flags_set"; then DEBUG_CFLAGS= # Symbols + # -g produces output for dbx, NOT gdb. You can use "gdb on" from + # inside gdb to use gdb commands if you need to debug. + # If you want a LOT of debugging information (at the expense of + # really slow code), try using -g3. That will even let you debug + # into macros. + # -s strips symbols, as in gcc NO_SYMBOLS_CFLAGS="-s" SYMBOLS_CFLAGS="-g" # Profile + # This produces profiling output for gprof. If you want to use + # the Solaris profiler, use -xprofile instead. PROFILE_CFLAGS="-xpg" # Optimization - # -g produces rather slow code. "-g -O" produces much faster code with some - # loss of debugger functions such as not able to print local variables. - HIGH_OPT_CFLAGS="-O" - DEBUG_OPT_CFLAGS="-O" + # -O has switched to -xO{1|2|3|4|5}. -xO3 is probably a good compromise + # for the daily tests, but you might want to switch to -xO2 or lower + # if you are actively debugging. + HIGH_OPT_CFLAGS="-xO5" + DEBUG_OPT_CFLAGS="-xO3" NO_OPT_CFLAGS= cc_flags_set=yes diff --git a/config/toolchain/build32.cmake b/config/toolchain/build32.cmake index deb5899..a2566c3 100644 --- a/config/toolchain/build32.cmake +++ b/config/toolchain/build32.cmake @@ -5,10 +5,11 @@ elseif(APPLE) set (CMAKE_OSX_ARCHITECTURES "i386") elseif(MINGW) set (CMAKE_SYSTEM_NAME Windows) - set (CMAKE_C_COMPILER i686-w64-mingw32-gcc) - set (CMAKE_CXX_COMPILER i686-w64-mingw32-g++) - set (CMAKE_RC_COMPILER i686-w64-mingw32-windres) - set (CMAKE_Fortran_COMPILER i686-w64-mingw32-gfortran) + set (TOOLCHAIN_PREFIX i686-w64-mingw32) + set (CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) + set (CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) + set (CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) + set (CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags") @@ -34,11 +35,14 @@ elseif(MINGW) set (ENV{PKG_CONFIG_LIBDIR} ${LIB32}/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig) endif () - set (CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32) + set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX}) set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - set (CMAKE_CROSSCOMPILING_EMULATOR wine32) + set (CMAKE_CROSSCOMPILING_EMULATOR wine) + + include_directories(/usr/${TOOLCHAIN_PREFIX}/include) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On CACHE BOOL "Export windows symbols") else () set (CMAKE_SYSTEM_NAME Linux) @@ -72,4 +76,4 @@ else () # for libraries and headers in the target directories set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif ()
\ No newline at end of file +endif () diff --git a/config/toolchain/intel.cmake b/config/toolchain/intel.cmake index 97f6a64..ae1d2f8 100644 --- a/config/toolchain/intel.cmake +++ b/config/toolchain/intel.cmake @@ -3,9 +3,16 @@ set(CMAKE_COMPILER_VENDOR "intel") -set(CMAKE_C_COMPILER icc) -set(CMAKE_CXX_COMPILER icpc) -set(CMAKE_Fortran_COMPILER ifort) +if(USE_SANITIZER) + set(CMAKE_C_COMPILER icl) + set(CMAKE_CXX_COMPILER icl++) + set(CMAKE_Fortran_COMPILER ifort) + set(INTEL_CLANG ON) +else () + set(CMAKE_C_COMPILER icc) + set(CMAKE_CXX_COMPILER icpc) + set(CMAKE_Fortran_COMPILER ifort) +endif () # the following is used if cross-compiling set(CMAKE_CROSSCOMPILING_EMULATOR "") diff --git a/config/toolchain/mingw64.cmake b/config/toolchain/mingw64.cmake index fde5e38..1830488 100644 --- a/config/toolchain/mingw64.cmake +++ b/config/toolchain/mingw64.cmake @@ -4,11 +4,11 @@ set (CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) set (CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) set (CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) set (CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran) -set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX} /usr/local/${TOOLCHAIN_PREFIX}) +set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX}) set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set (CMAKE_CROSSCOMPILING_EMULATOR wine64) -include_directories(/usr/local/${TOOLCHAIN_PREFIX}/include) +include_directories(/usr/${TOOLCHAIN_PREFIX}/include) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On CACHE BOOL "Export windows symbols") |