summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/BlankForm6
-rw-r--r--config/COPYING13
-rw-r--r--config/Makefile.am.blank2
-rw-r--r--config/apple68
-rw-r--r--config/cce-fflags2
-rw-r--r--config/cce-flags2
-rw-r--r--config/clang-cxxflags188
-rw-r--r--config/clang-flags210
-rw-r--r--config/clang-warnings/developer-general3
-rw-r--r--config/clang-warnings/error-general80
-rw-r--r--config/clang-warnings/general20
-rw-r--r--config/clang-warnings/no-developer-general1
-rw-r--r--config/cmake/CTestCustom.cmake51
-rw-r--r--config/cmake/CTestScript.cmake10
-rw-r--r--config/cmake/ConfigureChecks.cmake194
-rw-r--r--config/cmake/ConversionTests.c2
-rw-r--r--config/cmake/FindCIRCLE.cmake49
-rw-r--r--config/cmake/FindDTCMP.cmake48
-rw-r--r--config/cmake/FindMFU.cmake100
-rw-r--r--config/cmake/H5cxx_config.h.in16
-rw-r--r--config/cmake/H5pubconf.h.in203
-rw-r--r--config/cmake/HDF5Macros.cmake43
-rw-r--r--config/cmake/HDF5PluginCache.cmake29
-rw-r--r--config/cmake/HDF5PluginMacros.cmake108
-rw-r--r--config/cmake/HDF5UseFortran.cmake296
-rw-r--r--config/cmake/HDF5_Examples.cmake.in14
-rw-r--r--config/cmake/HDF5_Examples_options.cmake13
-rw-r--r--config/cmake/HDF5_Process_Flex_Files.cmake95
-rw-r--r--config/cmake/HDFCXXCompilerFlags.cmake330
-rw-r--r--config/cmake/HDFCompilerFlags.cmake453
-rw-r--r--config/cmake/HDFFortranCompilerFlags.cmake125
-rw-r--r--config/cmake/PkgInfo.in2
-rw-r--r--config/cmake/README.md.cmake.in (renamed from config/cmake/README.txt.cmake.in)21
-rw-r--r--config/cmake/UseJava.cmake806
-rw-r--r--config/cmake/UseJavaClassFilelist.cmake15
-rw-r--r--config/cmake/UseJavaSymlinks.cmake11
-rw-r--r--config/cmake/UserMacros/Windows_MT.cmake2
-rw-r--r--config/cmake/cacheinit.cmake143
-rw-r--r--config/cmake/fileCompareTest.cmake113
-rw-r--r--config/cmake/hdf5-config-version.cmake.in4
-rw-r--r--config/cmake/hdf5-config.cmake.in15
-rw-r--r--config/cmake/javaTargets.cmake.in39
-rw-r--r--config/cmake/jrunTest.cmake250
-rw-r--r--config/cmake/libh5cc.in25
-rw-r--r--config/cmake/libhdf5.settings.cmake.in54
-rw-r--r--config/cmake/mccacheinit.cmake10
-rw-r--r--config/cmake/scripts/CTestScript.cmake41
-rw-r--r--config/cmake/scripts/HDF5config.cmake62
-rw-r--r--config/cmake/scripts/HDF5options.cmake6
-rw-r--r--config/cmake/scripts/HPC/bsub-HDF5options.cmake2
-rw-r--r--config/cmake/scripts/HPC/qsub-HDF5options.cmake2
-rw-r--r--config/cmake/scripts/HPC/raybsub-HDF5options.cmake2
-rw-r--r--config/cmake/scripts/HPC/sbatch-HDF5options.cmake2
-rw-r--r--config/cmake/userblockTest.cmake14
-rw-r--r--config/cmake/vfdTest.cmake4
-rw-r--r--config/cmake/volTest.cmake4
-rw-r--r--config/cmake/wait_H5Tinit.cmake2
-rw-r--r--config/cmake_ext_mod/CTestCustom.cmake19
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake294
-rw-r--r--config/cmake_ext_mod/FindSZIP.cmake8
-rw-r--r--config/cmake_ext_mod/GetTimeOfDayTest.cpp2
-rw-r--r--config/cmake_ext_mod/HDFCXXTests.cpp102
-rw-r--r--config/cmake_ext_mod/HDFLibMacros.cmake105
-rw-r--r--config/cmake_ext_mod/HDFMacros.cmake123
-rw-r--r--config/cmake_ext_mod/HDFTests.c177
-rw-r--r--config/cmake_ext_mod/HDFUseCXX.cmake109
-rw-r--r--config/cmake_ext_mod/HDFUseFortran.cmake193
-rw-r--r--config/cmake_ext_mod/NSIS.template.in4
-rw-r--r--config/cmake_ext_mod/grepTest.cmake137
-rw-r--r--config/cmake_ext_mod/runTest.cmake252
-rw-r--r--config/commence.am30
-rw-r--r--config/conclude.am38
-rw-r--r--config/conclude_fc.am2
-rw-r--r--config/cygwin2
-rw-r--r--config/examples.am8
-rw-r--r--config/freebsd30
-rw-r--r--config/gnu-cxxflags886
-rw-r--r--config/gnu-fflags68
-rw-r--r--config/gnu-flags203
-rw-r--r--config/gnu-warnings/4.829
-rw-r--r--config/gnu-warnings/4.8-4.last3
-rw-r--r--config/gnu-warnings/4.91
-rw-r--r--config/gnu-warnings/52
-rw-r--r--config/gnu-warnings/69
-rw-r--r--config/gnu-warnings/76
-rw-r--r--config/gnu-warnings/83
-rw-r--r--config/gnu-warnings/92
-rw-r--r--config/gnu-warnings/9.31
-rw-r--r--config/gnu-warnings/cxx-4.826
-rw-r--r--config/gnu-warnings/cxx-4.92
-rw-r--r--config/gnu-warnings/cxx-51
-rw-r--r--config/gnu-warnings/cxx-94
-rw-r--r--config/gnu-warnings/cxx-developer-4.816
-rw-r--r--config/gnu-warnings/cxx-error-511
-rw-r--r--config/gnu-warnings/cxx-error-general32
-rw-r--r--config/gnu-warnings/cxx-general30
-rw-r--r--config/gnu-warnings/developer-102
-rw-r--r--config/gnu-warnings/developer-4.822
-rw-r--r--config/gnu-warnings/developer-71
-rw-r--r--config/gnu-warnings/developer-83
-rw-r--r--config/gnu-warnings/developer-general10
-rw-r--r--config/gnu-warnings/developer-gfort-51
-rw-r--r--config/gnu-warnings/error-513
-rw-r--r--config/gnu-warnings/error-822
-rw-r--r--config/gnu-warnings/error-general91
-rw-r--r--config/gnu-warnings/general26
-rw-r--r--config/gnu-warnings/gfort-4.817
-rw-r--r--config/gnu-warnings/gfort-61
-rw-r--r--config/gnu-warnings/gfort-81
-rw-r--r--config/gnu-warnings/gfort-general12
-rw-r--r--config/gnu-warnings/no-cxx-developer-4.89
-rw-r--r--config/gnu-warnings/no-developer-4.812
-rw-r--r--config/gnu-warnings/no-developer-82
-rw-r--r--config/gnu-warnings/no-developer-general8
-rw-r--r--config/ibm-aix2
-rw-r--r--config/ibm-flags2
-rw-r--r--config/intel-cxxflags185
-rw-r--r--config/intel-fflags83
-rw-r--r--config/intel-flags123
-rw-r--r--config/intel-warnings/1519
-rw-r--r--config/intel-warnings/182
-rw-r--r--config/intel-warnings/developer-general4
-rw-r--r--config/intel-warnings/general1
-rw-r--r--config/intel-warnings/ifort-general1
-rw-r--r--config/intel-warnings/win-developer-general1
-rw-r--r--config/intel-warnings/win-general1
-rw-r--r--config/intel-warnings/win-ifort-general1
-rw-r--r--config/libhdf5.pc.in (renamed from config/cmake/libhdf5.pc.in)0
-rw-r--r--config/linux-gnu2
-rw-r--r--config/linux-gnuaout2
-rw-r--r--config/linux-gnueabihf16
-rw-r--r--config/linux-gnulibc137
-rw-r--r--config/linux-gnulibc22
-rw-r--r--config/lt_vers.am2
-rw-r--r--config/netbsd56
-rw-r--r--config/pgi-cxxflags101
-rw-r--r--config/pgi-fflags66
-rw-r--r--config/pgi-flags89
-rw-r--r--config/sanitizer/LICENSE174
-rw-r--r--config/sanitizer/README.md307
-rw-r--r--config/sanitizer/code-coverage.cmake537
-rw-r--r--config/sanitizer/formatting.cmake92
-rw-r--r--config/sanitizer/sanitizers.cmake103
-rw-r--r--config/sanitizer/tools.cmake114
-rw-r--r--config/site-specific/BlankForm2
-rw-r--r--config/solaris29
-rw-r--r--config/toolchain/build32.cmake18
-rw-r--r--config/toolchain/clang.cmake16
-rw-r--r--config/toolchain/intel.cmake13
-rw-r--r--config/toolchain/mingw64.cmake14
150 files changed, 6519 insertions, 3346 deletions
diff --git a/config/BlankForm b/config/BlankForm
index a452f92..14131b2 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.
@@ -61,7 +61,7 @@ fi
#
# PROD_CFLAGS Flags to pass to the compiler to create a
# PROD_CPPFLAGS production version of the library. These
-# usualy exclude symbolic debugging switches
+# usually exclude symbolic debugging switches
# (like `-g') and include optimization switches
# (like `-O').
#
@@ -84,7 +84,7 @@ fi
# compiler or a descendent of gcc such as EGCS or PGCC.
#
# AM_CFLAGS Flags added directly into this variable will
-# be propogated to the compiler wrapper scripts (h5cc,
+# be propagated to the compiler wrapper scripts (h5cc,
# h5c++, et cetera) in addition to being used to compile
# the library.
#
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..2da7e93 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.
@@ -27,8 +27,14 @@ if test "X-" = "X-$CC"; then
CC_BASENAME=gcc
;;
*)
- CC=clang
- CC_BASENAME=clang
+ if test "X-$enable_parallel" = "X-yes"; then
+ # default to use mpicc which is the defacto MPI compiler name
+ CC=mpicc
+ CC_BASENAME=mpicc
+ else
+ CC=clang
+ CC_BASENAME=clang
+ fi
# Production
PROD_CFLAGS="-O3"
@@ -47,8 +53,11 @@ if test "X-" = "X-$CC"; then
esac
fi
-# Figure out compiler flags
+# Figure out C compiler flags
. $srcdir/config/gnu-flags
+. $srcdir/config/clang-flags
+. $srcdir/config/intel-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
@@ -64,15 +73,9 @@ case "$host_os" in
esac
;;
esac
-
-. $srcdir/config/intel-flags
+
if test "X-" = "X-$FC"; then
case $CC_BASENAME in
- clang)
- # clang has no fortran compiler. Use gfortran.
- FC=gfortran
- FC_BASENAME=gfortran
- ;;
gcc*)
FC=gfortran
FC_BASENAME=gfortran
@@ -81,15 +84,26 @@ if test "X-" = "X-$FC"; then
FC=ifort
FC_BASENAME=ifort
;;
+ mpicc*)
+ FC=mpif90
+ FC_BASENAME=mpif90
+ ;;
+ clang)
+ # clang has no fortran compiler. Use gfortran.
+ FC=gfortran
+ FC_BASENAME=gfortran
+ ;;
esac
fi
+# Figure out FORTRAN compiler flags
+. $srcdir/config/gnu-fflags
+. $srcdir/config/intel-fflags
+
+
+# The default C++ compiler is `clang++'.
if test "X-" = "X-$CXX"; then
case $CC_BASENAME in
- clang)
- CXX=clang++
- CXX_BASENAME=clang++
- ;;
gcc)
CXX=g++
CXX_BASENAME=g++
@@ -98,18 +112,21 @@ if test "X-" = "X-$CXX"; then
CXX=icpc
CXX_BASENAME=icpc
;;
+ mpicc*)
+ FC=mpif90
+ FC_BASENAME=mpif90
+ ;;
+ clang)
+ CXX=clang++
+ CXX_BASENAME=clang++
+ ;;
esac
fi
-case $CXX_BASENAME in
- clang++)
- PROD_CXXFLAGS="-O3"
- DEBUG_CXXFLAGS="-g -O0"
- # Use this for profiling with gprof
- # Just "-g" for now. More later.
- PROFILE_CXXFLAGS="-g"
- ;;
-esac
+# Figure out C++ compiler flags
+. $srcdir/config/intel-cxxflags # Do this ahead of GNU to avoid icpc being detected as g++
+. $srcdir/config/gnu-cxxflags
+. $srcdir/config/clang-cxxflags
# compiler version strings
case $CC in
@@ -132,16 +149,15 @@ case $CC in
echo "No match to get cc_version_info for $CC"
;;
esac
+
# Figure out Fortran compiler flags and version strings
case $FC in
*gfortran*)
- . $srcdir/config/gnu-fflags
fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS --version 2>&1 |\
grep 'GCC' | sed 's/\(.*(GCC) [-a-z0-9\. ]*\).*/\1/'`
;;
*ifc*|*ifort*)
- . $srcdir/config/intel-fflags
fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
;;
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..76f095f
--- /dev/null
+++ b/config/clang-cxxflags
@@ -0,0 +1,188 @@
+# -*- 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.
+#
+WARNINGS_AS_ERRORS_DFLT=no
+
+#
+# This filter rewrites -Werror= as -W, in that way demoting warnings
+# promoted to errors back to warnings, if WARNINGS_AS_ERRORS is no.
+#
+demote_errors()
+{
+ if [ ${WARNINGS_AS_ERRORS:-${WARNINGS_AS_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} | demote_errors
+ 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 -std=c++11"
+
+ ##############
+ # 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)"
+
+ ######################
+ # 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..5c377ed
--- /dev/null
+++ b/config/clang-flags
@@ -0,0 +1,210 @@
+# -*- 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.
+#
+WARNINGS_AS_ERRORS_DFLT=no
+
+#
+# This filter rewrites -Werror= as -W, in that way demoting warnings
+# promoted to errors back to warnings, if WARNINGS_AS_ERRORS is no.
+#
+demote_errors()
+{
+ if [ ${WARNINGS_AS_ERRORS:-${WARNINGS_AS_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} | demote_errors
+ 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)"
+
+ ######################
+ # 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..b80552f
--- /dev/null
+++ b/config/clang-warnings/developer-general
@@ -0,0 +1,3 @@
+-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..433dff9
--- /dev/null
+++ b/config/clang-warnings/general
@@ -0,0 +1,20 @@
+# general clang warnings flags
+-Wall
+-Warray-bounds
+-Wcast-qual
+-Wconversion
+-Wdouble-promotion
+-Wextra
+-Wformat=2
+-Wframe-larger-than=16384
+-Wimplicit-fallthrough
+-Wnull-dereference
+-Wunused-const-variable
+-Wwrite-strings
+-Wpedantic
+-Wvolatile-register-var
+# 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
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/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake
index a05f906..9517e4b 100644
--- a/config/cmake/CTestCustom.cmake
+++ b/config/cmake/CTestCustom.cmake
@@ -5,32 +5,33 @@
# 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 (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000)
# Allow full output to go to CDash set to 0
-SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 50000)
-SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 50000)
+set (CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 50000)
+set (CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 50000)
# WARNING! This could be a lot of output and could overwhelm CDash and the
# MySQL DB so this might not be a good idea!
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"
-# "SZIP.src.*:[ \t]*warning"
+ "note.*expected.*void.*but argument is of type.*volatile"
+ "plugin-build.*:[ \t]*warning"
+ "CMake Warning*stamp"
+ "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
@@ -69,26 +70,6 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
HL_FORTRAN_f90_ex-clear-objects
######### tools/h5clear #########
H5CLEAR-clearall-objects
- H5CLEAR-copy_h5clear_fsm_persist_equal.h5
- H5CLEAR-copy_h5clear_fsm_persist_greater.h5
- H5CLEAR-copy_h5clear_fsm_persist_less.h5
- H5CLEAR-copy_h5clear_fsm_persist_noclose.h5
- H5CLEAR-copy_h5clear_fsm_persist_user_equal.h5
- H5CLEAR-copy_h5clear_fsm_persist_user_greater.h5
- H5CLEAR-copy_h5clear_fsm_persist_user_less.h5
- H5CLEAR-copy_h5clear_log_v3.h5
- H5CLEAR-copy_h5clear_mdc_image.h5
- H5CLEAR-copy_h5clear_sec2_v0.h5
- H5CLEAR-copy_h5clear_sec2_v2.h5
- H5CLEAR-copy_h5clear_sec2_v3.h5
- H5CLEAR-copy_h5clear_status_noclear.h5
- H5CLEAR-copy_latest_h5clear_log_v3.h5
- H5CLEAR-copy_latest_h5clear_sec2_v3.h5
- H5CLEAR-copy_mod_h5clear_mdc_image.h5
- H5CLEAR-copy_mod_h5clr_mdc_image2.h5
- H5CLEAR-copy_orig_h5clear_sec2_v0.h5
- H5CLEAR-copy_orig_h5clear_sec2_v2.h5
- H5CLEAR-copy_orig_h5clear_sec2_v3.h5
H5CLEAR-h5clear_gentest # does not close ids by design
######### tools/h5copy #########
H5COPY-clearall-objects
@@ -151,13 +132,15 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
H5REPACK-szip_individual-clear-objects
H5REPACK-szip_remove-clear-objects
H5REPACK-upgrade_layout-clear-objects
+ H5REPACK_DMP-attrregion-clear-objects
H5REPACK_DMP-crtorder-clear-objects
+ H5REPACK_DMP-dataregion-clear-objects
H5REPACK_DMP-deflate_limit-clear-objects
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 e819e58..0ed9063 100644
--- a/config/cmake/CTestScript.cmake
+++ b/config/cmake/CTestScript.cmake
@@ -5,11 +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.
#
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
########################################################
# For any comments please contact cdashhelp@hdfgroup.org
#
@@ -119,8 +119,12 @@ set(CTEST_CONFIGURE_TOOLSET "")
if(CMAKE_GENERATOR_TOOLSET)
set(CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}")
endif()
+set(CTEST_CONFIGURE_ARCHITECTURE "")
+if(CMAKE_GENERATOR_ARCHITECTURE)
+ set(CTEST_CONFIGURE_ARCHITECTURE "-A${CMAKE_GENERATOR_ARCHITECTURE}")
+endif()
set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
+ "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_ARCHITECTURE}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
)
#-----------------------------------------------------------------------------
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index ab1fa89..43aa243 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.
#
@@ -30,7 +30,7 @@ MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS)
# ----------------------------------------------------------------------
# Decide whether the data accuracy has higher priority during data
-# conversions. If not, some hard conversions will still be prefered even
+# conversions. If not, some hard conversions will still be preferred even
# though the data may be wrong (for example, some compilers don't
# support denormalized floating values) to maximize speed.
#-----------------------------------------------------------------------------
@@ -61,12 +61,29 @@ if (HDF5_ENABLE_CODESTACK)
endif ()
MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK)
+# ----------------------------------------------------------------------
+# Check if they would like to use file locking by default
#-----------------------------------------------------------------------------
-# Are we going to use HSIZE_T
+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_ENABLE_HSIZET "Enable datasets larger than memory" ON)
-if (HDF5_ENABLE_HSIZET)
- set (${HDF_PREFIX}_HAVE_LARGE_HSIZET 1)
+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 ()
# so far we have no check for this
@@ -100,8 +117,6 @@ endif ()
# END of WINDOWS Hard code Values
# ----------------------------------------------------------------------
-CHECK_FUNCTION_EXISTS (difftime ${HDF_PREFIX}_HAVE_DIFFTIME)
-
# Find the library containing clock_gettime()
if (MINGW OR NOT WINDOWS)
CHECK_FUNCTION_EXISTS (clock_gettime CLOCK_GETTIME_IN_LIBC)
@@ -134,20 +149,24 @@ if (NOT WINDOWS)
OUTPUT_VARIABLE OUTPUT
)
if (TEST_DIRECT_VFD_WORKS_COMPILE)
- if (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0)
+ if (TEST_DIRECT_VFD_WORKS_RUN EQUAL "0")
HDF_FUNCTION_TEST (HAVE_DIRECT)
set (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE")
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"
)
@@ -160,10 +179,6 @@ endif ()
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_ROS3_VFD "Build the ROS3 Virtual File Driver" OFF)
if (HDF5_ENABLE_ROS3_VFD)
- # CMake version 3.13 fixed FindCURL module
- if(CMAKE_VERSION VERSION_LESS "3.13.0" AND WIN32)
- MESSAGE(FATAL_ERROR "Windows builds for this option requires a minimum of CMake 3.13")
- endif ()
find_package(CURL REQUIRED)
find_package(OpenSSL REQUIRED)
if (${CURL_FOUND} AND ${OPENSSL_FOUND})
@@ -171,33 +186,156 @@ 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 (HDF5_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 RETURN_OUTPUT_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_OUTPUT_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 EQUAL "0")
+ set (${RETURN_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 (${RETURN_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() {\nprintf(\"\\%d\\\;\\%d\\\;\", C_LDBL_DIG, C_FLT128_DIG)\\\;\n\nreturn 0\\\;\n}\n
+ "
+)
+
+C_RUN ("maximum decimal precision for C" ${PROG_SRC} PROG_RES 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
@@ -205,19 +343,25 @@ macro (H5ConversionTests TEST msg)
OUTPUT_VARIABLE OUTPUT
)
if (${TEST}_COMPILE)
- if (${TEST}_RUN MATCHES 0)
+ if (${TEST}_RUN EQUAL "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/FindCIRCLE.cmake b/config/cmake/FindCIRCLE.cmake
new file mode 100644
index 0000000..b36d76c
--- /dev/null
+++ b/config/cmake/FindCIRCLE.cmake
@@ -0,0 +1,49 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindCIRCLE
+--------
+
+Find the native CIRCLE includes and library
+
+This module defines
+
+::
+
+ CIRCLE_INCLUDE_DIR, where to find CIRCLE.h, etc.
+ CIRCLE_LIBRARIES, the libraries required to use CIRCLE.
+ CIRCLE_FOUND, If false, do not try to use CIRCLE.
+
+also defined, but not for general use are
+
+::
+
+ CIRCLE_LIBRARY, where to find the CIRCLE library.
+#]=======================================================================]
+
+if(DEFINED ENV{MFU_ROOT})
+ set(ENV{MFU_INCLUDE} "$ENV{MFU_ROOT}/include")
+ set(ENV{MFU_LIB} "$ENV{MFU_ROOT}/lib")
+ set(ENV{MFU_LIB64} "$ENV{MFU_ROOT}/lib64")
+else()
+ message("CIRCLE_LIBRARY: If you have problems building this library,\nconsider setting the MFU_ROOT environment variable to indicate\nwhere to find the support libraries and header files!")
+endif()
+
+find_path(CIRCLE_INCLUDE_DIR
+ NAMES libcircle.h
+ HINTS ENV MFU_INCLUDE)
+
+find_library(CIRCLE_LIBRARY
+ NAMES circle
+ HINTS ENV MFU_LIB ENV MFU_LIB64
+ )
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CIRCLE REQUIRED_VARS CIRCLE_LIBRARY CIRCLE_INCLUDE_DIR)
+
+if(CIRCLE_FOUND)
+ set(CIRCLE_LIBRARIES ${CIRCLE_LIBRARY} )
+endif()
+
+mark_as_advanced(CIRCLE_INCLUDE_DIR CIRCLE_LIBRARY)
diff --git a/config/cmake/FindDTCMP.cmake b/config/cmake/FindDTCMP.cmake
new file mode 100644
index 0000000..b95ef20
--- /dev/null
+++ b/config/cmake/FindDTCMP.cmake
@@ -0,0 +1,48 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindDTCMP
+--------
+
+Find the native DTCMP includes and library
+
+This module defines
+
+::
+
+ DTCMP_INCLUDE_DIR, where to find DTCMP.h, etc.
+ DTCMP_LIBRARIES, the libraries required to use DTCMP.
+ DTCMP_FOUND, If false, do not try to use DTCMP.
+
+also defined, but not for general use are
+
+::
+
+ DTCMP_LIBRARY, where to find the DTCMP library.
+#]=======================================================================]
+
+if(DEFINED ENV{MFU_ROOT})
+ set(ENV{MFU_INCLUDE} "$ENV{MFU_ROOT}/include")
+ set(ENV{MFU_LIB} "$ENV{MFU_ROOT}/lib")
+ set(ENV{MFU_LIB64} "$ENV{MFU_ROOT}/lib64")
+else()
+ message("DTCMP_LIBRARY: If you have problems building this library,\nconsider setting the MFU_ROOT environment variable to indicate\nwhere to find the support libraries and header files!")
+endif()
+
+find_path(DTCMP_INCLUDE_DIR
+ NAMES dtcmp.h
+ HINTS ENV MFU_INCLUDE)
+
+find_library(DTCMP_LIBRARY
+ NAMES dtcmp
+ HINTS ENV MFU_LIB ENV MFU_LIB64)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(DTCMP REQUIRED_VARS DTCMP_LIBRARY DTCMP_INCLUDE_DIR)
+
+if(DTCMP_FOUND)
+ set(DTCMP_LIBRARIES ${DTCMP_LIBRARY} )
+endif()
+
+mark_as_advanced(DTCMP_INCLUDE_DIR DTCMP_LIBRARY)
diff --git a/config/cmake/FindMFU.cmake b/config/cmake/FindMFU.cmake
new file mode 100644
index 0000000..37699e2
--- /dev/null
+++ b/config/cmake/FindMFU.cmake
@@ -0,0 +1,100 @@
+#
+# 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.
+#
+#########################################################################
+
+# - Derived from the FindTiff.cmake and FindJPEG.cmake that is included with cmake
+# FindMFU
+
+# Find the native MFU includes and library
+
+# Imported targets
+##################
+
+# This module defines the following :prop_tgt:`IMPORTED` targets:
+#
+# MFU::MFU
+# The MFU library, if found.
+#
+# Result variables
+###################
+
+# This module will set the following variables in your project:
+
+# MFU_FOUND, true if the MFU headers and libraries were found.
+# MFU_INCLUDE_DIR, the directory containing the MFU headers.
+# MFU_INCLUDE_DIRS, the directory containing the MFU headers.
+# MFU_LIBRARIES, libraries to link against to use MFU.
+
+# Cache variables
+#################
+
+# The following variables may also be set:
+
+# MFU_LIBRARY, where to find the MFU library.
+# message (STATUS "Finding MFU library and headers..." )
+#########################################################################
+
+
+
+FIND_PATH(MFU_INCLUDE_DIR
+ NAMES mfu.h
+ HINTS "$ENV{MFU_ROOT}/include"
+)
+FIND_LIBRARY(MFU_LIBRARY
+ NAMES mfu
+ HINTS "$ENV{MFU_ROOT}/lib64"
+)
+
+if(NOT MFU_LIBRARY)
+ set(mfu_names ${MFU_NAMES} mfu libmfu)
+ find_library(MFU_LIBRARY NAMES ${mfu_names})
+ include(SelectLibraryConfigurations)
+ select_library_configurations(MFU)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(MFU
+ REQUIRED_VARS MFU_LIBRARY MFU_INCLUDE_DIR)
+
+if(MFU_FOUND)
+ set(MFU_LIBRARIES "${MFU_LIBRARY}")
+ set(MFU_INCLUDE_DIRS "${MFU_INCLUDE_DIR}")
+ set(LL_PATH "$ENV{MFU_ROOT}/lib64:$ENV{MFU_ROOT}/lib")
+ if(NOT TARGET MFU::MFU)
+ add_library(MFU::MFU UNKNOWN IMPORTED)
+ if(MFU_INCLUDE_DIRS)
+ set_target_properties(MFU::MFU PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${MFU_INCLUDE_DIRS}")
+ endif()
+ if(EXISTS "${MFU_LIBRARY}")
+ set_target_properties(MFU::MFU PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION "${MFU_LIBRARY}")
+ endif()
+ endif()
+endif()
+
+# Report the results.
+if (NOT MFU_FOUND)
+ set (MFU_DIR_MESSAGE
+ "Mfu was not found. Make sure MFU_LIBRARY and MFU_INCLUDE_DIR are set or set the MFU_INSTALL environment variable."
+ )
+ if (NOT MFU_FIND_QUIETLY)
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "${MFU_DIR_MESSAGE}")
+ endif ()
+ else ()
+ if (MFU_FIND_REQUIRED)
+ message (FATAL_ERROR "Mfu was NOT found and is Required by this project")
+ endif ()
+ endif ()
+endif ()
diff --git a/config/cmake/H5cxx_config.h.in b/config/cmake/H5cxx_config.h.in
deleted file mode 100644
index d1dd42b..0000000
--- a/config/cmake/H5cxx_config.h.in
+++ /dev/null
@@ -1,16 +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. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* src/H5cxx_config.h.in Created manually. */
-
-/* Define if offsetof extension is present */
-#cmakedefine H5_HAVE_OFFSETOF ${H5_HAVE_OFFSETOF}
-
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index 120c023..4956c97 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,18 +26,16 @@
/* 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 if your system is IBM ppc64le and cannot convert some long double
+ values correctly. */
+#cmakedefine H5_DISABLE_SOME_LDOUBLE_CONV @H5_DISABLE_SOME_LDOUBLE_CONV@
+
/* Define to dummy `main' function (if any) required to link to the Fortran
libraries. */
#cmakedefine H5_FC_DUMMY_MAIN @H5_FC_DUMMY_MAIN@
@@ -73,13 +71,13 @@
/* Define Fortran compiler ID */
#define H5_Fortran_COMPILER_ID @CMAKE_Fortran_COMPILER_ID@
+/* Define number of valid Fortran INTEGER KINDs (must be defined before F_IKIND)*/
+#cmakedefine H5_H5CONFIG_F_NUM_IKIND @H5_H5CONFIG_F_NUM_IKIND@
+
/* Define valid Fortran INTEGER KINDs */
#cmakedefine H5_H5CONFIG_F_IKIND @H5_H5CONFIG_F_IKIND@
-/* Define number of valid Fortran INTEGER KINDs */
-#cmakedefine H5_H5CONFIG_F_NUM_IKIND @H5_H5CONFIG_F_NUM_IKIND@
-
-/* Define number of valid Fortran REAL KINDs */
+/* Define number of valid Fortran REAL KINDs (must be defined before F_RKIND) */
#cmakedefine H5_H5CONFIG_F_NUM_RKIND @H5_H5CONFIG_F_NUM_RKIND@
/* Define valid Fortran REAL KINDs */
@@ -91,6 +89,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@
@@ -101,9 +102,6 @@
and unions */
#cmakedefine H5_HAVE_C99_DESIGNATED_INITIALIZER @H5_HAVE_C99_DESIGNATED_INITIALIZER@
-/* Define if the compiler understands the __func__ keyword */
-#cmakedefine H5_HAVE_C99_FUNC @H5_HAVE_C99_FUNC@
-
/* Define to 1 if you have the `clock_gettime' function. */
#cmakedefine H5_HAVE_CLOCK_GETTIME @H5_HAVE_CLOCK_GETTIME@
@@ -111,14 +109,11 @@
#cmakedefine H5_HAVE_CODESTACK @H5_HAVE_CODESTACK@
/* Define to 1 if you have the <curl/curl.h> header file. */
-#cmakedefine H5_HAVE_CURL_H @H5_HAVE_CURL_H@
+#cmakedefine H5_HAVE_CURL_CURL_H @H5_HAVE_CURL_H@
/* Define if Darwin or Mac OS X */
#cmakedefine H5_HAVE_DARWIN @H5_HAVE_DARWIN@
-/* Define to 1 if you have the `difftime' function. */
-#cmakedefine H5_HAVE_DIFFTIME @H5_HAVE_DIFFTIME@
-
/* Define if the direct I/O virtual file driver (VFD) should be compiled */
#cmakedefine H5_HAVE_DIRECT @H5_HAVE_DIRECT@
@@ -155,18 +150,9 @@
/* Define to 1 if you have the `fork' function. */
#cmakedefine H5_HAVE_FORK @H5_HAVE_FORK@
-/* Define to 1 if you have the `frexpf' function. */
-#cmakedefine H5_HAVE_FREXPF @H5_HAVE_FREXPF@
-
-/* Define to 1 if you have the `frexpl' function. */
-#cmakedefine H5_HAVE_FREXPL @H5_HAVE_FREXPL@
-
/* Define to 1 if you have the `fseeko' function. */
#cmakedefine H5_HAVE_FSEEKO @H5_HAVE_FSEEKO@
-/* Define if the compiler understands the __FUNCTION__ keyword */
-#cmakedefine H5_HAVE_FUNCTION @H5_HAVE_FUNCTION@
-
/* Determine if INTEGER*16 is available */
#cmakedefine H5_HAVE_Fortran_INTEGER_SIZEOF_16 @H5_HAVE_Fortran_INTEGER_SIZEOF_16@
@@ -191,22 +177,13 @@
/* Define to 1 if you have the <hdfs.h> header file. */
#cmakedefine H5_HAVE_HDFS_H @H5_HAVE_HDFS_H@
-/* Define if the compiler understands inline */
-#cmakedefine H5_HAVE_INLINE @H5_HAVE_INLINE@
-
/* Define if parallel library will contain instrumentation to detect correct
optimization operation */
#cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@
-/* Define to 1 if you have the <inttypes.h> header file. */
-#cmakedefine H5_HAVE_INTTYPES_H @H5_HAVE_INTTYPES_H@
-
/* Define to 1 if you have the `ioctl' function. */
#cmakedefine H5_HAVE_IOCTL @H5_HAVE_IOCTL@
-/* Define to 1 if you have the <io.h> header file. */
-#cmakedefine H5_HAVE_IO_H @H5_HAVE_IO_H@
-
/* Define to 1 if you have the `crypto' library (-lcrypto). */
#cmakedefine H5_HAVE_LIBCRYPTO @H5_HAVE_LIBCRYPTO@
@@ -243,48 +220,39 @@
/* Define to 1 if you have the `z' library (-lz). */
#cmakedefine H5_HAVE_LIBZ @H5_HAVE_LIBZ@
-/* Define to 1 if you have the `llround' function. */
-#cmakedefine H5_HAVE_LLROUND @H5_HAVE_LLROUND@
-
-/* Define to 1 if you have the `llroundf' function. */
-#cmakedefine H5_HAVE_LLROUNDF @H5_HAVE_LLROUNDF@
-
-/* Define to 1 if you have the `longjmp' function. */
-#cmakedefine H5_HAVE_LONGJMP @H5_HAVE_LONGJMP@
-
-/* Define to 1 if you have the `lround' function. */
-#cmakedefine H5_HAVE_LROUND @H5_HAVE_LROUND@
-
-/* Define to 1 if you have the `lroundf' function. */
-#cmakedefine H5_HAVE_LROUNDF @H5_HAVE_LROUNDF@
-
/* Define to 1 if you have the `lseek64' function. */
#cmakedefine H5_HAVE_LSEEK64 @H5_HAVE_LSEEK64@
/* 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@
@@ -297,12 +265,18 @@
/* Define if we have parallel support */
#cmakedefine H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@
+/* Define if we have support for writing to filtered datasets in parallel */
+#cmakedefine H5_HAVE_PARALLEL_FILTERED_WRITES @H5_HAVE_PARALLEL_FILTERED_WRITES@
+
/* Define if both pread and pwrite exist. */
#cmakedefine H5_HAVE_PREADWRITE @H5_HAVE_PREADWRITE@
/* Define to 1 if you have the <pthread.h> header file. */
#cmakedefine H5_HAVE_PTHREAD_H @H5_HAVE_PTHREAD_H@
+/* Define to 1 if you have the <pwd.h> header file. */
+#cmakedefine H5_HAVE_PWD_H @H5_HAVE_PWD_H@
+
/* Define to 1 if you have the <quadmath.h> header file. */
#cmakedefine H5_HAVE_QUADMATH_H @H5_HAVE_QUADMATH_H@
@@ -316,57 +290,27 @@
compiled */
#cmakedefine H5_HAVE_ROS3_VFD @H5_HAVE_ROS3_VFD@
-/* Define to 1 if you have the `round' function. */
-#cmakedefine H5_HAVE_ROUND @H5_HAVE_ROUND@
-
-/* Define to 1 if you have the `roundf' function. */
-#cmakedefine H5_HAVE_ROUNDF @H5_HAVE_ROUNDF@
-
-/* Define to 1 if you have the `setjmp' function. */
-#cmakedefine H5_HAVE_SETJMP @H5_HAVE_SETJMP@
-
-/* Define to 1 if you have the <setjmp.h> header file. */
-#cmakedefine H5_HAVE_SETJMP_H @H5_HAVE_SETJMP_H@
-
/* Define to 1 if you have the `setsysinfo' function. */
#cmakedefine H5_HAVE_SETSYSINFO @H5_HAVE_SETSYSINFO@
/* Define to 1 if you have the `siglongjmp' function. */
#cmakedefine H5_HAVE_SIGLONGJMP @H5_HAVE_SIGLONGJMP@
-/* Define to 1 if you have the `signal' function. */
-#cmakedefine H5_HAVE_SIGNAL @H5_HAVE_SIGNAL@
-
/* Define to 1 if you have the `sigprocmask' function. */
#cmakedefine H5_HAVE_SIGPROCMASK @H5_HAVE_SIGPROCMASK@
/* Define to 1 if you have the `sigsetjmp' function. */
#cmakedefine H5_HAVE_SIGSETJMP @H5_HAVE_SIGSETJMP@
-/* Define to 1 if you have the `snprintf' function. */
-#cmakedefine H5_HAVE_SNPRINTF @H5_HAVE_SNPRINTF@
-
/* Define to 1 if you have the `srandom' function. */
#cmakedefine H5_HAVE_SRANDOM @H5_HAVE_SRANDOM@
/* Define to 1 if you have the `stat64' function. */
#cmakedefine H5_HAVE_STAT64 @H5_HAVE_STAT64@
-/* Define if `struct stat' has the `st_blocks' field */
+/* Define if struct stat has the st_blocks field */
#cmakedefine H5_HAVE_STAT_ST_BLOCKS @H5_HAVE_STAT_ST_BLOCKS@
-/* Define to 1 if you have the <stdbool.h> header file. */
-#cmakedefine H5_HAVE_STDBOOL_H @H5_HAVE_STDBOOL_H@
-
-/* Define to 1 if you have the <stddef.h> header file. */
-#cmakedefine H5_HAVE_STDDEF_H @H5_HAVE_STDDEF_H@
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine H5_HAVE_STDINT_H @H5_HAVE_STDINT_H@
-
-/* Define to 1 if you have the <stdint.h> header file for Cplusplus. */
-#cmakedefine H5_HAVE_STDINT_H_CXX @H5_HAVE_STDINT_H_CXX@
-
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine H5_HAVE_STDLIB_H @H5_HAVE_STDLIB_H@
@@ -379,12 +323,6 @@
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine H5_HAVE_STRING_H @H5_HAVE_STRING_H@
-/* Define to 1 if you have the `strtoll' function. */
-#cmakedefine H5_HAVE_STRTOLL @H5_HAVE_STRTOLL@
-
-/* Define to 1 if you have the `strtoull' function. */
-#cmakedefine H5_HAVE_STRTOULL @H5_HAVE_STRTOULL@
-
/* Define if struct text_info is defined */
#cmakedefine H5_HAVE_STRUCT_TEXT_INFO @H5_HAVE_STRUCT_TEXT_INFO@
@@ -394,9 +332,6 @@
/* Define to 1 if you have the `symlink' function. */
#cmakedefine H5_HAVE_SYMLINK @H5_HAVE_SYMLINK@
-/* Define to 1 if you have the `system' function. */
-#cmakedefine H5_HAVE_SYSTEM @H5_HAVE_SYSTEM@
-
/* Define to 1 if you have the <sys/file.h> header file. */
#cmakedefine H5_HAVE_SYS_FILE_H @H5_HAVE_SYS_FILE_H@
@@ -412,9 +347,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@
@@ -453,9 +385,6 @@
/* Define to 1 if you have the `vasprintf' function. */
#cmakedefine H5_HAVE_VASPRINTF @H5_HAVE_VASPRINTF@
-/* Define to 1 if you have the `vsnprintf' function. */
-#cmakedefine H5_HAVE_VSNPRINTF @H5_HAVE_VSNPRINTF@
-
/* Define to 1 if you have the `waitpid' function. */
#cmakedefine H5_HAVE_WAITPID @H5_HAVE_WAITPID@
@@ -465,9 +394,6 @@
/* Define if your system has window style path name. */
#cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@
-/* Define to 1 if you have the <winsock2.h> header file. */
-#cmakedefine H5_HAVE_WINSOCK2_H @H5_HAVE_WINSOCK2_H@
-
/* Define to 1 if you have the <zlib.h> header file. */
#cmakedefine H5_HAVE_ZLIB_H @H5_HAVE_ZLIB_H@
@@ -477,15 +403,15 @@
/* Define to 1 if you have the `_scrsize' function. */
#cmakedefine H5_HAVE__SCRSIZE @H5_HAVE__SCRSIZE@
-/* Define if the compiler understands __inline */
-#cmakedefine H5_HAVE___INLINE @H5_HAVE___INLINE@
-
-/* 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@
+/* Define if new-style references should be used with dimension scales */
+#cmakedefine H5_DIMENSION_SCALES_WITH_NEW_REF @H5_DIMENSION_SCALES_WITH_NEW_REF@
+
/* Define if your system can convert long double to (unsigned) long long
values correctly. */
#cmakedefine H5_LDOUBLE_TO_LLONG_ACCURATE @H5_LDOUBLE_TO_LLONG_ACCURATE@
@@ -502,14 +428,11 @@
with special algorithm. */
#cmakedefine H5_LONG_TO_LDOUBLE_SPECIAL @H5_LONG_TO_LDOUBLE_SPECIAL@
-/* Define if your system is power6 and cannot convert some long double values. */
-#cmakedefine H5_DISABLE_SOME_LDOUBLE_CONV @H5_DISABLE_SOME_LDOUBLE_CONV@
-
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#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 +462,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 +522,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 +532,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 +552,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. */
@@ -695,9 +633,6 @@
/* The size of `__int64', as computed by sizeof. */
#define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@
-/* Define to 1 if you have the ANSI C header files. */
-#cmakedefine H5_STDC_HEADERS @H5_STDC_HEADERS@
-
/* Define if strict file format checks are enabled */
#cmakedefine H5_STRICT_FORMAT_CHECKS @H5_STRICT_FORMAT_CHECKS@
@@ -705,9 +640,6 @@
PTHREAD_SCOPE_SYSTEM) call. */
#cmakedefine H5_SYSTEM_SCOPE_THREADS @H5_SYSTEM_SCOPE_THREADS@
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#cmakedefine H5_TIME_WITH_SYS_TIME @H5_TIME_WITH_SYS_TIME@
-
/* Define using v1.6 public API symbols by default */
#cmakedefine H5_USE_16_API_DEFAULT @H5_USE_16_API_DEFAULT@
@@ -720,6 +652,12 @@
/* Define using v1.12 public API symbols by default */
#cmakedefine H5_USE_112_API_DEFAULT @H5_USE_112_API_DEFAULT@
+/* Define using v1.14 public API symbols by default */
+#cmakedefine H5_USE_114_API_DEFAULT @H5_USE_114_API_DEFAULT@
+
+/* Define if the library will use file locking */
+#cmakedefine H5_USE_FILE_LOCKING @H5_USE_FILE_LOCKING@
+
/* 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. */
@@ -728,7 +666,7 @@
/* Version number of package */
#define H5_VERSION "@HDF5_PACKAGE_VERSION_STRING@"
-/* Data accuracy is prefered to speed during data conversions */
+/* Data accuracy is preferred to speed during data conversions */
#cmakedefine H5_WANT_DATA_ACCURACY @H5_WANT_DATA_ACCURACY@
/* Check exception handling functions during data conversions */
@@ -754,19 +692,10 @@
/* Define for large files, on AIX-style hosts. */
#cmakedefine H5__LARGE_FILES
-/* Define to empty if `const' does not conform to ANSI C. */
-#cmakedefine H5_const
-
/* Define to `long int' if <sys/types.h> does not define. */
#cmakedefine H5_off_t
/* Define to `long' if <sys/types.h> does not define. */
-#cmakedefine H5_ptrdiff_t
-
-/* Define to `unsigned long' if <sys/types.h> does not define. */
-#cmakedefine H5_size_t
-
-/* Define to `long' if <sys/types.h> does not define. */
#cmakedefine H5_ssize_t
#endif
diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake
index 007bc29..8b8b334 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.
#
@@ -58,5 +58,46 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage)
endif ()
endif ()
endif ()
+endmacro ()
+
+# Initialize the list of VFDs to be used for testing and create a test folder for each VFD
+macro (H5_SET_VFD_LIST)
+ set (VFD_LIST
+ sec2
+ stdio
+ core
+ core_paged
+ split
+ multi
+ family
+ splitter
+ #log - log VFD currently has file space allocation bugs
+ )
+
+ if (H5_HAVE_DIRECT)
+ set (VFD_LIST ${VFD_LIST} direct)
+ endif ()
+ if (H5_HAVE_PARALLEL)
+ # MPI I/O VFD is currently incompatible with too many tests in the VFD test set
+ # set (VFD_LIST ${VFD_LIST} mpio)
+ endif ()
+ if (H5_HAVE_MIRROR_VFD)
+ set (VFD_LIST ${VFD_LIST} mirror)
+ endif ()
+ if (H5_HAVE_ROS3_VFD)
+ set (VFD_LIST ${VFD_LIST} ros3)
+ endif ()
+ if (H5_HAVE_LIBHDFS)
+ set (VFD_LIST ${VFD_LIST} hdfs)
+ endif ()
+ if (H5_HAVE_WINDOWS)
+ set (VFD_LIST ${VFD_LIST} windows)
+ endif ()
+endmacro ()
+# Initialize the list of VFDs to be used for testing and create a test folder for each VFD
+macro (H5_CREATE_VFD_DIR)
+ foreach (vfdtest ${VFD_LIST})
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}")
+ endforeach ()
endmacro ()
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..dbed15c
--- /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_SZ)
+ add_dependencies (h5sz ${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 2d3d371..43e006c 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.
#
@@ -19,11 +19,26 @@ enable_language (Fortran)
set (HDF_PREFIX "H5")
include (CheckFortranFunctionExists)
+if (NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ include (CheckFortranSourceRuns)
+ include (CheckFortranSourceCompiles)
+endif ()
+
+# Read source line beginning at the line matching Input:"START" and ending at the line matching Input:"END"
+macro (READ_SOURCE SOURCE_START SOURCE_END RETURN_VAR)
+ file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_MASTER)
+ string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_MASTER})
+ set (RETURN_VAR "${SOURCE_CODE}")
+endmacro ()
+
+set (RUN_OUTPUT_PATH_DEFAULT ${CMAKE_BINARY_DIR})
# The provided CMake Fortran macros don't provide a general compile/run function
# 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}")
+macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 RETURN_VAR RETURN_OUTPUT_VAR)
+ 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}"
@@ -32,45 +47,46 @@ macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90
LINK_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}"
+ RUN_OUTPUT_VARIABLE OUTPUT_VAR
)
+ set (${RETURN_OUTPUT_VAR} ${OUTPUT_VAR})
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"
)
set(${RETURN_VAR} ${COMPILE_RESULT_VAR})
endif ()
endmacro ()
-
-# Read source line beginning at the line matching Input:"START" and ending at the line matching Input:"END"
-macro (READ_SOURCE SOURCE_START SOURCE_END RETURN_VAR)
- file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_MASTER)
- string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_MASTER})
- set (RETURN_VAR "${SOURCE_CODE}")
-endmacro ()
-
#-----------------------------------------------------------------------------
# Check to see C_LONG_DOUBLE is available
READ_SOURCE("PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" "END PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" SOURCE_CODE)
-CHECK_FORTRAN_FEATURE(c_long_double
- "${SOURCE_CODE}"
- FORTRAN_HAVE_C_LONG_DOUBLE
-)
+if (NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ check_fortran_source_compiles (${SOURCE_CODE} FORTRAN_HAVE_C_LONG_DOUBLE SRC_EXT f90)
+else ()
+ CHECK_FORTRAN_FEATURE(c_long_double "${SOURCE_CODE}" FORTRAN_HAVE_C_LONG_DOUBLE)
+endif ()
if (${FORTRAN_HAVE_C_LONG_DOUBLE})
set (${HDF_PREFIX}_FORTRAN_HAVE_C_LONG_DOUBLE 1)
@@ -81,10 +97,11 @@ endif ()
# Check to see C_LONG_DOUBLE is different from C_DOUBLE
READ_SOURCE("MODULE type_mod" "END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE" SOURCE_CODE)
-CHECK_FORTRAN_FEATURE(c_long_double
- "${SOURCE_CODE}"
- FORTRAN_C_LONG_DOUBLE_IS_UNIQUE
-)
+if (NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ check_fortran_source_compiles (${SOURCE_CODE} FORTRAN_C_LONG_DOUBLE_IS_UNIQUE SRC_EXT f90)
+else ()
+ CHECK_FORTRAN_FEATURE(c_long_double "${SOURCE_CODE}" FORTRAN_C_LONG_DOUBLE_IS_UNIQUE)
+endif ()
if (${FORTRAN_C_LONG_DOUBLE_IS_UNIQUE})
set (${HDF_PREFIX}_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 1)
else ()
@@ -113,18 +130,18 @@ FORTRAN_RUN ("REAL and INTEGER KINDs"
"${SOURCE_CODE}"
XX
YY
- PROG_RESULT
+ FC_AVAIL_KINDS_RESULT
+ PROG_OUTPUT
)
# dnl The output from the above program will be:
-# dnl -- LINE 1 -- valid integer kinds (comma seperated list)
-# dnl -- LINE 2 -- valid real kinds (comma seperated list)
+# dnl -- LINE 1 -- valid integer kinds (comma separated list)
+# dnl -- LINE 2 -- valid real kinds (comma separated list)
# dnl -- LINE 3 -- max decimal precision for reals
# dnl -- LINE 4 -- number of valid integer kinds
# dnl -- LINE 5 -- number of valid real kinds
-
-file (READ "${CMAKE_BINARY_DIR}/pac_fconftest.out" PROG_OUTPUT)
+#
# 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 "[\r\n]+" ";" PROG_OUTPUT "${PROG_OUTPUT}")
list (GET PROG_OUTPUT 0 pac_validIntKinds)
list (GET PROG_OUTPUT 1 pac_validRealKinds)
@@ -165,26 +182,20 @@ message (STATUS "....MAX DECIMAL PRECISION ${${HDF_PREFIX}_PAC_FC_MAX_REAL_PRECI
# **********
string (REGEX REPLACE "," ";" VAR "${pac_validIntKinds}")
-foreach (KIND ${VAR} )
- set (PROG_SRC
- "
- PROGRAM main
- USE ISO_C_BINDING
- IMPLICIT NONE
- INTEGER (KIND=${KIND}) a
- OPEN(8,FILE='pac_validIntKinds.out',FORM='formatted')
- WRITE(8,'(I0)') ${FC_SIZEOF_A}
- CLOSE(8)
- END
- "
- )
- FORTRAN_RUN("INTEGER KIND SIZEOF" ${PROG_SRC}
- XX
- YY
- PROG_RESULT1
+foreach (KIND ${VAR})
+ set (PROG_SRC_${KIND}
+ "
+ PROGRAM main
+ USE ISO_C_BINDING
+ USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stderr=>ERROR_UNIT
+ IMPLICIT NONE
+ INTEGER (KIND=${KIND}) a
+ WRITE(stderr,'(I0)') ${FC_SIZEOF_A}
+ END
+ "
)
- file (READ "${CMAKE_BINARY_DIR}/pac_validIntKinds.out" PROG_OUTPUT1)
- string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}")
+ FORTRAN_RUN("INTEGER KIND SIZEOF" ${PROG_SRC_${KIND}} XX YY VALIDINTKINDS_RESULT_${KIND} PROG_OUTPUT1)
+ string (REGEX REPLACE "[\r\n]+" "" PROG_OUTPUT1 "${PROG_OUTPUT1}")
set (pack_int_sizeof "${pack_int_sizeof} ${PROG_OUTPUT1},")
endforeach ()
@@ -201,7 +212,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
# **********
@@ -213,26 +226,20 @@ math (EXPR _LEN "${LEN_VAR}-1")
list (GET VAR ${_LEN} max_real_fortran_kind)
foreach (KIND ${VAR} )
- set (PROG_SRC
- "
- PROGRAM main
- USE ISO_C_BINDING
- IMPLICIT NONE
- REAL (KIND=${KIND}) a
- OPEN(8,FILE='pac_validRealKinds.out',FORM='formatted')
- WRITE(8,'(I0)') ${FC_SIZEOF_A}
- CLOSE(8)
- END
- "
- )
- FORTRAN_RUN ("REAL KIND SIZEOF" ${PROG_SRC}
- XX
- YY
- PROG_RESULT1
+ set (PROG_SRC2_${KIND}
+ "
+ PROGRAM main
+ USE ISO_C_BINDING
+ USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stderr=>ERROR_UNIT
+ IMPLICIT NONE
+ REAL (KIND=${KIND}) a
+ WRITE(stderr,'(I0)') ${FC_SIZEOF_A}
+ END
+ "
)
- file (READ "${CMAKE_BINARY_DIR}/pac_validRealKinds.out" PROG_OUTPUT1)
- string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}")
- set (pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},")
+ FORTRAN_RUN ("REAL KIND SIZEOF" ${PROG_SRC2_${KIND}} XX YY VALIDREALKINDS_RESULT_${KIND} PROG_OUTPUT2)
+ string (REGEX REPLACE "[\r\n]+" "" PROG_OUTPUT2 "${PROG_OUTPUT2}")
+ set (pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT2},")
endforeach ()
if (pack_real_sizeof STREQUAL "")
@@ -261,29 +268,25 @@ list (GET VAR ${_LEN} max_real_fortran_sizeof)
#-----------------------------------------------------------------------------
# Find sizeof of native kinds
#-----------------------------------------------------------------------------
-FORTRAN_RUN ("SIZEOF NATIVE KINDs"
+set (PROG_SRC3
"
PROGRAM main
USE ISO_C_BINDING
+ USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stderr=>ERROR_UNIT
IMPLICIT NONE
INTEGER a
REAL b
DOUBLE PRECISION c
- OPEN(8,FILE='pac_sizeof_native_kinds.out',FORM='formatted')
- WRITE(8,*) ${FC_SIZEOF_A}
- WRITE(8,*) kind(a)
- WRITE(8,*) ${FC_SIZEOF_B}
- WRITE(8,*) kind(b)
- WRITE(8,*) ${FC_SIZEOF_C}
- WRITE(8,*) kind(c)
- CLOSE(8)
+ WRITE(stderr,*) ${FC_SIZEOF_A}
+ WRITE(stderr,*) kind(a)
+ WRITE(stderr,*) ${FC_SIZEOF_B}
+ WRITE(stderr,*) kind(b)
+ WRITE(stderr,*) ${FC_SIZEOF_C}
+ WRITE(stderr,*) kind(c)
END
"
- XX
- YY
- PROG_RESULT
- )
- file (READ "${CMAKE_BINARY_DIR}/pac_sizeof_native_kinds.out" PROG_OUTPUT)
+)
+FORTRAN_RUN ("SIZEOF NATIVE KINDs" ${PROG_SRC3} XX YY PAC_SIZEOF_NATIVE_KINDS_RESULT PROG_OUTPUT3)
# dnl The output from the above program will be:
# dnl -- LINE 1 -- sizeof INTEGER
# dnl -- LINE 2 -- kind of INTEGER
@@ -291,16 +294,16 @@ FORTRAN_RUN ("SIZEOF NATIVE KINDs"
# dnl -- LINE 4 -- kind of REAL
# dnl -- LINE 5 -- sizeof DOUBLE PRECISION
# 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 "[\r\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")
@@ -342,116 +345,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)
-
-#-----------------------------------------------------------------------------
-# 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 ()
-
-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\\\;
- }
- "
-)
-
-C_RUN ("maximum decimal precision for C" ${PROG_SRC} PROG_OUTPUT)
-
-# 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 bac174a..795399e 100644
--- a/config/cmake/HDF5_Examples.cmake.in
+++ b/config/cmake/HDF5_Examples.cmake.in
@@ -5,11 +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.
#
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
###############################################################################################################
# This script will build and run the examples from a folder
# Execute from a command line:
@@ -20,6 +20,9 @@ set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
if("@CMAKE_GENERATOR_TOOLSET@")
set(CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
endif()
+if("@CMAKE_GENERATOR_ARCHITECTURE@")
+ set(CMAKE_GENERATOR_ARCHITECTURE "@CMAKE_GENERATOR_ARCHITECTURE@")
+endif()
set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
# handle input parameters to script.
@@ -74,23 +77,24 @@ 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.4-Source")
+# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.14.4-Source")
#endif()
###############################################################################################################
+set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ROOT:PATH=${INSTALLDIR}")
if(WIN32)
set(SITE_OS_NAME "Windows")
- set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else()
- set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake")
set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
endif()
+### default HDF5_PLUGIN_PATH to where the filter libraries are located
+set(ENV{HDF5_PLUGIN_PATH} "${INSTALLDIR}/lib/plugin")
if(${CDASH_LOCAL})
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON")
endif()
diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake
index 386e99c..cdd49eb 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,15 +43,23 @@
#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")
+#############################################################################################
+### match the hdf5 library namespace
+set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NAMESPACE:STRING=hdf5::")
#############################################################################################
### enable threadsafe program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_THREADSAFE:BOOL=ON")
-
#############################################################################################
### enable test program builds, requires reference files in testfiles subdirectory
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING: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..e20ed6b
--- /dev/null
+++ b/config/cmake/HDFCXXCompilerFlags.cmake
@@ -0,0 +1,330 @@
+#
+# 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.
+#
+ENABLE_LANGUAGE (CXX)
+
+set (CMAKE_CXX_STANDARD 11)
+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 (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ set (_INTEL_WINDOWS 1)
+endif ()
+
+if (WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang" AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+ set (_CLANG_MSVC_WINDOWS 1)
+endif()
+
+# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it.
+if ((_CLANG_MSVC_WINDOWS OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") AND CMAKE_CXX_COMPILER_LOADED)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.28)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd5105")
+ endif ()
+endif ()
+
+if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_LOADED)
+ if (NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
+ if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 98)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
+ endif ()
+ else ()
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4")
+ 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")
+ 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 (${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")
+ if (_INTEL_WINDOWS)
+ ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-general")
+ else ()
+ ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general")
+ endif()
+ if (NOT _INTEL_WINDOWS)
+ 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()
+ 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")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general")
+ endif ()
+ elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ 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 MATCHES "[Cc]lang")
+ 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 MATCHES "[Cc]lang")
+ 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/cxx-developer-4.8")
+ else ()
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-cxx-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")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5")
+ 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")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-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-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 warnings
+ # 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 ()
+
+#-----------------------------------------------------------------------------
+# 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" AND NOT _INTEL_WINDOWS)
+ 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" AND NOT _INTEL_WINDOWS)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_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 adace89..eb43b73 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -5,18 +5,51 @@
# 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)
-message (STATUS "Warnings Configuration:")
set (CMAKE_C_FLAGS "${CMAKE_C99_STANDARD_COMPILE_OPTION} ${CMAKE_C_FLAGS}")
+set (CMAKE_C_FLAGS "${CMAKE_C_SANITIZER_FLAGS} ${CMAKE_C_FLAGS}")
+if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "Warnings Configuration: C default: ${CMAKE_C_FLAGS}")
+endif ()
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
+if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ set(_INTEL_WINDOWS 1)
+endif()
+
+if(WIN32 AND CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" AND "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
+ set(_CLANG_MSVC_WINDOWS 1)
+endif()
+
+# Disable deprecation warnings for standard C functions.
+# really only needed for newer versions of VS, but should
+# not hurt other versions, and this will work into the
+# future
+if(MSVC OR _INTEL_WINDOWS OR _CLANG_MSVC_WINDOWS)
+ add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
+else()
+endif()
+
+if(MSVC)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stack:10000000")
+endif()
+
+# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it.
+if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 19.28)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd5105")
+endif()
+
+if(_CLANG_MSVC_WINDOWS AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker -stack:20000000")
+endif()
+
if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
if (${HDF_CFG_NAME} MATCHES "Debug")
@@ -27,17 +60,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 ()
@@ -54,10 +89,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)
@@ -71,262 +102,189 @@ 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 (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
- set (CMAKE_C_FLAGS "${CMAKE_C_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_C_COMPILER_ID STREQUAL "Intel")
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wcheck -Wall")
- 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")
+
+#-----------------------------------------------------------------------------
+# 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")
+ list (APPEND HDF5_CMAKE_C_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_C_COMPILER_ID STREQUAL "Intel")
+ if (_INTEL_WINDOWS)
+ ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-general")
+ else ()
+ ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general")
+ endif()
+ if (NOT _INTEL_WINDOWS)
+ 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")
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wbad-function-cast -Wc++-compat -Wcast-align")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings")
- # gcc automatically inlines based on the optimization level
- # this is just a failsafe
- set (H5_CFLAGS0 "${H5_CFLAGS0} -finline-functions")
+ endif()
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ # 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")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general")
endif ()
+ # gcc automatically inlines based on the optimization level
+ # this is just a failsafe
+ 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")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general")
+ 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")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn")
- 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")
+ if (_INTEL_WINDOWS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-developer-general")
else ()
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn")
- endif ()
- 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")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/developer-general")
endif ()
+ 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 ()
+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 -Wunsuffixed-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")
- if (HDF5_ENABLE_DEV_WARNINGS)
- set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=const")
- else ()
- set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=const")
- endif ()
+ # 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)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8")
+ else ()
+ 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 ()
- 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")
- else ()
- set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=format")
- endif ()
- endif ()
+ # 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")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
+ 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")
- endif ()
+ # 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")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
+ 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=2 -Wimplicit-fallthrough=5 -Wrestrict")
- endif ()
+ # 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")
- endif ()
+ # 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 ()
-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")
+ list (APPEND HDF5_CMAKE_C_FLAGS "/W3" "/wd4100" "/wd4706" "/wd4127")
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")
- 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 ()
@@ -337,9 +295,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
@@ -364,31 +319,17 @@ MARK_AS_ADVANCED (HDF5_ENABLE_ASSERTS)
set (HDF5_ENABLE_SYMBOLS "OFF" CACHE STRING "Add debug symbols to the library independent of the build mode and optimization level (OFF NO YES)")
set_property (CACHE HDF5_ENABLE_SYMBOLS PROPERTY STRINGS OFF NO YES)
if (HDF5_ENABLE_SYMBOLS MATCHES "YES")
- if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
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")
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS)
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)
@@ -398,10 +339,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)
@@ -411,9 +349,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..84b3ebe
--- /dev/null
+++ b/config/cmake/HDFFortranCompilerFlags.cmake
@@ -0,0 +1,125 @@
+#
+# 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)
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-gfort-5")
+ endif ()
+ 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 "/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.md.cmake.in
index b29d50b..b60e729 100644
--- a/config/cmake/README.txt.cmake.in
+++ b/config/cmake/README.md.cmake.in
@@ -9,14 +9,26 @@ It was built with the following options:
-- @LIB_TYPE@ C/C++/Fortran libraries
-- SZIP (encoder enabled) and ZLIB
-- @LIB_TYPE@ HDF5 tools
- -- Java
+ -- Java @Java_VERSION@
The contents of this directory are:
COPYING - Copyright notice
- README.txt - This file
+ README.md - 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/Copyright.txt
+
+
Installation
===========================================================================
1. Execute @HDF5_PACKAGE_NAME@-@HDF5_PACKAGE_VERSION@-@BINARY_SYSTEM_NAME@.@BINARY_INSTALL_ENDING@
@@ -28,7 +40,8 @@ After Installation
The examples folder, HDF5Examples, located in the
HDF5 install folder, can be built and tested with CMake and the supplied
HDF5_Examples.cmake file. The HDF5_Examples.cmake expects HDF5 to have
-been installed in the default location with above compilers. Also, the CMake
+been installed in the default location with above compilers (see the
+libhdf5.settings file in the lib install folder). Also, the CMake
utility should be installed.
To test the installation with the examples;
@@ -62,6 +75,6 @@ For more information see USING_CMake_Examples.txt in the install folder.
===========================================================================
Documentation for this release can be found at the following URL:
- https://portal.hdfgroup.org/display/support
+ https://portal.hdfgroup.org/display/HDF5/HDF5
Bugs should be reported to help@hdfgroup.org.
diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake
index 8efee11..2351ce8 100644
--- a/config/cmake/UseJava.cmake
+++ b/config/cmake/UseJava.cmake
@@ -4,369 +4,516 @@
UseJava
-------
-Use Module for Java
-
-This file provides functions for Java. It is assumed that
+This file provides support for ``Java``. It is assumed that
:module:`FindJava` has already been loaded. See :module:`FindJava` for
-information on how to load Java into your CMake project.
+information on how to load Java into your ``CMake`` project.
+
+Synopsis
+^^^^^^^^
+
+.. parsed-literal::
+
+ `Creating and Installing JARS`_
+ `add_jar`_ (<target_name> [SOURCES] <source1> [<source2>...] ...)
+ `install_jar`_ (<target_name> DESTINATION <destination> [COMPONENT <component>])
+ `install_jni_symlink`_ (<target_name> DESTINATION <destination> [COMPONENT <component>])
+
+ `Header Generation`_
+ `create_javah`_ ((TARGET <target> | GENERATED_FILES <VAR>) CLASSES <class>... ...)
+
+ `Exporting JAR Targets`_
+ `install_jar_exports`_ (TARGETS <jars>... FILE <filename> DESTINATION <destination> ...)
+ `export_jars`_ (TARGETS <jars>... [NAMESPACE <namespace>] FILE <filename>)
+
+ `Finding JARs`_
+ `find_jar`_ (<VAR> NAMES <name1> [<name2>...] [PATHS <path1> [<path2>... ENV <var>]] ...)
+
+ `Creating Java Documentation`_
+ `create_javadoc`_ (<VAR> (PACKAGES <pkg1> [<pkg2>...] | FILES <file1> [<file2>...]) ...)
Creating And Installing JARs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. code-block:: cmake
+.. _add_jar:
- add_jar(<target_name>
- [SOURCES] <source1> [<source2>...] [<resource1>...]
- [INCLUDE_JARS <jar1> [<jar2>...]]
- [ENTRY_POINT <entry>]
- [VERSION <version>]
- [OUTPUT_NAME <name>]
- [OUTPUT_DIR <dir>]
- [GENERATE_NATIVE_HEADERS <target> [DESTINATION <dir>]]
- )
+.. command:: add_jar
-This command creates a ``<target_name>.jar``. It compiles the given
-``<source>`` files and adds the given ``<resource>`` files to
-the jar file. Source files can be java files or listing files
-(prefixed by ``@``). If only resource files are given then just a jar file
-is created. The list of ``INCLUDE_JARS`` are added to the classpath when
-compiling the java sources and also to the dependencies of the target.
-``INCLUDE_JARS`` also accepts other target names created by ``add_jar()``.
-For backwards compatibility, jar files listed as sources are ignored (as
-they have been since the first version of this module).
+ Creates a jar file containing java objects and, optionally, resources::
-The default ``OUTPUT_DIR`` can also be changed by setting the variable
-``CMAKE_JAVA_TARGET_OUTPUT_DIR``.
+ add_jar(<target_name>
+ [SOURCES] <source1> [<source2>...] [<resource1>...]
+ [INCLUDE_JARS <jar1> [<jar2>...]]
+ [ENTRY_POINT <entry>]
+ [VERSION <version>]
+ [MANIFEST <manifest>]
+ [OUTPUT_NAME <name>]
+ [OUTPUT_DIR <dir>]
+ [GENERATE_NATIVE_HEADERS <target>
+ [DESTINATION (<dir>|INSTALL <dir> [BUILD <dir>])]]
+ )
-Optionally, using option ``GENERATE_NATIVE_HEADERS``, native header files can
-be generated for methods declared as native. These files provide the
-connective glue that allow your Java and C code to interact. An INTERFACE
-target will be created for an easy usage of generated files. Sub-option
-``DESTINATION`` can be used to specify the output directory for generated
-header files.
+ This command creates a ``<target_name>.jar``. It compiles the given
+ ``<source>`` files and adds the given ``<resource>`` files to
+ the jar file. Source files can be java files or listing files
+ (prefixed by ``@``). If only resource files are given then just a jar file
+ is created.
-``GENERATE_NATIVE_HEADERS`` option requires, at least, version 1.8 of the JDK.
+ ``SOURCES``
+ Compiles the specified source files and adds the result in the jar file.
-The ``add_jar()`` function sets the following target properties on
-``<target_name>``:
+ .. versionadded:: 3.4
+ Support for response files, prefixed by ``@``.
-``INSTALL_FILES``
- The files which should be installed. This is used by ``install_jar()``.
-``JNI_SYMLINK``
- The JNI symlink which should be installed. This is used by
- ``install_jni_symlink()``.
-``JAR_FILE``
- The location of the jar file so that you can include it.
-``CLASSDIR``
- The directory where the class files can be found. For example to use them
- with ``javah``.
+ ``INCLUDE_JARS``
+ The list of jars are added to the classpath when compiling the java sources
+ and also to the dependencies of the target. ``INCLUDE_JARS`` also accepts
+ other target names created by ``add_jar()``. For backwards compatibility,
+ jar files listed as sources are ignored (as they have been since the first
+ version of this module).
-.. code-block:: cmake
+ ``ENTRY_POINT``
+ Defines an entry point in the jar file.
- install_jar(<target_name> <destination>)
- install_jar(<target_name> DESTINATION <destination> [COMPONENT <component>])
+ ``VERSION``
+ Adds a version to the target output name.
-This command installs the ``<target_name>`` files to the given
-``<destination>``. It should be called in the same scope as ``add_jar()`` or
-it will fail.
+ The following example will create a jar file with the name
+ ``shibboleet-1.2.0.jar`` and will create a symlink ``shibboleet.jar``
+ pointing to the jar with the version information.
-The ``install_jar()`` function sets the ``INSTALL_DESTINATION`` target
-property on jars so installed. This property holds the ``<destination>`` as
-described above, and is used by ``install_jar_exports()``. You can get this
-information with :command:`get_property` and the ``INSTALL_DESTINATION``
-property key.
+ .. code-block:: cmake
-.. code-block:: cmake
+ add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
- install_jni_symlink(<target_name> <destination>)
- install_jni_symlink(<target_name> DESTINATION <destination> [COMPONENT <component>])
+ ``MANIFEST``
+ Defines a custom manifest for the jar.
-This command installs the ``<target_name>`` JNI symlinks to the given
-``<destination>``. It should be called in the same scope as ``add_jar()`` or
-it will fail.
+ ``OUTPUT_NAME``
+ Specify a different output name for the target.
-.. code-block:: cmake
+ ``OUTPUT_DIR``
+ Sets the directory where the jar file will be generated. If not specified,
+ :variable:`CMAKE_CURRENT_BINARY_DIR` is used as the output directory.
- install_jar_exports(TARGETS <jars>...
- [NAMESPACE <namespace>]
- FILE <filename>
- DESTINATION <destination> [COMPONENT <component>])
+ ``GENERATE_NATIVE_HEADERS``
+ .. versionadded:: 3.11
-This command installs a target export file ``<filename>`` for the named jar
-targets to the given ``<destination>`` directory. Its function is similar to
-that of :command:`install(EXPORTS)`.
+ Generates native header files for methods declared as native. These files
+ provide the connective glue that allow your Java and C code to interact.
+ An INTERFACE target will be created for an easy usage of generated files.
+ Sub-option ``DESTINATION`` can be used to specify the output directory for
+ generated header files.
-.. code-block:: cmake
+ This option requires, at least, version 1.8 of the JDK.
- export_jars(TARGETS <jars>...
- [NAMESPACE <namespace>]
- FILE <filename>)
+ For an optimum usage of this option, it is recommended to include module
+ JNI before any call to ``add_jar()``. The produced target for native
+ headers can then be used to compile C/C++ sources with the
+ :command:`target_link_libraries` command.
-This command writes a target export file ``<filename>`` for the named ``<jars>``
-targets. Its function is similar to that of :command:`export`.
+ .. code-block:: cmake
+ find_package(JNI)
+ add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native)
+ add_library(bar bar.cpp)
+ target_link_libraries(bar PRIVATE foo-native)
-Examples
-""""""""
+ .. versionadded:: 3.20
+ ``DESTINATION`` sub-option now supports the possibility to specify
+ different output directories for ``BUILD`` and ``INSTALL`` steps. If
+ ``BUILD`` directory is not specified, a default directory will be used.
-To add compile flags to the target you can set these flags with the following
-variable:
+ To export the interface target generated by ``GENERATE_NATIVE_HEADERS``
+ option, sub-option ``INSTALL`` of ``DESTINATION`` is required:
-.. code-block:: cmake
+ .. code-block:: cmake
- set(CMAKE_JAVA_COMPILE_FLAGS -nowarn)
+ add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native
+ DESTINATION INSTALL include)
+ install(TARGETS foo-native EXPORT native)
+ install(DIRECTORY "$<TARGET_PROPERTY:foo-native,NATIVE_HEADERS_DIRECTORY>/"
+ DESTINATION include)
+ install(EXPORT native DESTINATION /to/export NAMESPACE foo)
+ Some variables can be set to customize the behavior of ``add_jar()`` as well
+ as the java compiler:
-To add a path or a jar file to the class path you can do this with the
-``CMAKE_JAVA_INCLUDE_PATH`` variable.
+ ``CMAKE_JAVA_COMPILE_FLAGS``
+ Specify additional flags to java compiler.
-.. code-block:: cmake
+ ``CMAKE_JAVA_INCLUDE_PATH``
+ Specify additional paths to the class path.
- set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar)
+ ``CMAKE_JNI_TARGET``
+ If the target is a JNI library, sets this boolean variable to ``TRUE`` to
+ enable creation of a JNI symbolic link (see also
+ :ref:`install_jni_symlink() <install_jni_symlink>`).
-To use a different output name for the target you can set it with:
+ ``CMAKE_JAR_CLASSES_PREFIX``
+ If multiple jars should be produced from the same java source filetree,
+ to prevent the accumulation of duplicate class files in subsequent jars,
+ set/reset ``CMAKE_JAR_CLASSES_PREFIX`` prior to calling the ``add_jar()``:
-.. code-block:: cmake
+ .. code-block:: cmake
- add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar)
+ set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
+ add_jar(foo foo.java)
-To use a different output directory than ``CMAKE_CURRENT_BINARY_DIR`` you can
-set it with:
+ set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
+ add_jar(bar bar.java)
-.. code-block:: cmake
+ The ``add_jar()`` function sets the following target properties on
+ ``<target_name>``:
- add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
+ ``INSTALL_FILES``
+ The files which should be installed. This is used by
+ :ref:`install_jar() <install_jar>`.
+ ``JNI_SYMLINK``
+ The JNI symlink which should be installed. This is used by
+ :ref:`install_jni_symlink() <install_jni_symlink>`.
+ ``JAR_FILE``
+ The location of the jar file so that you can include it.
+ ``CLASSDIR``
+ The directory where the class files can be found. For example to use them
+ with ``javah``.
+ ``NATIVE_HEADERS_DIRECTORY``
+ .. versionadded:: 3.20
-To define an entry point in your jar you can set it with the ``ENTRY_POINT``
-named argument:
+ The directory where native headers are generated. Defined when option
+ ``GENERATE_NATIVE_HEADERS`` is specified.
-.. code-block:: cmake
+.. _install_jar:
- add_jar(example ENTRY_POINT com/examples/MyProject/Main)
+.. command:: install_jar
-To define a custom manifest for the jar, you can set it with the ``MANIFEST``
-named argument:
+ This command installs the jar file to the given destination::
-.. code-block:: cmake
+ install_jar(<target_name> <destination>)
+ install_jar(<target_name> DESTINATION <destination> [COMPONENT <component>])
- add_jar(example MANIFEST /path/to/manifest)
+ This command installs the ``<target_name>`` file to the given
+ ``<destination>``. It should be called in the same scope as
+ :ref:`add_jar() <add_jar>` or it will fail.
-To add a version to the target output name you can set it using the ``VERSION``
-named argument to ``add_jar()``. The following example will create a jar file
-with the name ``shibboleet-1.0.0.jar`` and will create a symlink
-``shibboleet.jar`` pointing to the jar with the version information.
+ .. versionadded:: 3.4
+ The second signature with ``DESTINATION`` and ``COMPONENT`` options.
-.. code-block:: cmake
+ ``DESTINATION``
+ Specify the directory on disk to which a file will be installed.
- add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
+ ``COMPONENT``
+ Specify an installation component name with which the install rule is
+ associated, such as "runtime" or "development".
-If the target is a JNI library, utilize the following commands to
-create a JNI symbolic link:
+ The ``install_jar()`` command sets the following target properties
+ on ``<target_name>``:
-.. code-block:: cmake
+ ``INSTALL_DESTINATION``
+ Holds the ``<destination>`` as described above, and is used by
+ :ref:`install_jar_exports() <install_jar_exports>`.
- set(CMAKE_JNI_TARGET TRUE)
- add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
- install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
- install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
+.. _install_jni_symlink:
-If a single target needs to produce more than one jar from its
-java source code, to prevent the accumulation of duplicate class
-files in subsequent jars, set/reset ``CMAKE_JAR_CLASSES_PREFIX`` prior
-to calling the ``add_jar()`` function:
+.. command:: install_jni_symlink
-.. code-block:: cmake
+ Installs JNI symlinks for target generated by :ref:`add_jar() <add_jar>`::
- set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
- add_jar(foo foo.java)
+ install_jni_symlink(<target_name> <destination>)
+ install_jni_symlink(<target_name> DESTINATION <destination> [COMPONENT <component>])
- set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
- add_jar(bar bar.java)
+ This command installs the ``<target_name>`` JNI symlinks to the given
+ ``<destination>``. It should be called in the same scope as
+ :ref:`add_jar() <add_jar>` or it will fail.
-For an optimum usage of option ``GENERATE_NATIVE_HEADERS``, it is recommended to
-include module JNI before any call to ``add_jar()``. The produced target for
-native headers can then be used to compile C/C++ sources with the
-:command:`target_link_libraries` command.
+ .. versionadded:: 3.4
+ The second signature with ``DESTINATION`` and ``COMPONENT`` options.
-.. code-block:: cmake
+ ``DESTINATION``
+ Specify the directory on disk to which a file will be installed.
- find_package(JNI)
- add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native)
- add_library(bar bar.cpp)
- target_link_libraries(bar PRIVATE foo-native)
+ ``COMPONENT``
+ Specify an installation component name with which the install rule is
+ associated, such as "runtime" or "development".
+ Utilize the following commands to create a JNI symbolic link:
-Finding JARs
-^^^^^^^^^^^^
+ .. code-block:: cmake
-.. code-block:: cmake
-
- find_jar(<VAR>
- <name> | NAMES <name1> [<name2>...]
- [PATHS <path1> [<path2>... ENV <var>]]
- [VERSIONS <version1> [<version2>]]
- [DOC "cache documentation string"]
- )
-
-This command is used to find a full path to the named jar. A cache
-entry named by ``<VAR>`` is created to store the result of this command.
-If the full path to a jar is found the result is stored in the
-variable and the search will not repeated unless the variable is
-cleared. If nothing is found, the result will be ``<VAR>-NOTFOUND``, and
-the search will be attempted again next time ``find_jar()`` is invoked with
-the same variable. The name of the full path to a file that is
-searched for is specified by the names listed after ``NAMES`` argument.
-Additional search locations can be specified after the ``PATHS`` argument.
-If you require special a version of a jar file you can specify it with
-the ``VERSIONS`` argument. The argument after ``DOC`` will be used for the
-documentation string in the cache.
-
-
-Javadoc
-^^^^^^^
-
-The ``create_javadoc()`` command can be used to create java documentation
-based on files or packages. For more details please read the javadoc manpage.
-
-There are two main signatures for ``create_javadoc()``. The first signature
-works with package names on a path with source files.
-
-.. code-block:: cmake
-
- create_javadoc(<VAR>
- PACKAGES <pkg1> [<pkg2>...]
- [SOURCEPATH <sourcepath>]
- [CLASSPATH <classpath>]
- [INSTALLPATH <install path>]
- [DOCTITLE "the documentation title"]
- [WINDOWTITLE "the title of the document"]
- [AUTHOR TRUE|FALSE]
- [USE TRUE|FALSE]
- [VERSION TRUE|FALSE]
- )
+ set(CMAKE_JNI_TARGET TRUE)
+ add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
+ install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
+ install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
+
+Header Generation
+^^^^^^^^^^^^^^^^^
+
+.. _create_javah:
+
+.. command:: create_javah
-For example:
-
-.. code-block:: cmake
-
- create_javadoc(my_example_doc
- PACKAGES com.example.foo com.example.bar
- SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
- CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
- WINDOWTITLE "My example"
- DOCTITLE "<h1>My example</h1>"
- AUTHOR TRUE
- USE TRUE
- VERSION TRUE
- )
-
-The second signature for ``create_javadoc()`` works on a given list of
-files.
-
-.. code-block:: cmake
-
- create_javadoc(<VAR>
- FILES <file1> [<file2>...]
- [CLASSPATH <classpath>]
- [INSTALLPATH <install path>]
- [DOCTITLE "the documentation title"]
- [WINDOWTITLE "the title of the document"]
- [AUTHOR TRUE|FALSE]
- [USE TRUE|FALSE]
- [VERSION TRUE|FALSE]
+ .. versionadded:: 3.4
+
+ Generates C header files for java classes::
+
+ create_javah(TARGET <target> | GENERATED_FILES <VAR>
+ CLASSES <class>...
+ [CLASSPATH <classpath>...]
+ [DEPENDS <depend>...]
+ [OUTPUT_NAME <path>|OUTPUT_DIR <path>]
)
-For example:
+ .. deprecated:: 3.11
+ This command will no longer be supported starting with version 10 of the JDK
+ due to the `suppression of javah tool <http://openjdk.java.net/jeps/313>`_.
+ The :ref:`add_jar(GENERATE_NATIVE_HEADERS) <add_jar>` command should be
+ used instead.
+
+ Create C header files from java classes. These files provide the connective
+ glue that allow your Java and C code to interact.
+
+ There are two main signatures for ``create_javah()``. The first signature
+ returns generated files through variable specified by the ``GENERATED_FILES``
+ option. For example:
-.. code-block:: cmake
+ .. code-block:: cmake
- create_javadoc(my_example_doc
- FILES ${example_SRCS}
- CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
- WINDOWTITLE "My example"
- DOCTITLE "<h1>My example</h1>"
- AUTHOR TRUE
- USE TRUE
- VERSION TRUE
- )
+ create_javah(GENERATED_FILES files_headers
+ CLASSES org.cmake.HelloWorld
+ CLASSPATH hello.jar
+ )
-Both signatures share most of the options. These options are the same
-as what you can find in the javadoc manpage. Please look at the
-manpage for ``CLASSPATH``, ``DOCTITLE``, ``WINDOWTITLE``, ``AUTHOR``, ``USE``
-and ``VERSION``.
+ The second signature for ``create_javah()`` creates a target which
+ encapsulates header files generation. E.g.
-If you don't set the ``INSTALLPATH``, then by default the documentation will
-be installed to :
+ .. code-block:: cmake
-::
+ create_javah(TARGET target_headers
+ CLASSES org.cmake.HelloWorld
+ CLASSPATH hello.jar
+ )
- ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>
+ Both signatures share same options.
+ ``CLASSES``
+ Specifies Java classes used to generate headers.
-Header Generation
-^^^^^^^^^^^^^^^^^
+ ``CLASSPATH``
+ Specifies various paths to look up classes. Here ``.class`` files, jar
+ files or targets created by command add_jar can be used.
+
+ ``DEPENDS``
+ Targets on which the javah target depends.
+
+ ``OUTPUT_NAME``
+ Concatenates the resulting header files for all the classes listed by
+ option ``CLASSES`` into ``<path>``. Same behavior as option ``-o`` of
+ ``javah`` tool.
+
+ ``OUTPUT_DIR``
+ Sets the directory where the header files will be generated. Same behavior
+ as option ``-d`` of ``javah`` tool. If not specified,
+ :variable:`CMAKE_CURRENT_BINARY_DIR` is used as the output directory.
+
+Exporting JAR Targets
+^^^^^^^^^^^^^^^^^^^^^
+
+.. _install_jar_exports:
+
+.. command:: install_jar_exports
+
+ .. versionadded:: 3.7
+
+ Installs a target export file::
-.. code-block:: cmake
+ install_jar_exports(TARGETS <jars>...
+ [NAMESPACE <namespace>]
+ FILE <filename>
+ DESTINATION <destination> [COMPONENT <component>])
- create_javah(TARGET <target> | GENERATED_FILES <VAR>
- CLASSES <class>...
- [CLASSPATH <classpath>...]
- [DEPENDS <depend>...]
- [OUTPUT_NAME <path>|OUTPUT_DIR <path>]
- )
+ This command installs a target export file ``<filename>`` for the named jar
+ targets to the given ``<destination>`` directory. Its function is similar to
+ that of :command:`install(EXPORT)`.
-Create C header files from java classes. These files provide the connective glue
-that allow your Java and C code to interact.
+ ``TARGETS``
+ List of targets created by :ref:`add_jar() <add_jar>` command.
-.. deprecated:: 3.11
+ ``NAMESPACE``
+ .. versionadded:: 3.9
-.. note::
+ The ``<namespace>`` value will be prepend to the target names as they are
+ written to the import file.
- This command will no longer be supported starting with version 10 of the JDK
- due to the `suppression of javah tool <http://openjdk.java.net/jeps/313>`_.
- The ``add_jar(GENERATE_NATIVE_HEADERS)`` command should be used instead.
+ ``FILE``
+ Specify name of the export file.
-There are two main signatures for ``create_javah()``. The first signature
-returns generated files through variable specified by the ``GENERATED_FILES``
-option. For example:
-.. code-block:: cmake
+ ``DESTINATION``
+ Specify the directory on disk to which a file will be installed.
- create_javah(GENERATED_FILES files_headers
- CLASSES org.cmake.HelloWorld
- CLASSPATH hello.jar
- )
+ ``COMPONENT``
+ Specify an installation component name with which the install rule is
+ associated, such as "runtime" or "development".
-The second signature for ``create_javah()`` creates a target which encapsulates
-header files generation. E.g.
+.. _export_jars:
-.. code-block:: cmake
+.. command:: export_jars
- create_javah(TARGET target_headers
- CLASSES org.cmake.HelloWorld
- CLASSPATH hello.jar
- )
+ .. versionadded:: 3.7
-Both signatures share same options.
+ Writes a target export file::
-``CLASSES <class>...``
- Specifies Java classes used to generate headers.
+ export_jars(TARGETS <jars>...
+ [NAMESPACE <namespace>]
+ FILE <filename>)
-``CLASSPATH <classpath>...``
- Specifies various paths to look up classes. Here .class files, jar files or
- targets created by command add_jar can be used.
+ This command writes a target export file ``<filename>`` for the named ``<jars>``
+ targets. Its function is similar to that of :command:`export`.
-``DEPENDS <depend>...``
- Targets on which the javah target depends.
+ ``TARGETS``
+ List of targets created by :ref:`add_jar() <add_jar>` command.
-``OUTPUT_NAME <path>``
- Concatenates the resulting header files for all the classes listed by option
- ``CLASSES`` into ``<path>``. Same behavior as option ``-o`` of javah tool.
+ ``NAMESPACE``
+ .. versionadded:: 3.9
-``OUTPUT_DIR <path>``
- Sets the directory where the header files will be generated. Same behavior
- as option ``-d`` of javah tool. If not specified,
- :variable:`CMAKE_CURRENT_BINARY_DIR` is used as the output directory.
+ The ``<namespace>`` value will be prepend to the target names as they are
+ written to the import file.
+
+ ``FILE``
+ Specify name of the export file.
+
+Finding JARs
+^^^^^^^^^^^^
+
+.. _find_jar:
+
+.. command:: find_jar
+
+ Finds the specified jar file::
+
+ find_jar(<VAR>
+ <name> | NAMES <name1> [<name2>...]
+ [PATHS <path1> [<path2>... ENV <var>]]
+ [VERSIONS <version1> [<version2>]]
+ [DOC "cache documentation string"]
+ )
+
+ This command is used to find a full path to the named jar. A cache
+ entry named by ``<VAR>`` is created to store the result of this command.
+ If the full path to a jar is found the result is stored in the
+ variable and the search will not repeated unless the variable is
+ cleared. If nothing is found, the result will be ``<VAR>-NOTFOUND``, and
+ the search will be attempted again next time ``find_jar()`` is invoked with
+ the same variable.
+
+ ``NAMES``
+ Specify one or more possible names for the jar file.
+
+ ``PATHS``
+ Specify directories to search in addition to the default locations.
+ The ``ENV`` var sub-option reads paths from a system environment variable.
+
+ ``VERSIONS``
+ Specify jar versions.
+
+ ``DOC``
+ Specify the documentation string for the ``<VAR>`` cache entry.
+
+Creating Java Documentation
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. _create_javadoc:
+
+.. command:: create_javadoc
+
+ Creates java documentation based on files and packages::
+
+ create_javadoc(<VAR>
+ (PACKAGES <pkg1> [<pkg2>...] | FILES <file1> [<file2>...])
+ [SOURCEPATH <sourcepath>]
+ [CLASSPATH <classpath>]
+ [INSTALLPATH <install path>]
+ [DOCTITLE <the documentation title>]
+ [WINDOWTITLE <the title of the document>]
+ [AUTHOR (TRUE|FALSE)]
+ [USE (TRUE|FALSE)]
+ [VERSION (TRUE|FALSE)]
+ )
+
+ The ``create_javadoc()`` command can be used to create java documentation.
+ There are two main signatures for ``create_javadoc()``.
+
+ The first signature works with package names on a path with source files:
+
+ .. code-block:: cmake
+
+ create_javadoc(my_example_doc
+ PACKAGES com.example.foo com.example.bar
+ SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
+ CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
+ WINDOWTITLE "My example"
+ DOCTITLE "<h1>My example</h1>"
+ AUTHOR TRUE
+ USE TRUE
+ VERSION TRUE
+ )
+
+ The second signature for ``create_javadoc()`` works on a given list of files:
+
+ .. code-block:: cmake
+
+ create_javadoc(my_example_doc
+ FILES java/A.java java/B.java
+ CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
+ WINDOWTITLE "My example"
+ DOCTITLE "<h1>My example</h1>"
+ AUTHOR TRUE
+ USE TRUE
+ VERSION TRUE
+ )
+
+ Both signatures share most of the options. For more details please read the
+ javadoc manpage.
+
+ ``PACKAGES``
+ Specify java packages.
+
+ ``FILES``
+ Specify java source files. If relative paths are specified, they are
+ relative to :variable:`CMAKE_CURRENT_SOURCE_DIR`.
+
+ ``SOURCEPATH``
+ Specify the directory where to look for packages. By default,
+ :variable:`CMAKE_CURRENT_SOURCE_DIR` directory is used.
+
+ ``CLASSPATH``
+ Specify where to find user class files. Same behavior as option
+ ``-classpath`` of ``javadoc`` tool.
+
+ ``INSTALLPATH``
+ Specify where to install the java documentation. If you specified, the
+ documentation will be installed to
+ ``${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>``.
+
+ ``DOCTITLE``
+ Specify the title to place near the top of the overview summary file.
+ Same behavior as option ``-doctitle`` of ``javadoc`` tool.
+
+ ``WINDOWTITLE``
+ Specify the title to be placed in the HTML ``<title>`` tag. Same behavior
+ as option ``-windowtitle`` of ``javadoc`` tool.
+
+ ``AUTHOR``
+ When value ``TRUE`` is specified, includes the ``@author`` text in the
+ generated docs. Same behavior as option ``-author`` of ``javadoc`` tool.
+
+ ``USE``
+ When value ``TRUE`` is specified, creates class and package usage pages.
+ Includes one Use page for each documented class and package. Same behavior
+ as option ``-use`` of ``javadoc`` tool.
+
+ ``VERSION``
+ When value ``TRUE`` is specified, includes the version text in the
+ generated docs. Same behavior as option ``-version`` of ``javadoc`` tool.
#]=======================================================================]
include(CMakeParseArguments)
@@ -378,7 +525,8 @@ function (__java_copy_file src dest comment)
ARGS ${src}
${dest}
DEPENDS ${src}
- COMMENT ${comment})
+ COMMENT ${comment}
+ )
endfunction ()
function(__java_lcat VAR)
@@ -409,6 +557,12 @@ set(_JAVA_EXPORT_TARGETS_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/javaTargets.cmake.in)
set(_JAVA_CLASS_FILELIST_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaClassFilelist.cmake)
set(_JAVA_SYMLINK_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaSymlinks.cmake)
+if (CMAKE_HOST_WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
+ set(_UseJava_PATH_SEP "$<SEMICOLON>")
+else ()
+ set(_UseJava_PATH_SEP ":")
+endif()
+
function(add_jar _TARGET_NAME)
cmake_parse_arguments(_add_jar
@@ -440,6 +594,9 @@ function(add_jar _TARGET_NAME)
set(_add_jar_ENTRY_POINT "${CMAKE_JAVA_JAR_ENTRY_POINT}")
endif()
+ # This *should* still work if <resources1>... are included without a
+ # named RESOURCES argument. In that case, the old behavior of potentially
+ # misplacing the within the Jar will behave as previously (incorrectly)
set(_JAVA_SOURCE_FILES ${_add_jar_SOURCES} ${_add_jar_UNPARSED_ARGUMENTS})
if (NOT DEFINED _add_jar_OUTPUT_DIR)
@@ -467,7 +624,10 @@ function(add_jar _TARGET_NAME)
if (Java_VERSION VERSION_LESS 1.8)
message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS is not supported with this version of Java.")
endif()
- cmake_parse_arguments (_add_jar_GENERATE_NATIVE_HEADERS "" "DESTINATION" "" ${_add_jar_GENERATE_NATIVE_HEADERS})
+
+ unset (_GENERATE_NATIVE_HEADERS_OUTPUT_DESC)
+
+ cmake_parse_arguments (_add_jar_GENERATE_NATIVE_HEADERS "" "" "DESTINATION" ${_add_jar_GENERATE_NATIVE_HEADERS})
if (NOT _add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS)
message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS: missing required argument.")
endif()
@@ -478,11 +638,30 @@ function(add_jar _TARGET_NAME)
endif()
if (NOT _add_jar_GENERATE_NATIVE_HEADERS_DESTINATION)
set (_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir/native_headers")
+ else()
+ list (LENGTH _add_jar_GENERATE_NATIVE_HEADERS_DESTINATION length)
+ if (NOT length EQUAL 1)
+ cmake_parse_arguments (_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION "" "BUILD;INSTALL" "" "${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION}")
+ if (_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_UNPARSED_ARGUMENTS)
+ message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS: DESTINATION: ${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_UNPARSED_ARGUMENTS}: unexpected argument(s).")
+ endif()
+ if (NOT _add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_INSTALL)
+ message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS: DESTINATION: INSTALL sub-option is required.")
+ endif()
+ if (NOT _add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_BUILD)
+ set(_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_BUILD "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir/native_headers")
+ endif()
+ set(_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION "${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_BUILD}")
+ set(_GENERATE_NATIVE_HEADERS_OUTPUT_DESC "$<BUILD_INTERFACE:${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_BUILD}>" "$<INSTALL_INTERFACE:${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_INSTALL}>")
+ endif()
endif()
set (_GENERATE_NATIVE_HEADERS_TARGET ${_add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS})
set (_GENERATE_NATIVE_HEADERS_OUTPUT_DIR "${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION}")
set (_GENERATE_NATIVE_HEADERS -h "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}")
+ if(NOT _GENERATE_NATIVE_HEADERS_OUTPUT_DESC)
+ set(_GENERATE_NATIVE_HEADERS_OUTPUT_DESC "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}")
+ endif()
endif()
if (LIBRARY_OUTPUT_PATH)
@@ -498,14 +677,8 @@ function(add_jar _TARGET_NAME)
${CMAKE_JAVA_LIBRARY_OUTPUT_PATH}
)
- if (CMAKE_HOST_WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
- set(CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
- else ()
- set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
- endif()
-
foreach (JAVA_INCLUDE_DIR IN LISTS CMAKE_JAVA_INCLUDE_PATH)
- string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
+ string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${_UseJava_PATH_SEP}${JAVA_INCLUDE_DIR}")
endforeach()
set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
@@ -577,7 +750,7 @@ function(add_jar _TARGET_NAME)
if (TARGET ${_JAVA_INCLUDE_JAR})
get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE)
if (_JAVA_JAR_PATH)
- string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}")
+ string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${_UseJava_PATH_SEP}${_JAVA_JAR_PATH}")
list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH})
list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR})
list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_JAR_PATH})
@@ -585,7 +758,7 @@ function(add_jar _TARGET_NAME)
message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar")
endif ()
else ()
- string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}")
+ string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${_UseJava_PATH_SEP}${_JAVA_INCLUDE_JAR}")
list(APPEND CMAKE_JAVA_INCLUDE_PATH "${_JAVA_INCLUDE_JAR}")
list(APPEND _JAVA_DEPENDS "${_JAVA_INCLUDE_JAR}")
list(APPEND _JAVA_COMPILE_DEPENDS "${_JAVA_INCLUDE_JAR}")
@@ -627,14 +800,14 @@ function(add_jar _TARGET_NAME)
OUTPUT ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
COMMAND ${CMAKE_COMMAND}
-DCMAKE_JAVA_CLASS_OUTPUT_PATH=${CMAKE_JAVA_CLASS_OUTPUT_PATH}
- -DCMAKE_JAR_CLASSES_PREFIX="${CMAKE_JAR_CLASSES_PREFIX}"
+ -DCMAKE_JAR_CLASSES_PREFIX=${CMAKE_JAR_CLASSES_PREFIX}
-P ${_JAVA_CLASS_FILELIST_SCRIPT}
DEPENDS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
else ()
# create an empty java_class_filelist
- if (NOT EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist")
+ if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
endif()
endif ()
@@ -731,8 +904,9 @@ function(add_jar _TARGET_NAME)
# create an INTERFACE library encapsulating include directory for generated headers
add_library (${_GENERATE_NATIVE_HEADERS_TARGET} INTERFACE)
target_include_directories (${_GENERATE_NATIVE_HEADERS_TARGET} INTERFACE
- "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}"
+ "${_GENERATE_NATIVE_HEADERS_OUTPUT_DESC}"
${JNI_INCLUDE_DIRS})
+ set_property(TARGET ${_GENERATE_NATIVE_HEADERS_TARGET} PROPERTY NATIVE_HEADERS_DIRECTORY "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}")
# this INTERFACE library depends on jar generation
add_dependencies (${_GENERATE_NATIVE_HEADERS_TARGET} ${_TARGET_NAME})
@@ -1238,68 +1412,45 @@ function(create_javadoc _target)
set(_javadoc_options -d ${_javadoc_builddir})
if (_javadoc_sourcepath)
- set(_start TRUE)
- foreach(_path IN LISTS _javadoc_sourcepath)
- if (_start)
- set(_sourcepath ${_path})
- set(_start FALSE)
- else ()
- set(_sourcepath ${_sourcepath}:${_path})
- endif ()
- endforeach()
- set(_javadoc_options ${_javadoc_options} -sourcepath ${_sourcepath})
+ list(JOIN _javadoc_sourcepath "${_UseJava_PATH_SEP}" _javadoc_sourcepath)
+ list(APPEND _javadoc_options -sourcepath "\"${_javadoc_sourcepath}\"")
endif ()
if (_javadoc_overview)
- set(_start TRUE)
- foreach(_path IN LISTS _javadoc_overview)
- if (_start)
- set(_overview ${_path})
- set(_start FALSE)
- else ()
- set(_overview ${_overview}:${_path})
- endif ()
- endforeach ()
- set(_javadoc_options ${_javadoc_options} -overview ${_overview})
+ list(JOIN _javadoc_overview "${_UseJava_PATH_SEP}" _javadoc_overview)
+ list(APPEND _javadoc_options -overview "\"${_javadoc_overview}\"")
endif ()
if (_javadoc_classpath)
- set(_start TRUE)
- foreach(_path IN LISTS _javadoc_classpath)
- if (_start)
- set(_classpath ${_path})
- set(_start FALSE)
- else ()
- set(_classpath ${_classpath}:${_path})
- endif ()
- endforeach()
- set(_javadoc_options ${_javadoc_options} -classpath "${_classpath}")
+ list(JOIN _javadoc_classpath "${_UseJava_PATH_SEP}" _javadoc_classpath)
+ list(APPEND _javadoc_options -classpath "\"${_javadoc_classpath}\"")
endif ()
if (_javadoc_doctitle)
- set(_javadoc_options ${_javadoc_options} -doctitle '${_javadoc_doctitle}')
+ list(APPEND _javadoc_options -doctitle '${_javadoc_doctitle}')
endif ()
if (_javadoc_windowtitle)
- set(_javadoc_options ${_javadoc_options} -windowtitle '${_javadoc_windowtitle}')
+ list(APPEND _javadoc_options -windowtitle '${_javadoc_windowtitle}')
endif ()
if (_javadoc_author)
- set(_javadoc_options ${_javadoc_options} -author)
+ list(APPEND _javadoc_options -author)
endif ()
if (_javadoc_use)
- set(_javadoc_options ${_javadoc_options} -use)
+ list(APPEND _javadoc_options -use)
endif ()
if (_javadoc_version)
- set(_javadoc_options ${_javadoc_options} -version)
+ list(APPEND _javadoc_options -version)
endif ()
add_custom_target(${_target}_javadoc ALL
- COMMAND ${Java_JAVADOC_EXECUTABLE} ${_javadoc_options}
- ${_javadoc_files}
- ${_javadoc_packages}
+ COMMAND ${Java_JAVADOC_EXECUTABLE}
+ ${_javadoc_options}
+ ${_javadoc_files}
+ ${_javadoc_packages}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
@@ -1335,11 +1486,6 @@ function (create_javah)
endif()
set (_output_files)
- if (WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
- set(_classpath_sep "$<SEMICOLON>")
- else ()
- set(_classpath_sep ":")
- endif()
# handle javah options
set (_javah_options)
@@ -1365,7 +1511,7 @@ function (create_javah)
message(SEND_ERROR "create_javah: CLASSPATH entry ${_path} does not exist.")
endif()
endforeach()
- string (REPLACE ";" "${_classpath_sep}" _classpath "${_classpath}")
+ string (REPLACE ";" "${_UseJava_PATH_SEP}" _classpath "${_classpath}")
list (APPEND _javah_options -classpath "${_classpath}")
endif()
diff --git a/config/cmake/UseJavaClassFilelist.cmake b/config/cmake/UseJavaClassFilelist.cmake
index b98276f..d90ca48 100644
--- a/config/cmake/UseJavaClassFilelist.cmake
+++ b/config/cmake/UseJavaClassFilelist.cmake
@@ -1,17 +1,8 @@
# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details.
-#[=======================================================================[.rst:
-UseJavaClassFilelist
---------------------
-
-
-
-
-
-This script create a list of compiled Java class files to be added to
-a jar file. This avoids including cmake files which get created in
-the binary directory.
-#]=======================================================================]
+# This script creates a list of compiled Java class files to be added to
+# a jar file. This avoids including cmake files which get created in
+# the binary directory.
if (CMAKE_JAVA_CLASS_OUTPUT_PATH)
if (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
diff --git a/config/cmake/UseJavaSymlinks.cmake b/config/cmake/UseJavaSymlinks.cmake
index a4db5c1..cb2e282 100644
--- a/config/cmake/UseJavaSymlinks.cmake
+++ b/config/cmake/UseJavaSymlinks.cmake
@@ -1,15 +1,6 @@
# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details.
-#[=======================================================================[.rst:
-UseJavaSymlinks
----------------
-
-
-
-
-
-Helper script for UseJava.cmake
-#]=======================================================================]
+# Helper script for UseJava.cmake
if (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
if (_JAVA_TARGET_OUTPUT_NAME)
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..221c0c9 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 (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use HDF5_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 (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of HDF5_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 (BLOSC_ZLIB_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/zlib.git" CACHE STRING "Use BLOSC_ZLIB from HDF repo" FORCE)
+set (BLOSC_ZLIB_GIT_BRANCH "master" CACHE STRING "" FORCE)
+
+set (BLOSC_ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use BLOSC_ZLib from compressed file" FORCE)
+
+set (BLOSC_ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of BLOSC_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)
+
+######
+# sz
+######
+
+set (SZ_GIT_URL "https://github.com/disheng222/SZ" CACHE STRING "Use SZ filter from github repository" FORCE)
+set (SZ_GIT_BRANCH "master" CACHE STRING "" FORCE)
+
+set (SZ_TGZ_NAME "szf.tar.gz" CACHE STRING "Use SZ filter from compressed file" FORCE)
+
+set (SZ_PACKAGE_NAME "SZ" CACHE STRING "Name of SZ filter 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
new file mode 100644
index 0000000..4a8dc09
--- /dev/null
+++ b/config/cmake/fileCompareTest.cmake
@@ -0,0 +1,113 @@
+#
+# 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.
+#
+# fileCompareTest.cmake compares two files.
+
+# arguments checking
+if (NOT TEST_FOLDER)
+ message (FATAL_ERROR "Require TEST_FOLDER to be defined")
+endif ()
+if (NOT TEST_ONEFILE)
+ message (FATAL_ERROR "Require TEST_ONEFILE the first file to be defined")
+endif ()
+if (NOT TEST_TWOFILE)
+ message (FATAL_ERROR "Require TEST_TWOFILE the second file to be defined")
+endif ()
+if (NOT TEST_FUNCTION)
+ message (FATAL_ERROR "Require TEST_FUNCTION (LT,LTEQ,EQ,GTEQ,GT) to be defined")
+endif ()
+
+set (TEST_ONE_SIZE 0)
+set (TEST_TWO_SIZE 0)
+set (TEST_ONE_STRING 0)
+set (TEST_TWO_STRING 0)
+set (TEST_ONE_STRING_LEN 0)
+set (TEST_TWO_STRING_LEN 0)
+
+if (TEST_STRINGS STREQUAL "YES")
+ # find the length of the first file
+ #s1=`cat $ufile | wc -c | sed -e 's/ //g'`
+ file (STRINGS ${TEST_FOLDER}/${TEST_ONEFILE} TEST_ONE_STRING)
+ string (LENGTH ${TEST_ONE_STRING} TEST_ONE_STRING_LEN)
+
+ # Get the size of the second file.
+ file (STRINGS ${TEST_FOLDER}/${TEST_TWOFILE} TEST_TWO_STRING)
+ string (LENGTH ${TEST_TWO_STRING} TEST_TWO_STRING_LEN)
+
+ math (EXPR TEST_STRING_SIZE "${TEST_ONE_STRING_LEN} - ${TEST_TWO_STRING_LEN}" )
+
+ # now compare the outputs
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${TEST_FOLDER}/${TEST_ONEFILE} ${TEST_FOLDER}/${TEST_TWOFILE}
+ RESULT_VARIABLE TEST_RESULT
+ )
+
+ 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}")
+ endif ()
+else ()
+ if (CMAKE_VERSION VERSION_LESS "3.14.0")
+ message (FATAL_ERROR "CANNOT get file size, file command SIZE not supported")
+ else ()
+ file (SIZE ${TEST_FOLDER}/${TEST_ONEFILE} TEST_ONE_SIZE)
+ file (SIZE ${TEST_FOLDER}/${TEST_TWOFILE} TEST_TWO_SIZE)
+ if (TEST_FUNCTION MATCHES "LT")
+ if (TEST_ONE_SIZE LESS TEST_TWO_SIZE)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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 ()
+ else ()
+ message (FATAL_ERROR "Failed: Incorrect test size compare command provided.\n${TEST_ERROR}")
+ endif ()
+ endif ()
+endif ()
+
+# everything went fine...
+
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 afb2a5c..35cee4f 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.
#
@@ -38,7 +38,9 @@ set (${HDF5_PACKAGE_NAME}_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
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}_BUILD_HL_TOOLS @HDF5_BUILD_HL_TOOLS@)
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@)
@@ -46,6 +48,7 @@ set (${HDF5_PACKAGE_NAME}_BUILD_SHARED_LIBS @H5_ENABLE_SHARED_LIB@)
set (${HDF5_PACKAGE_NAME}_BUILD_STATIC_LIBS @H5_ENABLE_STATIC_LIB@)
set (${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@)
set (${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES @HDF5_LIBRARIES_TO_EXPORT@)
+set (${HDF5_PACKAGE_NAME}_ARCHITECTURE "@CMAKE_GENERATOR_ARCHITECTURE@")
set (${HDF5_PACKAGE_NAME}_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
set (${HDF5_PACKAGE_NAME}_DEFAULT_API_VERSION "@DEFAULT_API_VERSION@")
set (${HDF5_PACKAGE_NAME}_PARALLEL_FILTERED_WRITES "@PARALLEL_FILTERED_WRITES@")
@@ -65,8 +68,8 @@ endif ()
if (${HDF5_PACKAGE_NAME}_BUILD_JAVA)
set (${HDF5_PACKAGE_NAME}_JAVA_INCLUDE_DIRS
@PACKAGE_CURRENT_BUILD_DIR@/lib/jarhdf5-@HDF5_VERSION_STRING@.jar
- @PACKAGE_CURRENT_BUILD_DIR@/lib/slf4j-api-1.7.25.jar
- @PACKAGE_CURRENT_BUILD_DIR@/lib/slf4j-nop-1.7.25.jar
+ @PACKAGE_CURRENT_BUILD_DIR@/lib/slf4j-api-1.7.33.jar
+ @PACKAGE_CURRENT_BUILD_DIR@/lib/slf4j-nop-1.7.33.jar
)
set (${HDF5_PACKAGE_NAME}_JAVA_LIBRARY "@PACKAGE_CURRENT_BUILD_DIR@/lib")
set (${HDF5_PACKAGE_NAME}_JAVA_LIBRARIES "${${HDF5_PACKAGE_NAME}_JAVA_LIBRARY}")
@@ -110,12 +113,12 @@ set (${HDF5_PACKAGE_NAME}_VERSION_MINOR @HDF5_VERSION_MINOR@)
#-----------------------------------------------------------------------------
if (NOT TARGET "@HDF5_PACKAGE@")
if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS)
- include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
+ include (@PACKAGE_SHARE_INSTALL_DIR@/@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@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
endif ()
- include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
+ include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
endif ()
# Handle default component(static) :
diff --git a/config/cmake/javaTargets.cmake.in b/config/cmake/javaTargets.cmake.in
new file mode 100644
index 0000000..6e14256
--- /dev/null
+++ b/config/cmake/javaTargets.cmake.in
@@ -0,0 +1,39 @@
+cmake_minimum_required(VERSION 2.8.12)
+cmake_policy(PUSH)
+cmake_policy(VERSION 2.8)
+
+#----------------------------------------------------------------
+# Generated CMake Java target import file.
+#----------------------------------------------------------------
+
+# Protect against multiple inclusion, which would fail when already imported targets are added once more.
+set(_targetsDefined)
+set(_targetsNotDefined)
+set(_expectedTargets)
+foreach(_expectedTarget @__targets__@)
+ list(APPEND _expectedTargets ${_expectedTarget})
+ if(TARGET ${_expectedTarget})
+ list(APPEND _targetsDefined ${_expectedTarget})
+ else()
+ list(APPEND _targetsNotDefined ${_expectedTarget})
+ endif()
+endforeach()
+if("%${_targetsDefined}" STREQUAL "%${_expectedTargets}")
+ unset(_targetsDefined)
+ unset(_targetsNotDefined)
+ unset(_expectedTargets)
+ cmake_policy(POP)
+ return()
+endif()
+if(NOT "${_targetsDefined}" STREQUAL "")
+ message(FATAL_ERROR
+ "Some (but not all) targets in this export set were already defined.\n"
+ "Targets Defined: ${_targetsDefined}\n"
+ "Targets not yet defined: ${_targetsNotDefined}\n")
+endif()
+unset(_targetsDefined)
+unset(_targetsNotDefined)
+unset(_expectedTargets)
+
+@__targetdefs__@
+cmake_policy(POP)
diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake
index e736b7a..13e50dd 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.
#
@@ -47,9 +47,14 @@ else ()
set (LOG_LEVEL "${TEST_LOG_LEVEL}")
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 (NOT TEST_VOL)
+ 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}")
+else ()
+ message (STATUS "USING ${TEST_VOL} ON COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=${LOG_LEVEL} -Djava.library.path=\"${TEST_LIBRARY_DIRECTORY}\" -cp \"${TEST_CLASSPATH}\" ${TEST_ARGS} ${TEST_PROGRAM} ${ARGN}")
+ set (ENV{HDF5_VOL_CONNECTOR} "${TEST_VOL}")
+endif ()
-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}")
@@ -75,16 +80,19 @@ message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the .err file exists and ERRROR_APPEND is enabled
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
- if (TEST_MASK_FILE)
- STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
- endif ()
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ if (TEST_MASK_FILE)
+ STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
+ endif ()
- if (NOT ERROR_APPEND)
- # write back to original .err file
- file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
- else ()
- # append error output to the stdout output file
- file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
+ if (NOT ERROR_APPEND)
+ # write back to original .err file
+ file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
+ else ()
+ # append error output to the stdout output file
+ file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
+ endif ()
endif ()
endif ()
@@ -122,143 +130,171 @@ endif ()
message (STATUS "COMMAND Error: ${TEST_ERROR}")
# compare output files to references unless this must be skipped
+set (TEST_COMPARE_RESULT 0)
if (NOT TEST_SKIP_COMPARE)
if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
- if (WIN32 OR MINGW)
- configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
- file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
- #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
- #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
- endif ()
+ file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ 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})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ endif ()
- if (NOT TEST_SORT_COMPARE)
- # now compare the output with the reference
- execute_process (
- COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
- RESULT_VARIABLE TEST_RESULT
- )
- else ()
- file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
- file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
- list (SORT v1)
- list (SORT v2)
- if (NOT v1 STREQUAL v2)
- set(TEST_RESULT 1)
+ if (NOT TEST_SORT_COMPARE)
+ # now compare the output with the reference
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
+ RESULT_VARIABLE TEST_COMPARE_RESULT
+ )
+ else ()
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
+ list (SORT v1)
+ list (SORT v2)
+ if (NOT v1 STREQUAL v2)
+ set(TEST_COMPARE_RESULT 1)
+ endif ()
endif ()
- endif ()
- if (TEST_RESULT)
- set (TEST_RESULT 0)
- file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
- list (LENGTH test_act len_act)
- file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
- list (LENGTH test_ref len_ref)
- if (len_act GREATER 0 AND len_ref GREATER 0)
- math (EXPR _FP_LEN "${len_ref} - 1")
- foreach (line RANGE 0 ${_FP_LEN})
- list (GET test_act ${line} str_act)
- list (GET test_ref ${line} str_ref)
- if (NOT str_act STREQUAL str_ref)
- if (str_act)
- set (TEST_RESULT 1)
- message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ if (TEST_COMPARE_RESULT)
+ set (TEST_COMPARE_RESULT 0)
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
+ list (LENGTH test_act len_act)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
+ list (LENGTH test_ref len_ref)
+ if (len_act GREATER 0 AND len_ref GREATER 0)
+ math (EXPR _FP_LEN "${len_ref} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET test_act ${line} str_act)
+ list (GET test_ref ${line} str_ref)
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
+ set (TEST_COMPARE_RESULT 1)
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ endif ()
endif ()
+ endforeach ()
+ else ()
+ if (len_act EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
+ endif ()
+ if (len_ref EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
endif ()
- endforeach ()
- else ()
- if (len_act EQUAL 0)
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
endif ()
- if (len_ref EQUAL 0)
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
+ if (NOT len_act EQUAL len_ref)
+ set (TEST_COMPARE_RESULT 1)
endif ()
endif ()
- if (NOT len_act EQUAL len_ref)
- set (TEST_RESULT 1)
- endif ()
endif ()
- message (STATUS "COMPARE Result: ${TEST_RESULT}")
+ message (STATUS "COMPARE Result: ${TEST_COMPARE_RESULT}")
# again, if return value is !=0 scream and shout
- if (TEST_RESULT)
+ if (TEST_COMPARE_RESULT)
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
endif ()
endif ()
# now compare the .err file with the error reference, if supplied
+ set (TEST_ERRREF_RESULT 0)
if (TEST_ERRREF)
- if (WIN32 OR MINGW)
- configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF)
- file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF})
- #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
- #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
- endif ()
+ file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ 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})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
+ endif ()
- # now compare the error output with the error reference
- execute_process (
- COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
- RESULT_VARIABLE TEST_RESULT
- )
- if (TEST_RESULT)
- set (TEST_RESULT 0)
- file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
- list (LENGTH test_act len_act)
- file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
- list (LENGTH test_ref len_ref)
- math (EXPR _FP_LEN "${len_ref} - 1")
- if (len_act GREATER 0 AND len_ref GREATER 0)
+ # now compare the error output with the error reference
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
+ RESULT_VARIABLE TEST_ERRREF_RESULT
+ )
+ if (TEST_ERRREF_RESULT)
+ set (TEST_ERRREF_RESULT 0)
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
+ list (LENGTH test_act len_act)
+ file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
+ list (LENGTH test_ref len_ref)
math (EXPR _FP_LEN "${len_ref} - 1")
- foreach (line RANGE 0 ${_FP_LEN})
- list (GET test_act ${line} str_act)
- list (GET test_ref ${line} str_ref)
- if (NOT str_act STREQUAL str_ref)
- if (str_act)
- set (TEST_RESULT 1)
- message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ if (len_act GREATER 0 AND len_ref GREATER 0)
+ math (EXPR _FP_LEN "${len_ref} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET test_act ${line} str_act)
+ list (GET test_ref ${line} str_ref)
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
+ set (TEST_ERRREF_RESULT 1)
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ endif ()
endif ()
+ endforeach ()
+ else ()
+ if (len_act EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
+ endif ()
+ if (len_ref EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
endif ()
- endforeach ()
- else ()
- if (len_act EQUAL 0)
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
endif ()
- if (len_ref EQUAL 0)
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
+ if (NOT len_act EQUAL len_ref)
+ set (TEST_ERRREF_RESULT 1)
endif ()
endif ()
- if (NOT len_act EQUAL len_ref)
- set (TEST_RESULT 1)
- endif ()
endif ()
- message (STATUS "COMPARE Result: ${TEST_RESULT}")
+ message (STATUS "COMPARE Result: ${TEST_ERRREF_RESULT}")
# again, if return value is !=0 scream and shout
- if (TEST_RESULT)
+ if (TEST_ERRREF_RESULT)
message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}")
endif ()
endif ()
endif ()
+set (TEST_GREP_RESULT 0)
if (TEST_GREP_COMPARE)
# now grep the output with the reference
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ # TEST_REFERENCE should always be matched
+ string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
+ string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_GREP_RESULT)
+ if (NOT TEST_GREP_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
+ endif ()
- # TEST_REFERENCE should always be matched
- string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
- string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
- if (NOT TEST_RESULT)
- message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
+ string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
+ if (TEST_EXPECT)
+ # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
+ string (LENGTH "${TEST_MATCH}" TEST_GREP_RESULT)
+ if (TEST_GREP_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
+ endif ()
+ endif ()
endif ()
+endif ()
- string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
- if (TEST_EXPECT)
- # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
- string (LENGTH "${TEST_MATCH}" TEST_RESULT)
- if (TEST_RESULT)
- message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
- endif ()
+# dump the output unless nodisplay option is set
+if (TEST_SKIP_COMPARE AND NOT TEST_NO_DISPLAY)
+ if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E echo ${TEST_STREAM}
+ RESULT_VARIABLE TEST_RESULT
+ )
endif ()
endif ()
diff --git a/config/cmake/libh5cc.in b/config/cmake/libh5cc.in
index f462d56..f5d8d4c 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.
##
@@ -27,6 +27,27 @@ prg=$dir/$(basename -- "$prg") || exit
printf '%s\n' "$prg"
printf 'dir is %s\n' "$dir"
+
+# Show the configuration summary of the library recorded in the
+# libhdf5.settings file reside in the lib directory.
+showconfigure()
+{
+ cat $dir/lib/libhdf5.settings
+ status=$?
+}
+
export PKG_CONFIG_PATH=$dir/lib/pkgconfig
-@_PKG_CONFIG_COMPILER@ `pkg-config --define-variable=prefix=$dir --cflags --libs @_PKG_CONFIG_LIBNAME@-@_PKG_CONFIG_VERSION@` $@
+for arg in $@ ; do
+ case "$arg" in
+ -showconfig)
+ showconfigure
+ exit $status
+ ;;
+ *)
+ @_PKG_CONFIG_COMPILER@ $@ `pkg-config --define-variable=prefix=$dir --cflags --libs @_PKG_CONFIG_LIBNAME@`
+ status=$?
+ exit $status
+ ;;
+ esac
+done
diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in
index 8397d68..d80b0f8 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@
@@ -64,25 +64,29 @@ Languages:
Features:
---------
- Parallel HDF5: @HDF5_ENABLE_PARALLEL@
-Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@
- Large Parallel I/O: @LARGE_PARALLEL_IO@
- High-level library: @HDF5_BUILD_HL_LIB@
- Build HDF5 Tests: @BUILD_TESTING@
- Build HDF5 Tools: @HDF5_BUILD_TOOLS@
- Threadsafety: @HDF5_ENABLE_THREADSAFE@
- 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@
- (Read-Only) S3 VFD: @H5_HAVE_ROS3_VFD@
- (Read-Only) HDFS VFD: @H5_HAVE_LIBHDFS@
- dmalloc: @H5_HAVE_LIBDMALLOC@
- Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@
- API Tracing: @HDF5_ENABLE_TRACE@
- Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@
- Memory allocation sanity checks: @HDF5_MEMORY_ALLOC_SANITY_CHECK@
- Function Stack Tracing: @HDF5_ENABLE_CODESTACK@
- Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@
- Optimization Instrumentation: @HDF5_Enable_Instrument@
+ Parallel HDF5: @HDF5_ENABLE_PARALLEL@
+ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@
+ Large Parallel I/O: @LARGE_PARALLEL_IO@
+ High-level library: @HDF5_BUILD_HL_LIB@
+Dimension scales w/ new references: @DIMENSION_SCALES_WITH_NEW_REF@
+ Build HDF5 Tests: @BUILD_TESTING@
+ Build HDF5 Tools: @HDF5_BUILD_TOOLS@
+ Build High-level HDF5 Tools: @HDF5_BUILD_HL_TOOLS@
+ Threadsafety: @HDF5_ENABLE_THREADSAFE@
+ 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@
+ Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@
+ API Tracing: @HDF5_ENABLE_TRACE@
+ 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 c35f51f..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.
#
@@ -17,8 +17,6 @@
set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE)
-set (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE)
-
set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
@@ -41,7 +39,7 @@ set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE)
-set (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
+set (MPIEXEC_MAX_NUMPROCS "4" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
set (HDF5_ENABLE_USING_MEMCHECKER ON CACHE BOOL "Indicate that a memory checker is used" FORCE)
@@ -53,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 dc3939e..b142ade 100644
--- a/config/cmake/scripts/CTestScript.cmake
+++ b/config/cmake/scripts/CTestScript.cmake
@@ -5,11 +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.
#
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
########################################################
# This dashboard is maintained by The HDF Group
# For any comments please contact cdashhelp@hdfgroup.org
@@ -50,6 +50,17 @@ if (SITE_BUILDNAME_SUFFIX)
endif ()
set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
+# Launchers work only with Makefile and Ninja generators.
+if(NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+ set(CTEST_USE_LAUNCHERS 0)
+ set(ENV{CTEST_USE_LAUNCHERS_DEFAULT} 0)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=OFF")
+else()
+ set(CTEST_USE_LAUNCHERS 1)
+ set(ENV{CTEST_USE_LAUNCHERS_DEFAULT} 1)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON")
+endif()
+
#-----------------------------------------------------------------------------
# MAC machines need special option
#-----------------------------------------------------------------------------
@@ -195,17 +206,27 @@ if (CMAKE_GENERATOR_TOOLSET)
else ()
set (CTEST_CONFIGURE_TOOLSET "")
endif()
+if (CMAKE_GENERATOR_ARCHITECTURE)
+ set (CTEST_CONFIGURE_ARCHITECTURE "-A${CMAKE_GENERATOR_ARCHITECTURE}")
+else ()
+ set (CTEST_CONFIGURE_ARCHITECTURE "")
+endif()
if (LOCAL_MEMCHECK_TEST)
- find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
+ if(LOCAL_USE_VALGRIND)
+ set (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe")
+ find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
+ endif()
set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
+ "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_ARCHITECTURE}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
)
else ()
if (LOCAL_COVERAGE_TEST)
- find_program (CTEST_COVERAGE_COMMAND NAMES gcov)
+ if(LOCAL_USE_GCOV)
+ find_program (CTEST_COVERAGE_COMMAND NAMES gcov)
+ endif ()
endif ()
set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
+ "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_ARCHITECTURE}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
)
endif ()
@@ -232,6 +253,14 @@ endforeach ()
message (STATUS "Dashboard script configuration:\n${vars}\n")
#-----------------------------------------------------------------------------
+
+###################################################################
+######### Following is for submission to CDash ############
+###################################################################
+if (NOT DEFINED MODEL)
+ set (MODEL "Experimental")
+endif ()
+
#-----------------------------------------------------------------------------
## NORMAL process
## -- LOCAL_UPDATE updates the source folder from svn
diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake
index 3511d05..9a3ead2 100644
--- a/config/cmake/scripts/HDF5config.cmake
+++ b/config/cmake/scripts/HDF5config.cmake
@@ -5,23 +5,26 @@
# 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 ###
#############################################################################################
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
############################################################################
# Usage:
# 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
# VS2017 * Visual Studio 15 2017
# VS201764 * Visual Studio 15 2017 Win64
# VS2015 * Visual Studio 14 2015
@@ -34,15 +37,15 @@ cmake_minimum_required (VERSION 3.10)
# CTEST_SOURCE_NAME - source folder
##############################################################################
-set (CTEST_SOURCE_VERSION "1.11.6")
-set (CTEST_SOURCE_VERSEXT "")
+set (CTEST_SOURCE_VERSION "1.13.2")
+set (CTEST_SOURCE_VERSEXT "-1")
##############################################################################
# handle input parameters to script.
#BUILD_GENERATOR - which CMake generator to use, required
-#INSTALLDIR - HDF5-1.10.0 root folder
+#INSTALLDIR - HDF5-1.13.x root folder
#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo
-#CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0
+#CTEST_SOURCE_NAME - name of source folder; HDF5-1.13.x
#MODEL - CDash group name
#HPC - run alternate configurations for HPC machines; sbatch, bsub, raybsub, qsub
#MPI - enable MPI
@@ -65,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, VS201764, VS2015, VS201564")
endif ()
###################################################################
@@ -106,8 +109,20 @@ if (NOT DEFINED HPC)
endif ()
if (WIN32 AND NOT MINGW)
set (SITE_OS_NAME "Windows")
- set (SITE_OS_VERSION "WIN7")
- if (BUILD_GENERATOR STREQUAL "VS201764")
+ set (SITE_OS_VERSION "WIN10")
+ if (BUILD_GENERATOR STREQUAL "VS201964")
+ set (CTEST_CMAKE_GENERATOR "Visual Studio 16 2019")
+ set (CMAKE_GENERATOR_ARCHITECTURE "x64")
+ set (SITE_OS_BITS "64")
+ set (SITE_COMPILER_NAME "vs2019")
+ set (SITE_COMPILER_VERSION "16")
+ elseif (BUILD_GENERATOR STREQUAL "VS2019")
+ set (CTEST_CMAKE_GENERATOR "Visual Studio 16 2019")
+ set (CMAKE_GENERATOR_ARCHITECTURE "Win32")
+ set (SITE_OS_BITS "32")
+ set (SITE_COMPILER_NAME "vs2019")
+ set (SITE_COMPILER_VERSION "16")
+ elseif (BUILD_GENERATOR STREQUAL "VS201764")
set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64")
set (SITE_OS_BITS "64")
set (SITE_COMPILER_NAME "vs2017")
@@ -148,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")
@@ -166,14 +185,6 @@ if (NOT DEFINED HPC)
set (ENV{CC} "${XCODE_CC}")
set (ENV{CXX} "${XCODE_CXX}")
set (CTEST_USE_LAUNCHERS 1)
- set (RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare")
- set (RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized")
- set (RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat")
- set (RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2")
- set (RR_FLAGS_C "${RR_FLAGS_COMMON}")
- set (RR_FLAGS_CXX "${RR_FLAGS_COMMON}")
- set (ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}")
- set (ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}")
endif ()
endif ()
else ()
@@ -183,15 +194,6 @@ endif ()
###################################################################
###################################################################
-######### Following is for submission to CDash ############
-###################################################################
-if (NOT DEFINED MODEL)
- set (MODEL "Experimental")
-endif ()
-
-###################################################################
-
-###################################################################
##### Following controls CDash submission #####
#set (LOCAL_SUBMIT "TRUE")
##### Following controls test process #####
@@ -202,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 "develop")
#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 738c6c4..136f55d 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.4-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.14.4-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 c9fc36f..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.
#
@@ -54,7 +54,7 @@ if (TEST_CHECKUB STREQUAL "YES")
# 'tellub' calls H5Fget_user_block to get the size
# of the user block
#s2=`$JAM_BIN/tellub $origfile`
- EXECUTE_PROCESS (
+ execute_process (
COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_OFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
@@ -72,7 +72,7 @@ if (TEST_CHECKUB STREQUAL "YES")
if (TEST_O_STRING_LEN)
#$JAM_BIN/getub -c $s2 $origfile > $cmpfile
- EXECUTE_PROCESS (
+ execute_process (
COMMAND ${TEST_EMULATOR} ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
@@ -90,7 +90,7 @@ if (TEST_CHECKUB STREQUAL "YES")
endif ()
#$JAM_BIN/getub -c $size $hfile > $tfile
- EXECUTE_PROCESS (
+ execute_process (
COMMAND ${TEST_EMULATOR} ${TEST_GET_PROGRAM} -c ${TEST_STRING_SIZE} ${TEST_HFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
@@ -101,8 +101,8 @@ if (TEST_CHECKUB STREQUAL "YES")
)
# now compare the outputs
- EXECUTE_PROCESS (
- COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_HFILE}-ub.cmp ${TEST_HFILE}.cmp
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${TEST_HFILE}-ub.cmp ${TEST_HFILE}.cmp
RESULT_VARIABLE TEST_RESULT
)
@@ -114,7 +114,7 @@ if (TEST_CHECKUB STREQUAL "YES")
else ()
# call 'ubsize' to get the size of the user block
#ubsize=`$JAM_BIN/tellub $hfile`
- EXECUTE_PROCESS (
+ execute_process (
COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_HFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_H_STRING_LEN
diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake
index 12ee40b..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.
#
@@ -64,7 +64,7 @@ if (NOT TEST_RESULT EQUAL TEST_EXPECT)
if (NOT TEST_NOERRDISPLAY)
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM)
- message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}")
+ message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}")
endif ()
endif ()
message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}")
diff --git a/config/cmake/volTest.cmake b/config/cmake/volTest.cmake
index 1dcd2b1..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.
#
@@ -64,7 +64,7 @@ if (NOT TEST_RESULT EQUAL TEST_EXPECT)
if (NOT TEST_NOERRDISPLAY)
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.out")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.out TEST_STREAM)
- message (STATUS "Output USING ${TEST_VOL}:\n${TEST_STREAM}")
+ message (STATUS "Output USING ${TEST_VOL}:\n${TEST_STREAM}")
endif ()
endif ()
message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}")
diff --git a/config/cmake/wait_H5Tinit.cmake b/config/cmake/wait_H5Tinit.cmake
index c0b4d06..b778765 100644
--- a/config/cmake/wait_H5Tinit.cmake
+++ b/config/cmake/wait_H5Tinit.cmake
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
message(STATUS "Check for existence of ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c")
execute_process(COMMAND ls ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c RESULT_VARIABLE H5TI_result OUTPUT_QUIET ERROR_QUIET)
diff --git a/config/cmake_ext_mod/CTestCustom.cmake b/config/cmake_ext_mod/CTestCustom.cmake
index 025bce4..2d72e8d 100644
--- a/config/cmake_ext_mod/CTestCustom.cmake
+++ b/config/cmake_ext_mod/CTestCustom.cmake
@@ -1,16 +1,17 @@
set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000)
-
+
set (CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
- "note.*expected.*void.*but argument is of type.*volatile"
- "SZIP.src.*:[ \t]*warning"
- "jpeg.src.*:[ \t]*warning"
- "POSIX name for this item is deprecated"
- "disabling jobserver mode"
- "warning.*implicit declaration of function"
- "note: expanded from macro"
+ ".*note.*expected.*void.*but argument is of type.*volatile.*"
+ ".*src.SZIP.*:[ \t]*warning.*"
+ ".*src.ZLIB.*:[ \t]*warning.*"
+ ".*src.JPEG.*:[ \t]*warning.*"
+ ".*POSIX name for this item is deprecated.*"
+ ".*disabling jobserver mode.*"
+ ".*warning.*implicit declaration of function.*"
+ ".*note: expanded from macro.*"
)
-
+
set (CTEST_CUSTOM_MEMCHECK_IGNORE
${CTEST_CUSTOM_MEMCHECK_IGNORE}
)
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index abc88ed..6242b12 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")
@@ -67,7 +53,7 @@ if (MINGW)
set (${HDF_PREFIX}_HAVE_MINGW 1)
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)
@@ -83,16 +69,10 @@ endif ()
if (WINDOWS)
set (HDF5_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib")
set (${HDF_PREFIX}_HAVE_WIN32_API 1)
- set (${HDF_PREFIX}_HAVE_STDDEF_H 1)
- set (${HDF_PREFIX}_HAVE_SYS_STAT_H 1)
- set (${HDF_PREFIX}_HAVE_SYS_TYPES_H 1)
set (${HDF_PREFIX}_HAVE_LIBM 1)
set (${HDF_PREFIX}_HAVE_STRDUP 1)
- set (${HDF_PREFIX}_HAVE_SYSTEM 1)
- set (${HDF_PREFIX}_HAVE_LONGJMP 1)
if (NOT MINGW)
set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1)
- set (${HDF_PREFIX}_HAVE_FUNCTION 1)
endif ()
if (NOT UNIX AND NOT CYGWIN)
set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1)
@@ -134,29 +114,8 @@ CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${HDF_PREFIX}_HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H)
CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H)
-CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H)
-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)
- CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H)
-else ()
- set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE)
- set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE)
-endif ()
-
+CHECK_INCLUDE_FILE_CONCAT ("pwd.h" ${HDF_PREFIX}_HAVE_PWD_H)
CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H)
CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H)
CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H)
@@ -166,12 +125,11 @@ CHECK_INCLUDE_FILE_CONCAT ("strings.h" ${HDF_PREFIX}_HAVE_STRINGS_H)
CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" ${HDF_PREFIX}_HAVE_STDLIB_H)
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)
-# _Bool type support
-CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_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)
-## Check for non-standard extenstion quadmath.h
+## Check for non-standard extension quadmath.h
CHECK_INCLUDE_FILES(quadmath.h C_HAVE_QUADMATH)
if (${C_HAVE_QUADMATH})
@@ -227,7 +185,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
@@ -237,9 +197,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"
@@ -250,11 +214,6 @@ macro (HDF_FUNCTION_TEST OTHER_TEST)
endmacro ()
#-----------------------------------------------------------------------------
-# Check for these functions before the time headers are checked
-#-----------------------------------------------------------------------------
-HDF_FUNCTION_TEST (STDC_HEADERS)
-
-#-----------------------------------------------------------------------------
# Check for large file support
#-----------------------------------------------------------------------------
@@ -264,59 +223,63 @@ set (LINUX_LFS 0)
set (HDF_EXTRA_C_FLAGS)
set (HDF_EXTRA_FLAGS)
if (MINGW OR NOT WINDOWS)
- # Might want to check explicitly for Linux and possibly Cygwin
- # instead of checking for not Solaris or Darwin.
- if (NOT ${HDF_PREFIX}_HAVE_SOLARIS AND NOT ${HDF_PREFIX}_HAVE_DARWIN)
- # Linux Specific flags
- # This was originally defined as _POSIX_SOURCE which was updated to
- # _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX
- # functionality so clock_gettime and CLOCK_MONOTONIC are defined
- # correctly. This was later updated to 200112L so that
- # posix_memalign() is visible for the direct VFD code on Linux
- # 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)
-
- # 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)
-
- 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)
- set (msg "Performing TEST_LFS_WORKS")
- try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE
- ${CMAKE_BINARY_DIR}
- ${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- COMPILE_DEFINITIONS "-DTEST_LFS_WORKS"
- )
+ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
+ # Linux Specific flags
+ # This was originally defined as _POSIX_SOURCE which was updated to
+ # _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX
+ # functionality so clock_gettime and CLOCK_MONOTONIC are defined
+ # correctly. This was later updated to 200112L so that
+ # posix_memalign() is visible for the direct VFD code on Linux
+ # 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=200809L)
+
+ # Need to add this so that O_DIRECT is visible for the direct
+ # VFD on Linux systems.
+ 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)
+ set (msg "Performing TEST_LFS_WORKS")
+ try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE
+ ${CMAKE_BINARY_DIR}
+ ${HDF_RESOURCES_EXT_DIR}/HDFTests.c
+ COMPILE_DEFINITIONS "-DTEST_LFS_WORKS"
+ )
- # The LARGEFILE definitions were from the transition period
- # and are probably no longer needed. The FILE_OFFSET_BITS
- # check should be generalized for all POSIX systems as it
- # is in the Autotools.
- if (TEST_LFS_WORKS_COMPILE)
- if (TEST_LFS_WORKS_RUN MATCHES 0)
- 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")
+ # The LARGEFILE definitions were from the transition period
+ # and are probably no longer needed. The FILE_OFFSET_BITS
+ # check should be generalized for all POSIX systems as it
+ # is in the Autotools.
+ if (TEST_LFS_WORKS_COMPILE)
+ if (TEST_LFS_WORKS_RUN MATCHES 0)
+ 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)
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "${msg}... yes")
+ endif ()
+ else ()
+ set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
+ 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 Run failed with the following exit code:\n ${TEST_LFS_WORKS_RUN}\n"
+ "Test TEST_LFS_WORKS Compile failed\n"
)
endif ()
- else ()
- set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
- message (STATUS "${msg}... no")
- file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Test TEST_LFS_WORKS Compile failed\n"
- )
endif ()
- endif ()
- set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS})
+ set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS})
endif ()
endif ()
@@ -331,7 +294,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 ()
@@ -343,11 +306,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 ()
@@ -396,15 +363,13 @@ HDF_CHECK_TYPE_SIZE (uint_least64_t ${HDF_PREFIX}_SIZEOF_UINT_LEAST64_T)
HDF_CHECK_TYPE_SIZE (int_fast64_t ${HDF_PREFIX}_SIZEOF_INT_FAST64_T)
HDF_CHECK_TYPE_SIZE (uint_fast64_t ${HDF_PREFIX}_SIZEOF_UINT_FAST64_T)
-if (NOT APPLE)
- HDF_CHECK_TYPE_SIZE (size_t ${HDF_PREFIX}_SIZEOF_SIZE_T)
- HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T)
- if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T)
- set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0)
- endif ()
- if (MINGW OR NOT WINDOWS)
- HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T)
- endif ()
+HDF_CHECK_TYPE_SIZE (size_t ${HDF_PREFIX}_SIZEOF_SIZE_T)
+HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T)
+if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T)
+ set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0)
+endif ()
+if (MINGW OR NOT WINDOWS)
+ HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T)
endif ()
HDF_CHECK_TYPE_SIZE (off_t ${HDF_PREFIX}_SIZEOF_OFF_T)
@@ -418,13 +383,9 @@ HDF_CHECK_TYPE_SIZE (time_t ${HDF_PREFIX}_SIZEOF_TIME_T)
# Extra C99 types
#-----------------------------------------------------------------------------
-# _Bool type support
-if (HAVE_STDBOOL_H)
- set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h)
- HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL)
-else ()
- HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)
-endif ()
+# Size of bool
+set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h)
+HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)
if (MINGW OR NOT WINDOWS)
#-----------------------------------------------------------------------------
@@ -441,14 +402,17 @@ 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)
+ 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
)
@@ -456,20 +420,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)
@@ -494,61 +457,37 @@ CHECK_FUNCTION_EXISTS (alarm ${HDF_PREFIX}_HAVE_ALARM)
CHECK_FUNCTION_EXISTS (fcntl ${HDF_PREFIX}_HAVE_FCNTL)
CHECK_FUNCTION_EXISTS (flock ${HDF_PREFIX}_HAVE_FLOCK)
CHECK_FUNCTION_EXISTS (fork ${HDF_PREFIX}_HAVE_FORK)
-CHECK_FUNCTION_EXISTS (frexpf ${HDF_PREFIX}_HAVE_FREXPF)
-CHECK_FUNCTION_EXISTS (frexpl ${HDF_PREFIX}_HAVE_FREXPL)
CHECK_FUNCTION_EXISTS (gethostname ${HDF_PREFIX}_HAVE_GETHOSTNAME)
CHECK_FUNCTION_EXISTS (getrusage ${HDF_PREFIX}_HAVE_GETRUSAGE)
-CHECK_FUNCTION_EXISTS (llround ${HDF_PREFIX}_HAVE_LLROUND)
-CHECK_FUNCTION_EXISTS (llroundf ${HDF_PREFIX}_HAVE_LLROUNDF)
-CHECK_FUNCTION_EXISTS (lround ${HDF_PREFIX}_HAVE_LROUND)
-CHECK_FUNCTION_EXISTS (lroundf ${HDF_PREFIX}_HAVE_LROUNDF)
CHECK_FUNCTION_EXISTS (lstat ${HDF_PREFIX}_HAVE_LSTAT)
CHECK_FUNCTION_EXISTS (pread ${HDF_PREFIX}_HAVE_PREAD)
CHECK_FUNCTION_EXISTS (pwrite ${HDF_PREFIX}_HAVE_PWRITE)
CHECK_FUNCTION_EXISTS (rand_r ${HDF_PREFIX}_HAVE_RAND_R)
CHECK_FUNCTION_EXISTS (random ${HDF_PREFIX}_HAVE_RANDOM)
-CHECK_FUNCTION_EXISTS (round ${HDF_PREFIX}_HAVE_ROUND)
-CHECK_FUNCTION_EXISTS (roundf ${HDF_PREFIX}_HAVE_ROUNDF)
CHECK_FUNCTION_EXISTS (setsysinfo ${HDF_PREFIX}_HAVE_SETSYSINFO)
-CHECK_FUNCTION_EXISTS (signal ${HDF_PREFIX}_HAVE_SIGNAL)
-CHECK_FUNCTION_EXISTS (longjmp ${HDF_PREFIX}_HAVE_LONGJMP)
-CHECK_FUNCTION_EXISTS (setjmp ${HDF_PREFIX}_HAVE_SETJMP)
CHECK_FUNCTION_EXISTS (siglongjmp ${HDF_PREFIX}_HAVE_SIGLONGJMP)
CHECK_FUNCTION_EXISTS (sigsetjmp ${HDF_PREFIX}_HAVE_SIGSETJMP)
CHECK_FUNCTION_EXISTS (sigprocmask ${HDF_PREFIX}_HAVE_SIGPROCMASK)
-CHECK_FUNCTION_EXISTS (snprintf ${HDF_PREFIX}_HAVE_SNPRINTF)
CHECK_FUNCTION_EXISTS (srandom ${HDF_PREFIX}_HAVE_SRANDOM)
CHECK_FUNCTION_EXISTS (strdup ${HDF_PREFIX}_HAVE_STRDUP)
-CHECK_FUNCTION_EXISTS (strtoll ${HDF_PREFIX}_HAVE_STRTOLL)
-CHECK_FUNCTION_EXISTS (strtoull ${HDF_PREFIX}_HAVE_STRTOULL)
CHECK_FUNCTION_EXISTS (symlink ${HDF_PREFIX}_HAVE_SYMLINK)
-CHECK_FUNCTION_EXISTS (system ${HDF_PREFIX}_HAVE_SYSTEM)
CHECK_FUNCTION_EXISTS (tmpfile ${HDF_PREFIX}_HAVE_TMPFILE)
CHECK_FUNCTION_EXISTS (asprintf ${HDF_PREFIX}_HAVE_ASPRINTF)
CHECK_FUNCTION_EXISTS (vasprintf ${HDF_PREFIX}_HAVE_VASPRINTF)
CHECK_FUNCTION_EXISTS (waitpid ${HDF_PREFIX}_HAVE_WAITPID)
-CHECK_FUNCTION_EXISTS (vsnprintf ${HDF_PREFIX}_HAVE_VSNPRINTF)
-if (MINGW OR NOT WINDOWS)
- if (${HDF_PREFIX}_HAVE_VSNPRINTF)
- HDF_FUNCTION_TEST (VSNPRINTF_WORKS)
- endif ()
-endif ()
-
#-----------------------------------------------------------------------------
# sigsetjmp is special; may actually be a macro
#-----------------------------------------------------------------------------
if (NOT ${HDF_PREFIX}_HAVE_SIGSETJMP)
- if (${HDF_PREFIX}_HAVE_SETJMP_H)
- CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" ${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP)
- if (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP)
- set (${HDF_PREFIX}_HAVE_SIGSETJMP 1)
- endif ()
+ CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" ${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP)
+ if (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP)
+ set (${HDF_PREFIX}_HAVE_SIGSETJMP 1)
endif ()
endif ()
@@ -558,9 +497,6 @@ endif ()
if (MINGW OR NOT WINDOWS)
foreach (other_test
HAVE_ATTRIBUTE
- HAVE_C99_FUNC
-# STDC_HEADERS
- HAVE_FUNCTION
HAVE_C99_DESIGNATED_INITIALIZER
SYSTEM_SCOPE_THREADS
HAVE_SOCKLEN_T
@@ -574,7 +510,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
@@ -603,9 +541,11 @@ 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"
+ "Performing C SOURCE FILE Test InitOnceExecuteOnce succeeded with the following output:\n"
"${OUTPUT}\n"
"Return value: ${HAVE_IOEO}\n")
else ()
@@ -615,7 +555,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"
@@ -626,19 +568,13 @@ if (WINDOWS)
endif ()
#-----------------------------------------------------------------------------
-# Determine how 'inline' is used
-#-----------------------------------------------------------------------------
-foreach (inline_test inline __inline__ __inline)
- string (TOUPPER ${inline_test} INLINE_TEST_MACRO)
- HDF_FUNCTION_TEST (HAVE_${INLINE_TEST_MACRO})
-endforeach ()
-
-#-----------------------------------------------------------------------------
# Check how to print a Long Long integer
#-----------------------------------------------------------------------------
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")
@@ -655,7 +591,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
@@ -664,9 +602,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 2303d6d..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.
#
@@ -51,7 +51,7 @@ find_path(SZIP_INCLUDE_DIR szlib.h)
set(szip_names ${SZIP_NAMES} sz szip szip-static libsz libszip libszip-static)
foreach(name ${szip_names})
- list(APPEND szip_names_debug "${name}d")
+ list (APPEND szip_names_debug "${name}d")
endforeach()
if(NOT SZIP_LIBRARY)
@@ -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
deleted file mode 100644
index 1b98092..0000000
--- a/config/cmake_ext_mod/HDFCXXTests.cpp
+++ /dev/null
@@ -1,102 +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. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#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>
-#include <stddef.h>
-
-#ifdef FC_DUMMY_MAIN
-#ifndef FC_DUMMY_MAIN_EQ_F77
-# ifdef __cplusplus
-extern "C"
-# endif
-int FC_DUMMY_MAIN()
-{ return 1;}
-#endif
-#endif
-int
-main ()
-{
-
- struct index_st
- {
- unsigned char type;
- unsigned char num;
- unsigned int len;
- };
- typedef struct index_st index_t;
- int x,y;
- x = offsetof(struct index_st, len);
- y = offsetof(index_t, num)
-
- ;
- return 0;
-}
-
-#endif
diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake
index 9df2b4b..40d06e7 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")
@@ -92,12 +84,16 @@ endmacro ()
#-------------------------------------------------------------------------------
macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
if (${compress_type} MATCHES "GIT")
+# FetchContent_Declare (SZIP
+# GIT_REPOSITORY ${SZIP_URL}
+# GIT_TAG ${SZIP_BRANCH}
+# )
EXTERNALPROJECT_ADD (SZIP
GIT_REPOSITORY ${SZIP_URL}
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}
@@ -112,12 +108,16 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
elseif (${compress_type} MATCHES "TGZ")
+# FetchContent_Declare (SZIP
+# URL ${SZIP_URL}
+# URL_HASH ""
+# )
EXTERNALPROJECT_ADD (SZIP
URL ${SZIP_URL}
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}
@@ -133,36 +133,53 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
)
endif ()
externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR)
-
+# FetchContent_GetProperties(SZIP)
+# if(NOT SZIP_POPULATED)
+# FetchContent_Populate(SZIP)
+# add_subdirectory(${szip_SOURCE_DIR} ${szip_BINARY_DIR})
+# endif()
+#
##include (${BINARY_DIR}/${SZIP_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 "szaec" 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")
+ if (USE_LIBAEC)
+ set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/include")
+ else ()
+ set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src")
+ endif ()
set (SZIP_FOUND 1)
set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR})
endmacro ()
#-------------------------------------------------------------------------------
macro (PACKAGE_SZIP_LIBRARY compress_type)
+ set (SZIP_HDR "SZconfig")
+ if (USE_LIBAEC)
+ set (SZIP_HDR "aec_config")
+ else ()
+ 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 ()
@@ -171,12 +188,12 @@ endmacro ()
#-------------------------------------------------------------------------------
macro (EXTERNAL_ZLIB_LIBRARY compress_type)
if (${compress_type} MATCHES "GIT")
- EXTERNALPROJECT_ADD (ZLIB
+ EXTERNALPROJECT_ADD (HDF5_ZLIB
GIT_REPOSITORY ${ZLIB_URL}
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}
@@ -190,12 +207,12 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
elseif (${compress_type} MATCHES "TGZ")
- EXTERNALPROJECT_ADD (ZLIB
+ EXTERNALPROJECT_ADD (HDF5_ZLIB
URL ${ZLIB_URL}
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}
@@ -209,29 +226,17 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
endif ()
- externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR)
+ externalproject_get_property (HDF5_ZLIB BINARY_DIR SOURCE_DIR)
- if (WIN32)
- set (ZLIB_LIB_NAME "zlib")
- else ()
- set (ZLIB_LIB_NAME "z")
- endif ()
+ set (ZLIB_LIB_NAME "z")
##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
# Create imported target zlib-static
add_library(${HDF_PACKAGE_NAMESPACE}zlib-static STATIC IMPORTED)
# add_library(${HDF_PACKAGE_NAMESPACE}zlib-static ALIAS zlib-static)
HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-static ${ZLIB_LIB_NAME} STATIC "")
- add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-static ZLIB)
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-static HDF5_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}")
@@ -247,6 +252,6 @@ macro (PACKAGE_ZLIB_LIBRARY compress_type)
)
set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h)
if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ")
- add_dependencies (ZLIB-GenHeader-Copy ZLIB)
+ add_dependencies (ZLIB-GenHeader-Copy HDF5_ZLIB)
endif ()
endmacro ()
diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake
index e320c07..0f9b367 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"
@@ -82,10 +84,8 @@ macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent)
set (targetfilename $<TARGET_FILE_DIR:${libtarget}>/${target_name}.pdb)
endif ()
install (
- FILES
- ${targetfilename}
- DESTINATION
- ${targetdestination}
+ FILES ${targetfilename}
+ DESTINATION ${targetdestination}
CONFIGURATIONS Debug RelWithDebInfo
COMPONENT ${targetcomponent}
OPTIONAL
@@ -97,10 +97,8 @@ endmacro ()
macro (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent)
if (WIN32 AND MSVC)
install (
- FILES
- $<TARGET_PDB_FILE:${progtarget}>
- DESTINATION
- ${targetdestination}
+ FILES $<TARGET_PDB_FILE:${progtarget}>
+ DESTINATION ${targetdestination}
CONFIGURATIONS Debug RelWithDebInfo
COMPONENT ${targetcomponent}
OPTIONAL
@@ -123,28 +121,17 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
endif ()
endif ()
- set_target_properties (${libtarget}
- PROPERTIES
- OUTPUT_NAME
- ${LIB_RELEASE_NAME}
-# OUTPUT_NAME_DEBUG
-# ${LIB_DEBUG_NAME}
- OUTPUT_NAME_RELEASE
- ${LIB_RELEASE_NAME}
- OUTPUT_NAME_MINSIZEREL
- ${LIB_RELEASE_NAME}
- OUTPUT_NAME_RELWITHDEBINFO
- ${LIB_RELEASE_NAME}
+ set_target_properties (${libtarget} PROPERTIES
+ OUTPUT_NAME ${LIB_RELEASE_NAME}
+# OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME}
+ OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME}
+ 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)
- set_target_properties (${libtarget}
- PROPERTIES
+ set_target_properties (${libtarget} PROPERTIES
COMPILE_PDB_NAME_DEBUG ${LIB_DEBUG_NAME}
COMPILE_PDB_NAME_RELEASE ${LIB_RELEASE_NAME}
COMPILE_PDB_NAME_MINSIZEREL ${LIB_RELEASE_NAME}
@@ -154,10 +141,9 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
endif ()
endif ()
- #----- Use MSVC Naming conventions for Shared Libraries
- if (MINGW AND ${libtype} MATCHES "SHARED")
- set_target_properties (${libtarget}
- PROPERTIES
+ 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 ""
PREFIX ""
@@ -237,7 +223,7 @@ macro (TARGET_C_PROPERTIES wintarget libtype)
endmacro ()
#-----------------------------------------------------------------------------
-# Configure the README.txt file for the binary package
+# Configure the README.md file for the binary package
#-----------------------------------------------------------------------------
macro (HDF_README_PROPERTIES target_fortran)
set (BINARY_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
@@ -261,6 +247,10 @@ macro (HDF_README_PROPERTIES target_fortran)
set (BINARY_PLATFORM "${BINARY_PLATFORM} Intel")
if (${CMAKE_C_COMPILER_VERSION} MATCHES "^17.*")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel 17")
+ elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^18.*")
+ set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel 18")
+ elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.*")
+ set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel 19")
else ()
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel ${CMAKE_C_COMPILER_VERSION}")
endif ()
@@ -277,8 +267,10 @@ macro (HDF_README_PROPERTIES target_fortran)
elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.*")
if (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.0.*")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015")
- else ()
+ elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.16.*")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2017")
+ else () #19.23
+ set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2019")
endif ()
else ()
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}")
@@ -309,8 +301,8 @@ macro (HDF_README_PROPERTIES target_fortran)
endif ()
configure_file (
- ${HDF_RESOURCES_DIR}/README.txt.cmake.in
- ${CMAKE_BINARY_DIR}/README.txt @ONLY
+ ${HDF_RESOURCES_DIR}/README.md.cmake.in
+ ${CMAKE_BINARY_DIR}/README.md @ONLY
)
endmacro ()
@@ -349,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)
@@ -359,15 +351,21 @@ 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 cmake)
+ endif ()
+ # Always use full RPATH, i.e. don't skip the full RPATH for the build tree
set (CMAKE_SKIP_BUILD_RPATH FALSE)
+ # when building, don't use the install RPATH already
+ # (but later on when installing)
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
+ # add the automatically determined parts of the RPATH
+ # which point to directories outside the build tree to the install RPATH
set (CMAKE_BUILD_WITH_INSTALL_RPATH ON)
if (APPLE)
set (CMAKE_INSTALL_NAME_DIR "@rpath")
@@ -428,5 +426,52 @@ macro (HDF_DIR_PATHS package_prefix)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
endif ()
endif ()
+
+ if (NOT ${package_prefix}_EXTERNALLY_CONFIGURED AND 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 (NOT HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ string (REGEX REPLACE "-Werror=" "-W" str_flag "${str_flag}")
+ endif ()
+ 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..2b2a202 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. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -44,78 +44,6 @@ main ()
#endif
-#ifdef HAVE_C99_FUNC
-
-#ifdef FC_DUMMY_MAIN
-#ifndef FC_DUMMY_MAIN_EQ_F77
-# ifdef __cplusplus
- extern "C"
-# endif
- int FC_DUMMY_MAIN() { return 1; }
-#endif
-#endif
-int
-main ()
-{
- const char *fname = __func__;
- ;
- return 0;
-}
-
-#endif
-
-#ifdef VSNPRINTF_WORKS
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-int test_vsnprintf(const char *fmt,...)
-{
- va_list ap;
- char *s = malloc(16);
- int ret;
-
- va_start(ap, fmt);
- ret=vsnprintf(s,16,"%s",ap);
- va_end(ap);
-
- return(ret!=42 ? 1 : 0);
-}
-
-int main(void)
-{
- return(test_vsnprintf("%s","A string that is longer than 16 characters"));
-}
-#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>
-#include <string.h>
-#include <float.h>
-int main() { return 0; }
-#endif /* STDC_HEADERS */
-
-
#ifdef HAVE_ATTRIBUTE
#if 0
@@ -142,46 +70,6 @@ int __attribute__((unused)) x
#endif /* HAVE_ATTRIBUTE */
-#ifdef HAVE_FUNCTION
-
-#ifdef FC_DUMMY_MAIN
-#ifndef FC_DUMMY_MAIN_EQ_F77
-# ifdef __cplusplus
- extern "C"
-# endif
- int FC_DUMMY_MAIN() { return 1; }
-#endif
-#endif
-int
-main ()
-{
-(void)__FUNCTION__
- ;
- return 0;
-}
-
-#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 +80,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 +105,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;
@@ -245,8 +115,8 @@ int main(void)
for (currentArg = llwidthArgs; *currentArg != NULL; currentArg++)
{
char formatString[64];
- sprintf(formatString, "%%%sd", *currentArg);
- sprintf(s, formatString, x);
+ snprintf(formatString, sizeof(formatString), "%%%sd", *currentArg);
+ snprintf(s, 128, formatString, x);
if (strcmp(s, "1099511627776") == 0)
{
printf("PRINTF_LL_WIDTH=[%s]\n", *currentArg);
@@ -319,16 +189,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>
@@ -431,32 +291,3 @@ 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 )
-# define INLINE_KW inline
-#elif defined ( HAVE___INLINE__ )
-# define INLINE_KW __inline__
-#elif defined ( HAVE___INLINE )
-# define INLINE_KW __inline
-#endif /* HAVE_INLINE */
-typedef int foo_t;
-static INLINE_KW foo_t static_foo () { return 0; }
-INLINE_KW foo_t foo () {return 0; }
-int main(void) { return 0; }
-#endif /* __cplusplus */
-#endif /* defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE ) */
-
diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake
deleted file mode 100644
index 8d98147..0000000
--- a/config/cmake_ext_mod/HDFUseCXX.cmake
+++ /dev/null
@@ -1,109 +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.
-#
-#
-# This file provides functions for C++ support.
-#
-#-------------------------------------------------------------------------------
-ENABLE_LANGUAGE (CXX)
-set (HDF_PREFIX "H5")
-
-#-------------------------------------------------------------------------------
-# Fix CXX flags if we are compiling staticly on Windows using
-# Windows_MT.cmake from config/cmake/UserMacros
-#-------------------------------------------------------------------------------
-if (BUILD_STATIC_CRT_LIBS)
- TARGET_STATIC_CRT_FLAGS ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Configure Checks which require CXX compilation must go in here
-# not in the main ConfigureChecks.cmake files, because if the user has
-# no CXX compiler, problems arise.
-#-----------------------------------------------------------------------------
-include (CheckIncludeFileCXX)
-include (TestForSTDNamespace)
-
-# IF the c compiler found stdint, check the C++ as well. On some systems this
-# file will be found by C but not C++, only do this test IF the C++ compiler
-# has been initialized (e.g. the project also includes some c++)
-if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
- CHECK_INCLUDE_FILE_CXX ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H_CXX)
- if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX)
- set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H")
- set (USE_INCLUDES ${USE_INCLUDES} "stdint.h")
- endif ()
-endif ()
-
-# For other CXX specific tests, use this MACRO.
-macro (HDF_CXX_FUNCTION_TEST OTHER_TEST)
- if (NOT DEFINED ${OTHER_TEST})
- set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}")
- set (OTHER_TEST_ADD_LIBRARIES)
- if (HDF5_REQUIRED_LIBRARIES)
- set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}")
- endif ()
-
- foreach (def
- HAVE_SYS_TIME_H
- HAVE_UNISTD_H
- HAVE_SYS_TYPES_H
- HAVE_SYS_SOCKET_H
- HAVE_SYS_FILE_H
- )
- if ("${${HDF_PREFIX}_${def}}")
- set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}")
- endif ()
- endforeach ()
-
- if (LARGEFILE)
- set (MACRO_CHECK_FUNCTION_DEFINITIONS
- "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
- )
- endif ()
-
- #message (STATUS "Performing ${OTHER_TEST}")
- TRY_COMPILE (${OTHER_TEST}
- ${CMAKE_BINARY_DIR}
- ${HDF_RESOURCES_EXT_DIR}/HDFCXXTests.cpp
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
- "${OTHER_TEST_ADD_LIBRARIES}"
- OUTPUT_VARIABLE OUTPUT
- )
- if (${OTHER_TEST} EQUAL 0)
- set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}")
- message (STATUS "Performing CXX Test ${OTHER_TEST} - Success")
- else ()
- message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed")
- 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"
- "${OUTPUT}\n"
- )
- endif ()
- endif ()
-endmacro ()
-
-#-----------------------------------------------------------------------------
-# Check a bunch of cxx functions
-#-----------------------------------------------------------------------------
-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})
- endforeach ()
-endif ()
diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake
index bfb45fa..c96298f 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.
#
@@ -16,8 +16,13 @@
enable_language (Fortran)
set (HDF_PREFIX "H5")
+if (NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ include (CheckFortranSourceRuns)
+ include (CheckFortranSourceCompiles)
+endif ()
+
#-------------------------------------------------------------------------------
-# Fix Fortran flags if we are compiling staticly on Windows using
+# Fix Fortran flags if we are compiling statically on Windows using
# Windows_MT.cmake from config/cmake/UserMacros
#-------------------------------------------------------------------------------
if (BUILD_STATIC_CRT_LIBS)
@@ -42,71 +47,15 @@ file (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL_\\(.*,
string (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS})
set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}")
-#-----------------------------------------------------------------------------
-# The provided CMake Fortran macros don't provide a general check function
-# so this one is used for a sizeof test.
-#-----------------------------------------------------------------------------
-macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE)
- message (STATUS "Testing Fortran ${FUNCTION}")
- 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/testFortranCompiler.f90
- "${CODE}"
- )
- TRY_COMPILE (RESULT_VAR
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90
- CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
- OUTPUT_VARIABLE OUTPUT
- )
-
-# message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
-# message (STATUS "Test result ${OUTPUT}")
-# message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
-
- if (${RESULT_VAR})
- set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}")
- message (STATUS "Testing Fortran ${FUNCTION} - OK")
- 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"
- )
- else ()
- message (STATUS "Testing Fortran ${FUNCTION} - Fail")
- set (${VARIABLE} 0 CACHE INTERNAL "Have Fortran function ${FUNCTION}")
- file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
- "${OUTPUT}\n\n")
- endif ()
-endmacro ()
-
-#-----------------------------------------------------------------------------
-# Configure Checks which require Fortran compilation must go in here
-# not in the main ConfigureChecks.cmake files, because if the user has
-# no Fortran compiler, problems arise.
-#
-# Be careful with leading spaces here, do not remove them.
-#-----------------------------------------------------------------------------
-
-# Check for Non-standard extension intrinsic function SIZEOF
-set (${HDF_PREFIX}_FORTRAN_HAVE_SIZEOF FALSE)
-CHECK_FORTRAN_FEATURE(sizeof
+#test code source
+set (SIZEOF_CODE
"
PROGRAM main
i = sizeof(x)
END PROGRAM
"
- ${HDF_PREFIX}_FORTRAN_HAVE_SIZEOF
)
-
-# Check for F2008 standard intrinsic function C_SIZEOF
-set (${HDF_PREFIX}_FORTRAN_HAVE_C_SIZEOF FALSE)
-CHECK_FORTRAN_FEATURE(c_sizeof
+set (C_SIZEOF_CODE
"
PROGRAM main
USE ISO_C_BINDING
@@ -115,11 +64,8 @@ CHECK_FORTRAN_FEATURE(c_sizeof
result = c_sizeof(a)
END PROGRAM
"
- ${HDF_PREFIX}_FORTRAN_HAVE_C_SIZEOF
)
-
-# Check for F2008 standard intrinsic function STORAGE_SIZE
-CHECK_FORTRAN_FEATURE(storage_size
+set (STORAGE_SIZE_CODE
"
PROGRAM main
INTEGER :: a
@@ -127,22 +73,15 @@ CHECK_FORTRAN_FEATURE(storage_size
result = storage_size(a)
END PROGRAM
"
- ${HDF_PREFIX}_FORTRAN_HAVE_STORAGE_SIZE
)
-
-# Check for F2008 standard intrinsic module "ISO_FORTRAN_ENV"
-set (${HDF_PREFIX}_HAVE_ISO_FORTRAN_ENV FALSE)
-CHECK_FORTRAN_FEATURE(ISO_FORTRAN_ENV
+set (ISO_FORTRAN_ENV_CODE
"
PROGRAM main
USE, INTRINSIC :: ISO_FORTRAN_ENV
END PROGRAM
"
- ${HDF_PREFIX}_HAVE_ISO_FORTRAN_ENV
)
-
-set (${HDF_PREFIX}_FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE)
-CHECK_FORTRAN_FEATURE(RealIsNotDouble
+set (REALISNOTDOUBLE_CODE
"
MODULE type_mod
INTERFACE h5t
@@ -165,14 +104,8 @@ CHECK_FORTRAN_FEATURE(RealIsNotDouble
CALL h5t(d)
END PROGRAM main
"
- ${HDF_PREFIX}_FORTRAN_DEFAULT_REAL_NOT_DOUBLE
)
-
-#-----------------------------------------------------------------------------
-# Checks if the ISO_C_BINDING module meets all the requirements
-#-----------------------------------------------------------------------------
-set (${HDF_PREFIX}_FORTRAN_HAVE_ISO_C_BINDING FALSE)
-CHECK_FORTRAN_FEATURE(iso_c_binding
+set (ISO_C_BINDING_CODE
"
PROGRAM main
USE iso_c_binding
@@ -184,15 +117,107 @@ CHECK_FORTRAN_FEATURE(iso_c_binding
ptr = C_LOC(ichr(1:1))
END PROGRAM
"
- ${HDF_PREFIX}_FORTRAN_HAVE_ISO_C_BINDING
)
+if (NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ if (HDF5_REQUIRED_LIBRARIES)
+ set (CMAKE_REQUIRED_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}")
+ endif ()
+ check_fortran_source_compiles (${SIZEOF_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_SIZEOF SRC_EXT f90)
+ check_fortran_source_compiles (${C_SIZEOF_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_C_SIZEOF SRC_EXT f90)
+ check_fortran_source_compiles (${STORAGE_SIZE_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_STORAGE_SIZE SRC_EXT f90)
+ check_fortran_source_compiles (${ISO_FORTRAN_ENV_CODE} ${HDF_PREFIX}_HAVE_ISO_FORTRAN_ENV SRC_EXT f90)
+ check_fortran_source_compiles (${REALISNOTDOUBLE_CODE} ${HDF_PREFIX}_FORTRAN_DEFAULT_REAL_NOT_DOUBLE SRC_EXT f90)
+ check_fortran_source_compiles (${ISO_C_BINDING_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_ISO_C_BINDING SRC_EXT f90)
+else ()
+ #-----------------------------------------------------------------------------
+ # The provided CMake Fortran macros don't provide a general check function
+ # so this one is used for a sizeof test.
+ #-----------------------------------------------------------------------------
+ macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE)
+ 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}")
+ else ()
+ set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
+ endif ()
+ file (WRITE
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90
+ "${CODE}"
+ )
+ TRY_COMPILE (RESULT_VAR
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90
+ CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
+ OUTPUT_VARIABLE OUTPUT
+ )
+
+ # 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}")
+ 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"
+ )
+ else ()
+ message (STATUS "Testing Fortran ${FUNCTION} - Fail")
+ set (${VARIABLE} 0 CACHE INTERNAL "Have Fortran function ${FUNCTION}")
+ file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
+ "${OUTPUT}\n\n")
+ endif ()
+ endmacro ()
+
+ #-----------------------------------------------------------------------------
+ # Configure Checks which require Fortran compilation must go in here
+ # not in the main ConfigureChecks.cmake files, because if the user has
+ # no Fortran compiler, problems arise.
+ #
+ # Be careful with leading spaces here, do not remove them.
+ #-----------------------------------------------------------------------------
+
+ # Check for Non-standard extension intrinsic function SIZEOF
+ set (${HDF_PREFIX}_FORTRAN_HAVE_SIZEOF FALSE)
+ CHECK_FORTRAN_FEATURE(sizeof_code ${SIZEOF_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_SIZEOF)
+
+ # Check for F2008 standard intrinsic function C_SIZEOF
+ set (${HDF_PREFIX}_FORTRAN_HAVE_C_SIZEOF FALSE)
+ CHECK_FORTRAN_FEATURE(c_sizeof_code ${C_SIZEOF_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_C_SIZEOF)
+
+ # Check for F2008 standard intrinsic function STORAGE_SIZE
+ CHECK_FORTRAN_FEATURE(storage_size_code ${STORAGE_SIZE_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_STORAGE_SIZE)
+
+ # Check for F2008 standard intrinsic module "ISO_FORTRAN_ENV"
+ set (${HDF_PREFIX}_HAVE_ISO_FORTRAN_ENV FALSE)
+ CHECK_FORTRAN_FEATURE(iso_fortran_env_code ${ISO_FORTRAN_ENV_CODE} ${HDF_PREFIX}_HAVE_ISO_FORTRAN_ENV)
+
+ set (${HDF_PREFIX}_FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE)
+ CHECK_FORTRAN_FEATURE(realisnotdouble_code ${REALISNOTDOUBLE_CODE} ${HDF_PREFIX}_FORTRAN_DEFAULT_REAL_NOT_DOUBLE)
+
+ #-----------------------------------------------------------------------------
+ # Checks if the ISO_C_BINDING module meets all the requirements
+ #-----------------------------------------------------------------------------
+ set (${HDF_PREFIX}_FORTRAN_HAVE_ISO_C_BINDING FALSE)
+ CHECK_FORTRAN_FEATURE(iso_c_binding_code ${ISO_C_BINDING_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_ISO_C_BINDING)
+endif ()
+
#-----------------------------------------------------------------------------
# Add debug information (intel Fortran : JB)
#-----------------------------------------------------------------------------
if (CMAKE_Fortran_COMPILER MATCHES ifort)
if (WIN32 AND NOT MINGW)
- set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE)
- set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE)
+ set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE STRING "flags" FORCE)
+ set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE STRING "flags" FORCE)
endif ()
endif ()
diff --git a/config/cmake_ext_mod/NSIS.template.in b/config/cmake_ext_mod/NSIS.template.in
index ecced05..db79466 100644
--- a/config/cmake_ext_mod/NSIS.template.in
+++ b/config/cmake_ext_mod/NSIS.template.in
@@ -849,7 +849,7 @@ Section "Uninstall"
@CPACK_NSIS_DELETE_ICONS@
@CPACK_NSIS_DELETE_ICONS_EXTRA@
- ;Delete empty start menu parent diretories
+ ;Delete empty start menu parent directories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
startMenuDeleteLoop:
@@ -868,7 +868,7 @@ Section "Uninstall"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
@CPACK_NSIS_DELETE_ICONS_EXTRA@
- ;Delete empty start menu parent diretories
+ ;Delete empty start menu parent directories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
secondStartMenuDeleteLoop:
diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake
index 78ee0da..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
@@ -82,91 +78,102 @@ if (TEST_FIND_RESULT GREATER 0)
endif ()
# if the TEST_ERRREF exists grep the error output with the error reference
+set (TEST_ERRREF_RESULT 0)
if (TEST_ERRREF)
# if the .err file exists grep the error output with the error reference before comparing stdout
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_ERR_STREAM)
-
- # TEST_ERRREF should always be matched
- string (REGEX MATCH "${TEST_ERRREF}" TEST_MATCH ${TEST_ERR_STREAM})
- string (COMPARE EQUAL "${TEST_ERRREF}" "${TEST_MATCH}" TEST_RESULT)
- if (NOT TEST_RESULT)
- message (FATAL_ERROR "Failed: The error output of ${TEST_PROGRAM} did not contain ${TEST_ERRREF}")
+ list (LENGTH TEST_ERR_STREAM test_len)
+ if (test_len GREATER 0)
+ # TEST_ERRREF should always be matched
+ string (REGEX MATCH "${TEST_ERRREF}" TEST_MATCH ${TEST_ERR_STREAM})
+ string (COMPARE EQUAL "${TEST_ERRREF}" "${TEST_MATCH}" TEST_ERRREF_RESULT)
+ if (NOT TEST_ERRREF_RESULT)
+ message (FATAL_ERROR "Failed: The error output of ${TEST_PROGRAM} did not contain ${TEST_ERRREF}")
+ endif ()
endif ()
endif ()
#always compare output file to reference unless this must be skipped
+ set (TEST_COMPARE_RESULT 0)
if (NOT TEST_SKIP_COMPARE)
if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
- if (WIN32 OR MINGW)
- configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
- file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
- #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
- #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
- endif ()
- if (NOT TEST_SORT_COMPARE)
- # now compare the output with the reference
- execute_process (
- COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
- RESULT_VARIABLE TEST_RESULT
- )
- else ()
- file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
- file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
- list (SORT v1)
- list (SORT v2)
- if (NOT v1 STREQUAL v2)
- set(TEST_RESULT 1)
+ file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ 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})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ endif ()
+ if (NOT TEST_SORT_COMPARE)
+ # now compare the output with the reference
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
+ RESULT_VARIABLE TEST_COMPARE_RESULT
+ )
+ else ()
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
+ list (SORT v1)
+ list (SORT v2)
+ if (NOT v1 STREQUAL v2)
+ set(TEST_COMPARE_RESULT 1)
+ endif ()
endif ()
- endif ()
- if (TEST_RESULT)
- set (TEST_RESULT 0)
- file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
- list (LENGTH test_act len_act)
- file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
- list (LENGTH test_ref len_ref)
- if (len_act GREATER 0 AND len_ref GREATER 0)
- math (EXPR _FP_LEN "${len_ref} - 1")
- foreach (line RANGE 0 ${_FP_LEN})
- list (GET test_act ${line} str_act)
- list (GET test_ref ${line} str_ref)
- if (NOT str_act STREQUAL str_ref)
- if (str_act)
- set (TEST_RESULT 1)
- message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ if (TEST_COMPARE_RESULT)
+ set (TEST_COMPARE_RESULT 0)
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
+ list (LENGTH test_act len_act)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
+ list (LENGTH test_ref len_ref)
+ if (len_act GREATER 0 AND len_ref GREATER 0)
+ math (EXPR _FP_LEN "${len_ref} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET test_act ${line} str_act)
+ list (GET test_ref ${line} str_ref)
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
+ set (TEST_COMPARE_RESULT 1)
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ endif ()
endif ()
+ endforeach ()
+ else ()
+ if (len_act EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
+ endif ()
+ if (len_ref EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
endif ()
- endforeach ()
- else ()
- if (len_act EQUAL 0)
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
endif ()
- if (len_ref EQUAL 0)
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
+ if (NOT len_act EQUAL len_ref)
+ set (TEST_COMPARE_RESULT 1)
endif ()
endif ()
- if (NOT len_act EQUAL len_ref)
- set (TEST_RESULT 1)
- endif ()
endif ()
- message (STATUS "COMPARE Result: ${TEST_RESULT}")
+ message (STATUS "COMPARE Result: ${TEST_COMPARE_RESULT}")
# again, if return value is !=0 scream and shout
- if (TEST_RESULT)
+ if (TEST_COMPARE_RESULT)
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
endif ()
endif ()
endif ()
else ()
# else grep the output with the reference
+ set (TEST_GREP_RESULT 0)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
# TEST_REFERENCE should always be matched
string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
- string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
- if (NOT TEST_RESULT)
+ string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_GREP_RESULT)
+ if (NOT TEST_GREP_RESULT)
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
endif ()
endif ()
@@ -176,8 +183,8 @@ if (TEST_FILTER)
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
if (TEST_EXPECT)
# TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
- string (LENGTH "${TEST_MATCH}" TEST_RESULT)
- if (TEST_RESULT)
+ string (LENGTH "${TEST_MATCH}" TEST_GREP_RESULT)
+ if (TEST_GREP_RESULT)
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
endif ()
endif ()
diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake
index 6f633f3..b373fe4 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}")
@@ -90,18 +90,21 @@ message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the .err file exists and ERRROR_APPEND is enabled
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
- if (TEST_MASK_FILE)
- STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
- endif ()
- # remove special output
- string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ if (TEST_MASK_FILE)
+ STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
+ endif ()
+ # remove special output
+ string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
- if (NOT ERROR_APPEND)
- # write back to original .err file
- file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
- else ()
- # append error output to the stdout output file
- file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
+ if (NOT ERROR_APPEND)
+ # write back to original .err file
+ file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
+ else ()
+ # append error output to the stdout output file
+ file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
+ endif ()
endif ()
endif ()
@@ -125,7 +128,7 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
# remove special output
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
-string (FIND "${TEST_STREAM}" "_pmi_alps" TEST_FIND_RESULT)
+string (FIND TEST_STREAM "_pmi_alps" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
@@ -139,7 +142,7 @@ else ()
# the error stack remains in the .err file
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
endif ()
-string (FIND "${TEST_STREAM}" "no version information available" TEST_FIND_RESULT)
+string (FIND TEST_STREAM "no version information available" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*no version information available[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
# write back the changes to the original files
@@ -160,7 +163,7 @@ endif ()
# if the output file needs Modified text removed
if (TEST_MASK_MOD)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
- string (REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
endif ()
@@ -198,147 +201,168 @@ endif ()
if (TEST_REF_FILTER)
#message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}")
file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
- STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
endif ()
# compare output files to references unless this must be skipped
+set (TEST_COMPARE_RESULT 0)
if (NOT TEST_SKIP_COMPARE)
if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
- if (WIN32 OR MINGW)
- configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
- file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
- #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
- #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
- endif ()
+ file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ 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})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ endif ()
- if (NOT TEST_SORT_COMPARE)
- # now compare the output with the reference
- execute_process (
- COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
- RESULT_VARIABLE TEST_RESULT
- )
- else ()
- file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
- file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
- list (SORT v1)
- list (SORT v2)
- if (NOT v1 STREQUAL v2)
- set(TEST_RESULT 1)
+ if (NOT TEST_SORT_COMPARE)
+ # now compare the output with the reference
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
+ RESULT_VARIABLE TEST_COMPARE_RESULT
+ )
+ else ()
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
+ list (SORT v1)
+ list (SORT v2)
+ if (NOT v1 STREQUAL v2)
+ set (TEST_COMPARE_RESULT 1)
+ endif ()
endif ()
- endif ()
- if (TEST_RESULT)
- set (TEST_RESULT 0)
- file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
- list (LENGTH test_act len_act)
- file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
- list (LENGTH test_ref len_ref)
- if (len_act GREATER 0 AND len_ref GREATER 0)
- math (EXPR _FP_LEN "${len_ref} - 1")
- foreach (line RANGE 0 ${_FP_LEN})
- list (GET test_act ${line} str_act)
- list (GET test_ref ${line} str_ref)
- if (NOT str_act STREQUAL str_ref)
- if (str_act)
- set (TEST_RESULT 1)
- message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ if (TEST_COMPARE_RESULT)
+ set (TEST_COMPARE_RESULT 0)
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
+ list (LENGTH test_act len_act)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
+ list (LENGTH test_ref len_ref)
+ if (NOT len_act EQUAL len_ref)
+ set (TEST_COMPARE_RESULT 1)
+ endif ()
+ if (len_act GREATER 0 AND len_ref GREATER 0)
+ if (TEST_SORT_COMPARE)
+ list (SORT test_act)
+ list (SORT test_ref)
+ endif ()
+ math (EXPR _FP_LEN "${len_ref} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET test_act ${line} str_act)
+ list (GET test_ref ${line} str_ref)
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
+ set (TEST_COMPARE_RESULT 1)
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ endif ()
endif ()
+ endforeach ()
+ else ()
+ if (len_act EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
+ endif ()
+ if (len_ref EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
endif ()
- endforeach ()
- else ()
- if (len_act EQUAL 0)
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
- endif ()
- if (len_ref EQUAL 0)
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
endif ()
endif ()
- if (NOT len_act EQUAL len_ref)
- set (TEST_RESULT 1)
- endif ()
endif ()
- message (STATUS "COMPARE Result: ${TEST_RESULT}")
+ message (STATUS "COMPARE Result: ${TEST_COMPARE_RESULT}")
# again, if return value is !=0 scream and shout
- if (TEST_RESULT)
+ if (TEST_COMPARE_RESULT)
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
endif ()
endif ()
# now compare the .err file with the error reference, if supplied
+ set (TEST_ERRREF_RESULT 0)
if (TEST_ERRREF)
- if (WIN32 OR MINGW)
- configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF)
- file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF})
- #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
- #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
- endif ()
+ file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ 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})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
+ endif ()
- # now compare the error output with the error reference
- execute_process (
- COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
- RESULT_VARIABLE TEST_RESULT
- )
- if (TEST_RESULT)
- set (TEST_RESULT 0)
- file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
- list (LENGTH test_act len_act)
- file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
- list (LENGTH test_ref len_ref)
- math (EXPR _FP_LEN "${len_ref} - 1")
- if (len_act GREATER 0 AND len_ref GREATER 0)
+ # now compare the error output with the error reference
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
+ RESULT_VARIABLE TEST_ERRREF_RESULT
+ )
+ if (TEST_ERRREF_RESULT)
+ set (TEST_ERRREF_RESULT 0)
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
+ list (LENGTH test_act len_act)
+ file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
+ list (LENGTH test_ref len_ref)
math (EXPR _FP_LEN "${len_ref} - 1")
- foreach (line RANGE 0 ${_FP_LEN})
- list (GET test_act ${line} str_act)
- list (GET test_ref ${line} str_ref)
- if (NOT str_act STREQUAL str_ref)
- if (str_act)
- set (TEST_RESULT 1)
- message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ if (len_act GREATER 0 AND len_ref GREATER 0)
+ math (EXPR _FP_LEN "${len_ref} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET test_act ${line} str_act)
+ list (GET test_ref ${line} str_ref)
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
+ set (TEST_ERRREF_RESULT 1)
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ endif ()
endif ()
+ endforeach ()
+ else ()
+ if (len_act EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
+ endif ()
+ if (len_ref EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
endif ()
- endforeach ()
- else ()
- if (len_act EQUAL 0)
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
endif ()
- if (len_ref EQUAL 0)
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
+ if (NOT len_act EQUAL len_ref)
+ set (TEST_ERRREF_RESULT 1)
endif ()
endif ()
- if (NOT len_act EQUAL len_ref)
- set (TEST_RESULT 1)
- endif ()
endif ()
- message (STATUS "COMPARE Result: ${TEST_RESULT}")
+ message (STATUS "COMPARE Result: ${TEST_ERRREF_RESULT}")
# again, if return value is !=0 scream and shout
- if (TEST_RESULT)
+ if (TEST_ERRREF_RESULT)
message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}")
endif ()
endif ()
endif ()
+set (TEST_GREP_RESULT 0)
if (TEST_GREP_COMPARE)
# now grep the output with the reference
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ # TEST_REFERENCE should always be matched
+ string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
+ string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_GREP_RESULT)
+ if (NOT TEST_GREP_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
+ endif ()
- # TEST_REFERENCE should always be matched
- string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
- string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
- if (NOT TEST_RESULT)
- message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
- endif ()
-
- string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
- if (TEST_EXPECT)
- # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
- string (LENGTH "${TEST_MATCH}" TEST_RESULT)
- if (TEST_RESULT)
- message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
+ string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
+ if (TEST_EXPECT)
+ # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
+ string (LENGTH "${TEST_MATCH}" TEST_GREP_RESULT)
+ if (TEST_GREP_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
+ endif ()
endif ()
endif ()
endif ()
diff --git a/config/commence.am b/config/commence.am
index a16eee5..3fddc6a 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..e798d8d 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.
@@ -270,6 +270,28 @@ build-check-p: $(LIB) $(PROGS) $(chk_TESTS)
echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\
fi
+VFD_LIST = sec2 stdio core core_paged split multi family splitter
+
+# log VFD currently has file space allocation bugs
+# VFD_LIST += log
+
+if DIRECT_VFD_CONDITIONAL
+ VFD_LIST += direct
+endif
+if BUILD_PARALLEL_CONDITIONAL
+ # MPI I/O VFD is currently incompatible with too many tests in the VFD test set
+ # VFD_LIST += mpio
+endif
+if MIRROR_VFD_CONDITIONAL
+ VFD_LIST += mirror
+endif
+if ROS3_VFD_CONDITIONAL
+ VFD_LIST += ros3
+endif
+if HDFS_VFD_CONDITIONAL
+ VFD_LIST += hdfs
+endif
+
# Run test with different Virtual File Driver
check-vfd: $(LIB) $(PROGS) $(chk_TESTS)
@for vfd in $(VFD_LIST) dummy; do \
@@ -282,6 +304,14 @@ check-vfd: $(LIB) $(PROGS) $(chk_TESTS)
fi; \
done
+# Test with just the native connector, with a single pass-through connector
+# and with a doubly-stacked pass-through.
+#
+# native = 0
+# pass-through = 1
+VOL_LIST = native "pass_through under_vol=0;under_info={}" \
+ "pass_through under_vol=1;under_info={under_vol=0;under_info={}}"
+
# Run test with different passthrough Virtual Object Layer Connector
# NOTE: Will only succeed with passthrough VOL connectors that use
# the native VOL connector as the terminal connector.
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 e0f2999..b544813 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,46 +17,80 @@
# if the compiler is not GNU; otherwise `cxx_flags_set' is set to `yes'
#
+#
+# For now, do not promote any warnings to errors.
+#
+WARNINGS_AS_ERRORS_DFLT=no
+
+#
+# This filter rewrites -Werror= as -W, in that way demoting warnings
+# promoted to errors back to warnings, if WARNINGS_AS_ERRORS is no.
+#
+demote_errors()
+{
+ if [ ${WARNINGS_AS_ERRORS:-${WARNINGS_AS_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} | demote_errors
+ 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
+ # icc beginning with version 12 includes a "gcc version compatibility"
+ # 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' |\
+ grep -v '^icc.*version' |\
grep 'gcc version' | sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"
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,166 @@ 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 -std=c++11"
+
+ ##############
+ # 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)"
- # 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 cxx-developer-4.8)"
+ NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-cxx-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)"
+ 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)"
+ # 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..1333ce5 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"
+ DEVELOPER_WARNING_FCFLAGS="$DEVELOPER_WARNING_FCFLAGS $(load_gnu_arguments developer-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 6355ccf..fe6626d 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.
@@ -17,6 +17,38 @@
# if the compiler is not GNU; otherwise 'cc_flags_set' is set to 'yes'
#
+#
+# For now, do not promote any warnings to errors.
+#
+WARNINGS_AS_ERRORS_DFLT=no
+
+#
+# This filter rewrites -Werror= as -W, in that way demoting warnings
+# promoted to errors back to warnings, if WARNINGS_AS_ERRORS is no.
+#
+demote_errors()
+{
+ if [ ${WARNINGS_AS_ERRORS:-${WARNINGS_AS_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} | demote_errors
+ done)
+ IFS=' ' echo "$*"
+}
+
# Get the compiler version in a way that works for gcc
# unless a compiler version is already known
#
@@ -26,13 +58,13 @@
if test "X-" = "X-$cc_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"
+ # icc beginning with version 12 includes a "gcc version compatibility"
# string, causing the gcc H5_CFLAGS 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
# and flags added in the intel-flags script.
cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 | grep -v 'PathScale' |\
- grep -v 'icc version' |\
+ grep -v '^icc.*version' |\
grep 'gcc version' | sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"
cc_vendor=`echo $cc_version |sed 's/\([a-z]*\).*/\1/'`
cc_version=`echo $cc_version |sed 's/[-a-z]//g'`
@@ -86,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"
;;
@@ -122,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 #
###########
@@ -138,7 +183,7 @@ if test "X-gcc" = "X-$cc_vendor"; then
################
# Optimization #
################
-
+
if test $cc_vers_major -le 4; then
HIGH_OPT_CFLAGS="-O3"
DEBUG_OPT_CFLAGS=
@@ -156,136 +201,83 @@ 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.
- #
- H5_CFLAGS="$H5_CFLAGS -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wcast-align"
- H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal"
- H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Wno-format-nonliteral -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs"
- H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked"
- H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-enum -Wswitch-default"
- H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings"
-
- ######################
- # Developer warnings #
- ######################
-
- # (suggestions from gcc, not code problems)
- # NOTE: -Wformat-nonliteral added back in here (from being disabled in H5_CFLAGS)
- DEVELOPER_WARNING_CFLAGS="-Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn -Wformat-nonliteral"
- NO_DEVELOPER_WARNING_CFLAGS="-Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn"
-
- #######################
- # gcc 4 special cases #
- #######################
+ # 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)"
- # 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
+ ######################
+ # Developer warnings #
+ ######################
- # -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
+ NO_DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments no-developer-general)
+ DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments developer-general)
- # -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)"
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)"
+ 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
#################
@@ -299,3 +291,4 @@ if test "X$cc_flags_set" = "X"; then
cc_vendor=
cc_version=
fi
+
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-developer-4.8 b/config/gnu-warnings/cxx-developer-4.8
new file mode 100644
index 0000000..e0d975f
--- /dev/null
+++ b/config/gnu-warnings/cxx-developer-4.8
@@ -0,0 +1,16 @@
+# developer warning flags added for GCC >= 4.5
+#
+# 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/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..1626524
--- /dev/null
+++ b/config/gnu-warnings/cxx-general
@@ -0,0 +1,30 @@
+# 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
+-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/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
new file mode 100644
index 0000000..460b874
--- /dev/null
+++ b/config/gnu-warnings/developer-general
@@ -0,0 +1,10 @@
+# (suggestions from gcc, not code problems)
+-Waggregate-return
+-Wdisabled-optimization
+-Winline
+-Wmissing-format-attribute
+-Wmissing-noreturn
+-Wswitch-default
+-Wswitch-enum
+-Wunsafe-loop-optimizations
+-Wunused-macros
diff --git a/config/gnu-warnings/developer-gfort-5 b/config/gnu-warnings/developer-gfort-5
new file mode 100644
index 0000000..c5d3850
--- /dev/null
+++ b/config/gnu-warnings/developer-gfort-5
@@ -0,0 +1 @@
+-Wuse-without-only
diff --git a/config/gnu-warnings/error-5 b/config/gnu-warnings/error-5
new file mode 100644
index 0000000..282ee3f
--- /dev/null
+++ b/config/gnu-warnings/error-5
@@ -0,0 +1,13 @@
+-Werror=incompatible-pointer-types
+-Werror=int-conversion
+#
+# 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..cbb25f6
--- /dev/null
+++ b/config/gnu-warnings/error-8
@@ -0,0 +1,22 @@
+-Werror=cast-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..a66d284
--- /dev/null
+++ b/config/gnu-warnings/error-general
@@ -0,0 +1,91 @@
+#
+# 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=int-to-pointer-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
new file mode 100644
index 0000000..df4c613
--- /dev/null
+++ b/config/gnu-warnings/general
@@ -0,0 +1,26 @@
+# 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
+-Wextra
+-Wfloat-equal
+-Wformat=2
+-Winit-self
+-Winvalid-pch
+-Wmissing-include-dirs
+-Wshadow
+-Wundef
+-Wwrite-strings
+-pedantic
+# 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
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-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/gnu-warnings/gfort-general b/config/gnu-warnings/gfort-general
new file mode 100644
index 0000000..4028316
--- /dev/null
+++ b/config/gnu-warnings/gfort-general
@@ -0,0 +1,12 @@
+# 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.
+-Waliasing
+-Wall
+-Wcharacter-truncation
+-Wextra
+-Wimplicit-interface
+-Wsurprising
+-Wunderflow
+-pedantic
diff --git a/config/gnu-warnings/no-cxx-developer-4.8 b/config/gnu-warnings/no-cxx-developer-4.8
new file mode 100644
index 0000000..3c3de93
--- /dev/null
+++ b/config/gnu-warnings/no-cxx-developer-4.8
@@ -0,0 +1,9 @@
+# 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-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/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..107b087
--- /dev/null
+++ b/config/intel-cxxflags
@@ -0,0 +1,185 @@
+# -*- 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 #
+ ###########
+
+ # Default to C++11 standard
+ H5_CXXFLAGS="$H5_CXXFLAGS $arch -std=c++11"
+
+ ##############
+ # 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 dad210c..f46da0a 100644
--- a/config/intel-flags
+++ b/config/intel-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.
@@ -17,6 +17,20 @@
# if the compiler is not Intel; otherwise `cc_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 icc
# icc unless a compiler version is already known
#
@@ -64,54 +78,101 @@ if test "X-icc" = "X-$cc_vendor"; then
# ;;
#esac
- # General
+ ###########
+ # General #
+ ###########
+
# Default to C99 standard.
- H5_CFLAGS="$H5_CFLAGS $arch -std=c99 -Wcheck -Wall"
+ H5_CFLAGS="$H5_CFLAGS $arch -std=c99"
+
+ ##############
+ # 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..02bcdea
--- /dev/null
+++ b/config/intel-warnings/18
@@ -0,0 +1,2 @@
+-Wic-pointer
+-Wsign-compare
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/ifort-general b/config/intel-warnings/ifort-general
new file mode 100644
index 0000000..1644c7c
--- /dev/null
+++ b/config/intel-warnings/ifort-general
@@ -0,0 +1 @@
+-warn all
diff --git a/config/intel-warnings/win-developer-general b/config/intel-warnings/win-developer-general
new file mode 100644
index 0000000..6cd7ed7
--- /dev/null
+++ b/config/intel-warnings/win-developer-general
@@ -0,0 +1 @@
+/Wport
diff --git a/config/intel-warnings/win-general b/config/intel-warnings/win-general
new file mode 100644
index 0000000..ef54b2b
--- /dev/null
+++ b/config/intel-warnings/win-general
@@ -0,0 +1 @@
+/Wall
diff --git a/config/intel-warnings/win-ifort-general b/config/intel-warnings/win-ifort-general
new file mode 100644
index 0000000..a335959
--- /dev/null
+++ b/config/intel-warnings/win-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 fcc2a40..22f4c89 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.
##
diff --git a/config/netbsd b/config/netbsd
new file mode 100644
index 0000000..dae3734
--- /dev/null
+++ b/config/netbsd
@@ -0,0 +1,56 @@
+# -*- 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 is part of the HDF5 build script. It is processed shortly
+# after configure starts and defines, among other things, flags for
+# the various compile modes.
+#
+# See BlankForm in this directory for details.
+
+# The default compiler is `gcc'
+if test "X-" = "X-$CC"; then
+ CC=gcc
+ CC_BASENAME=gcc
+fi
+
+# Figure out C compiler flags
+. $srcdir/config/gnu-flags
+
+# Figure out Intel C compiler flags
+. $srcdir/config/intel-flags
+
+# The default Fortran 90 compiler
+if test "X-" = "X-$FC"; then
+ case $CC_BASENAME in
+ gcc*|pgcc*)
+ FC=gfortran
+ FC_BASENAME=gfortran
+ ;;
+ icc*)
+ FC=ifort
+ FC_BASENAME=ifort
+ ;;
+ mpicc*)
+ FC=mpif90
+ FC_BASENAME=mpif90
+ ;;
+ esac
+fi
+
+# Figure out FORTRAN compiler flags
+. $srcdir/config/gnu-fflags
+
+# Figure out Intel F90 compiler flags
+. $srcdir/config/intel-fflags
+
diff --git a/config/pgi-cxxflags b/config/pgi-cxxflags
new file mode 100644
index 0000000..7d8bdeb
--- /dev/null
+++ b/config/pgi-cxxflags
@@ -0,0 +1,101 @@
+# -*- 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 #
+ ###########
+
+ # Default to C++11 standard
+ H5_CXXFLAGS="$H5_CXXFLAGS -std=c++11 -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/LICENSE b/config/sanitizer/LICENSE
new file mode 100644
index 0000000..895657b
--- /dev/null
+++ b/config/sanitizer/LICENSE
@@ -0,0 +1,174 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability. \ No newline at end of file
diff --git a/config/sanitizer/README.md b/config/sanitizer/README.md
new file mode 100644
index 0000000..0d5fb6c
--- /dev/null
+++ b/config/sanitizer/README.md
@@ -0,0 +1,307 @@
+# CMake Scripts <!-- omit in toc -->
+
+[![pipeline status](https://git.stabletec.com/other/cmake-scripts/badges/master/pipeline.svg)](https://git.stabletec.com/other/cmake-scripts/commits/master)
+[![license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://git.stabletec.com/other/cmake-scripts/blob/master/LICENSE)
+
+This is a collection of quite useful scripts that expand the possibilities for building software with CMake, by making some things easier and otherwise adding new build types
+
+- [C++ Standards `c++-standards.cmake`](#c-standards-c-standardscmake)
+- [Sanitizer Builds `sanitizers.cmake`](#sanitizer-builds-sanitizerscmake)
+- [Code Coverage `code-coverage.cmake`](#code-coverage-code-coveragecmake)
+ - [Added Targets](#added-targets)
+ - [Usage](#usage)
+ - [Example 1 - All targets instrumented](#example-1---all-targets-instrumented)
+ - [1a - Via global command](#1a---via-global-command)
+ - [1b - Via target commands](#1b---via-target-commands)
+ - [Example 2: Target instrumented, but with regex pattern of files to be excluded from report](#example-2-target-instrumented-but-with-regex-pattern-of-files-to-be-excluded-from-report)
+ - [Example 3: Target added to the 'ccov' and 'ccov-all' targets](#example-3-target-added-to-the-ccov-and-ccov-all-targets)
+- [Compiler Options `compiler-options.cmake`](#compiler-options-compiler-optionscmake)
+- [Dependency Graph `dependency-graph.cmake`](#dependency-graph-dependency-graphcmake)
+ - [Required Arguments](#required-arguments)
+ - [OUTPUT_TYPE *STR*](#output_type-str)
+ - [Optional Arguments](#optional-arguments)
+ - [ADD_TO_DEP_GRAPH](#add_to_dep_graph)
+ - [TARGET_NAME *STR*](#target_name-str)
+ - [OUTPUT_DIR *STR*](#output_dir-str)
+- [Doxygen `doxygen.cmake`](#doxygen-doxygencmake)
+ - [Optional Arguments](#optional-arguments-1)
+ - [ADD_TO_DOC](#add_to_doc)
+ - [INSTALLABLE](#installable)
+ - [PROCESS_DOXYFILE](#process_doxyfile)
+ - [TARGET_NAME *STR*](#target_name-str-1)
+ - [OUTPUT_DIR *STR*](#output_dir-str-1)
+ - [INSTALL_PATH *STR*](#install_path-str)
+ - [DOXYFILE_PATH *STR*](#doxyfile_path-str)
+- [Prepare the Catch Test Framework `prepare_catch.cmake`](#prepare-the-catch-test-framework-prepare_catchcmake)
+ - [Optional Arguments](#optional-arguments-2)
+ - [COMPILED_CATCH](#compiled_catch)
+ - [CATCH1](#catch1)
+ - [CLONE](#clone)
+- [Tools `tools.cmake`](#tools-toolscmake)
+ - [clang-tidy](#clang-tidy)
+ - [include-what-you-use](#include-what-you-use)
+ - [cppcheck](#cppcheck)
+- [Formatting `formatting.cmake`](#formatting-formattingcmake)
+ - [clang-format](#clang-format)
+ - [cmake-format](#cmake-format)
+
+## C++ Standards [`c++-standards.cmake`](c++-standards.cmake)
+
+Using the functions `cxx_11()`, `cxx_14()`, `cxx_17()` or `cxx_20()` this adds the appropriate flags for both unix and MSVC compilers, even for those before 3.11 with improper support.
+
+These obviously force the standard to be required, and also disables compiler-specific extensions, ie `--std=gnu++11`. This helps to prevent fragmenting the code base with items not available elsewhere, adhering to the agreed C++ standards only.
+
+## Sanitizer Builds [`sanitizers.cmake`](sanitizers.cmake)
+
+Sanitizers are tools that perform checks during a program’s runtime and returns issues, and as such, along with unit testing, code coverage and static analysis, is another tool to add to the programmers toolbox. And of course, like the previous tools, are tragically simple to add into any project using CMake, allowing any project and developer to quickly and easily use.
+
+A quick rundown of the tools available, and what they do:
+- [LeakSanitizer](https://clang.llvm.org/docs/LeakSanitizer.html) detects memory leaks, or issues where memory is allocated and never deallocated, causing programs to slowly consume more and more memory, eventually leading to a crash.
+- [AddressSanitizer](https://clang.llvm.org/docs/AddressSanitizer.html) is a fast memory error detector. It is useful for detecting most issues dealing with memory, such as:
+ - Out of bounds accesses to heap, stack, global
+ - Use after free
+ - Use after return
+ - Use after scope
+ - Double-free, invalid free
+ - Memory leaks (using LeakSanitizer)
+- [ThreadSanitizer](https://clang.llvm.org/docs/ThreadSanitizer.html) detects data races for multi-threaded code.
+- [UndefinedBehaviourSanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) detects the use of various features of C/C++ that are explicitly listed as resulting in undefined behaviour. Most notably:
+ - Using misaligned or null pointer.
+ - Signed integer overflow
+ - Conversion to, from, or between floating-point types which would overflow the destination
+ - Division by zero
+ - Unreachable code
+- [MemorySanitizer](https://clang.llvm.org/docs/MemorySanitizer.html) detects uninitialized reads.
+
+These are used by declaring the `USE_SANITIZER` CMake variable as one of:
+- Address
+- Memory
+- MemoryWithOrigins
+- Undefined
+- Thread
+- Address;Undefined
+- Undefined;Address
+- Leak
+
+## Code Coverage [`code-coverage.cmake`](code-coverage.cmake)
+
+![Code Coverage Examples](img/code-cov.png)
+
+> In computer science, test coverage is a measure used to describe the degree to which the source code of a program is executed when a particular test suite runs. A program with high test coverage, measured as a percentage, has had more of its source code executed during testing, which suggests it has a lower chance of containing undetected software bugs compared to a program with low test coverage. Many different metrics can be used to calculate test coverage; some of the most basic are the percentage of program subroutines and the percentage of program statements called during execution of the test suite.
+>
+> [Wikipedia, Code Coverage](https://en.wikipedia.org/wiki/Code_coverage)
+
+Code coverage is the detailing of, during the execution of a binary, which regions, functions, or lines of code are *actually* executed. This can be used in a number of ways, from figuring out areas that automated testing is lacking or not touching, to giving a user an instrumented binary to determine which areas of code are used most/least to determine which areas to focus on. Although this does come with the caveat that coverage is no guarantee of good testing, just of what code has been.
+
+Coverage here is supported on both GCC and Clang. GCC requires the `lcov` program, and Clang requires `llvm-cov` and `llvm-profdata`, often provided with the llvm toolchain.
+
+To enable, turn on the `CODE_COVERAGE` variable.
+
+### Added Targets
+
+- GCOV/LCOV:
+ - ccov : Generates HTML code coverage report for every target added with 'AUTO' parameter.
+ - ccov-${TARNGET_NAME} : Generates HTML code coverage report for the associated named target.
+ - ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report.
+ - ccov-all-capture : Generates an all-merged.info file, for use with coverage dashboards (e.g. codecov.io, coveralls).
+- LLVM-COV:
+ - ccov : Generates HTML code coverage report for every target added with 'AUTO' parameter.
+ - ccov-report : Generates HTML code coverage report for every target added with 'AUTO' parameter.
+ - ccov-${TARGET_NAME} : Generates HTML code coverage report.
+ - ccov-rpt-${TARGET_NAME} : Prints to command line summary per-file coverage information.
+ - ccov-show-${TARGET_NAME} : Prints to command line detailed per-line coverage information.
+ - ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report.
+ - ccov-all-report : Prints summary per-file coverage information for every target added with ALL' parameter to the command line.
+
+### Usage
+
+To enable any code coverage instrumentation/targets, the single CMake option of `CODE_COVERAGE` needs to be set to 'ON', either by GUI, ccmake, or on the command line ie `-DCODE_COVERAGE=ON`.
+
+From this point, there are two primary methods for adding instrumentation to targets:
+1. A blanket instrumentation by calling `add_code_coverage()`, where all targets in that directory and all subdirectories are automatically instrumented.
+2. Per-target instrumentation by calling `target_code_coverage(<TARGET_NAME>)`, where the target is given and thus only that target is instrumented. This applies to both libraries and executables.
+
+To add coverage targets, such as calling `make ccov` to generate the actual coverage information for perusal or consumption, call `target_code_coverage(<TARGET_NAME>)` on an *executable* target.
+
+**NOTE:** For more options, please check the actual [`code-coverage.cmake`](code-coverage.cmake) file.
+
+#### Example 1 - All targets instrumented
+
+In this case, the coverage information reported will will be that of the `theLib` library target and `theExe` executable.
+
+##### 1a - Via global command
+
+```
+add_code_coverage() # Adds instrumentation to all targets
+
+add_library(theLib lib.cpp)
+
+add_executable(theExe main.cpp)
+target_link_libraries(theExe PRIVATE theLib)
+target_code_coverage(theExe) # As an executable target, adds the 'ccov-theExe' target (instrumentation already added via global anyways) for generating code coverage reports.
+```
+
+##### 1b - Via target commands
+
+```
+add_library(theLib lib.cpp)
+target_code_coverage(theLib) # As a library target, adds coverage instrumentation but no targets.
+
+add_executable(theExe main.cpp)
+target_link_libraries(theExe PRIVATE theLib)
+target_code_coverage(theExe) # As an executable target, adds the 'ccov-theExe' target and instrumentation for generating code coverage reports.
+```
+
+#### Example 2: Target instrumented, but with regex pattern of files to be excluded from report
+
+```
+add_executable(theExe main.cpp non_covered.cpp)
+target_code_coverage(theExe EXCLUDE non_covered.cpp) # As an executable target, the reports will exclude the non-covered.cpp file.
+```
+
+#### Example 3: Target added to the 'ccov' and 'ccov-all' targets
+
+```
+add_code_coverage_all_targets(EXCLUDE test/*) # Adds the 'ccov-all' target set and sets it to exclude all files in test/ folders.
+
+add_executable(theExe main.cpp non_covered.cpp)
+target_code_coverage(theExe AUTO ALL EXCLUDE non_covered.cpp test/*) # As an executable target, adds to the 'ccov' and ccov-all' targets, and the reports will exclude the non-covered.cpp file, and any files in a test/ folder.
+```
+
+## Compiler Options [`compiler-options.cmake`](compiler-options.cmake)
+
+Allows for easy use of some pre-made compiler options for the major compilers.
+
+Using `-DENABLE_ALL_WARNINGS=ON` will enable almost all of the warnings available for a compiler:
+
+| Compiler | Options |
+| :------- | :------------ |
+| MSVC | /W4 |
+| GCC | -Wall -Wextra |
+| Clang | -Wall -Wextra |
+
+Using `-DENABLE_EFFECTIVE_CXX=ON` adds the `-Weffc++` for both GCC and clang.
+
+Using `-DGENERATE_DEPENDENCY_DATA=ON` generates `.d` files along with regular object files on a per-source file basis on GCC/Clang compilers. These files contains the list of all header files used during compilation of that compilation unit.
+
+## Dependency Graph [`dependency-graph.cmake`](dependency-graph.cmake)
+
+CMake, with the dot application available, will build a visual representation of the library/executable dependencies, like so:
+![Dependency Graph](img/dp-graph.png)
+
+### Required Arguments
+
+#### OUTPUT_TYPE *STR*
+The type of output of `dot` to produce. Can be whatever `dot` itself supports (eg. png, ps, pdf).
+
+### Optional Arguments
+
+#### ADD_TO_DEP_GRAPH
+If specified, add this generated target to be a dependency of the more general `dep-graph` target.
+
+#### TARGET_NAME *STR*
+The name to give the doc target. (Default: doc-${PROJECT_NAME})
+
+#### OUTPUT_DIR *STR*
+The directory to place the generated output
+
+## Doxygen [`doxygen.cmake`](doxygen.cmake)
+
+Builds doxygen documentation with a default 'Doxyfile.in' or with a specified one, and can make the results installable (under the `doc` install target)
+
+This can only be used once per project, as each target generated is as `doc-${PROJECT_NAME}` unless TARGET_NAME is specified.
+
+### Optional Arguments
+
+#### ADD_TO_DOC
+If specified, adds this generated target to be a dependency of the more general `doc` target.
+
+#### INSTALLABLE
+Adds the generated documentation to the generic `install` target, under the `documentation` installation group.
+
+#### PROCESS_DOXYFILE
+If set, then will process the found Doxyfile through the CMAKE `configure_file` function for macro replacements before using it. (@ONLY)
+
+#### TARGET_NAME *STR*
+The name to give the doc target. (Default: doc-${PROJECT_NAME})
+
+#### OUTPUT_DIR *STR*
+The directory to place the generated output. (Default: ${CMAKE_CURRENT_BINARY_DIR}/doc)
+
+#### INSTALL_PATH *STR*
+The path to install the documenttation under. (if not specified, defaults to 'share/${PROJECT_NAME})
+
+#### DOXYFILE_PATH *STR*
+The given doxygen file to use/process. (Defaults to'${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile')
+
+## Prepare the Catch Test Framework [`prepare_catch.cmake`](prepare_catch.cmake)
+
+The included `prepare_catch` function contained within attempts to add the infrastructure necessary for automatically adding C/C++ tests using the Catch2 library, including either an interface or pre-compiled 'catch' target library.
+
+It first attempts to find the header on the local machine, and failing that, clones the single header variant for use. It does make the determination between pre-C++11 and will use Catch1.X rather than Catch2 (when cloned), automatically or forced.. Adds a subdirectory of tests/ if it exists from the macro's calling location.
+
+### Optional Arguments
+
+#### COMPILED_CATCH
+If this option is specified, then generates the 'catch' target as a library with catch already pre-compiled as part of the library. Otherwise acts just an interface library for the header location.
+
+#### CATCH1
+Force the use of Catch1.X, rather than auto-detecting the C++ version in use.
+
+#### CLONE
+Force cloning of Catch, rather than attempting to use a locally-found variant.
+
+## Tools [`tools.cmake`](tools.cmake)
+
+### clang-tidy
+
+> clang-tidy is a clang-based C++ “linter” tool. Its purpose is to provide an extensible framework for diagnosing and fixing typical programming errors, like style violations, interface misuse, or bugs that can be deduced via static analysis. clang-tidy is modular and provides a convenient interface for writing new checks.
+>
+> [clang-tidy page](https://clang.llvm.org/extra/clang-tidy/)
+
+When detected, [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) can be enabled by using the option of `-DCLANG_TIDY=ON`, as it is disabled by default.
+
+To use, add the `clang_tidy()` function, with the arguments being the options to pass to the clang tidy program, such as '-checks=*'.
+
+### include-what-you-use
+
+This tool helps to organize headers for all files encompass all items being used in that file, without accidentally relying upon headers deep down a chain of other headers. This is disabled by default, and can be enabled via have the program installed and adding `-DIWYU=ON`.
+
+To use, add the `include_what_you_use()` function, with the arguments being the options to pass to the program.
+
+### cppcheck
+
+This tool is another static analyzer in the vein of clang-tidy, which focuses on having no false positives. This is by default disabled, and can be enabled via have the program installed and adding `-DCPPCHECK=ON`.
+
+To use, add the `cppcheck()` function, with the arguments being the options to pass to the program.
+
+## Formatting [`formatting.cmake`](formatting.cmake)
+
+### clang-format
+
+Allows to automatically perform code formatting using the clang-format program, by calling an easy-to-use target ala `make format`. It requires a target name, and the list of files to format. As well, if the target name is the name of another target, then all files associated with that target will be added, and the target name changed to be `format_<TARGET>`. As well, any targets otherwise listed with the files will also have their files imported for formatting.
+
+```
+file(GLOB_RECURSE ALL_CODE_FILES
+ ${PROJECT_SOURCE_DIR}/src/*.[ch]pp
+ ${PROJECT_SOURCE_DIR}/src/*.[ch]
+ ${PROJECT_SOURCE_DIR}/include/*.[h]pp
+ ${PROJECT_SOURCE_DIR}/include/*.[h]
+ ${PROJECT_SOURCE_DIR}/example/*.[ch]pp
+ ${PROJECT_SOURCE_DIR}/example/*.[ch]
+)
+
+clang_format(TARGET_NAME ${ALL_CODE_FILES})
+```
+
+### cmake-format
+
+Similar to the clang-format above, creates a target `cmake-format` when the `cmake_format(<FILES>)` function is defined in CMake scripts, and any <FILES> passed in will be formatted by the cmake-format program, if it is found.
+
+```
+file(GLOB_RECURSE CMAKE_FILES
+ CMakeLists.txt
+)
+
+cmake_format(TARGET_NAME ${CMAKE_FILES})
+``` \ No newline at end of file
diff --git a/config/sanitizer/code-coverage.cmake b/config/sanitizer/code-coverage.cmake
new file mode 100644
index 0000000..e71bfd7
--- /dev/null
+++ b/config/sanitizer/code-coverage.cmake
@@ -0,0 +1,537 @@
+#
+# Copyright (C) 2018 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.
+
+# USAGE: To enable any code coverage instrumentation/targets, the single CMake
+# option of `CODE_COVERAGE` needs to be set to 'ON', either by GUI, ccmake, or
+# on the command line.
+#
+# From this point, there are two primary methods for adding instrumentation to
+# targets: 1 - A blanket instrumentation by calling `add_code_coverage()`, where
+# all targets in that directory and all subdirectories are automatically
+# instrumented. 2 - Per-target instrumentation by calling
+# `target_code_coverage(<TARGET_NAME>)`, where the target is given and thus only
+# that target is instrumented. This applies to both libraries and executables.
+#
+# To add coverage targets, such as calling `make ccov` to generate the actual
+# coverage information for perusal or consumption, call
+# `target_code_coverage(<TARGET_NAME>)` on an *executable* target.
+#
+# Example 1: All targets instrumented
+#
+# In this case, the coverage information reported will will be that of the
+# `theLib` library target and `theExe` executable.
+#
+# 1a: Via global command
+#
+# ~~~
+# add_code_coverage() # Adds instrumentation to all targets
+#
+# add_library(theLib lib.cpp)
+#
+# add_executable(theExe main.cpp)
+# target_link_libraries(theExe PRIVATE theLib)
+# target_code_coverage(theExe) # As an executable target, adds the 'ccov-theExe' target (instrumentation already added via global anyways) for generating code coverage reports.
+# ~~~
+#
+# 1b: Via target commands
+#
+# ~~~
+# add_library(theLib lib.cpp)
+# target_code_coverage(theLib) # As a library target, adds coverage instrumentation but no targets.
+#
+# add_executable(theExe main.cpp)
+# target_link_libraries(theExe PRIVATE theLib)
+# target_code_coverage(theExe) # As an executable target, adds the 'ccov-theExe' target and instrumentation for generating code coverage reports.
+# ~~~
+#
+# Example 2: Target instrumented, but with regex pattern of files to be excluded
+# from report
+#
+# ~~~
+# add_executable(theExe main.cpp non_covered.cpp)
+# target_code_coverage(theExe EXCLUDE non_covered.cpp test/*) # As an executable target, the reports will exclude the non-covered.cpp file, and any files in a test/ folder.
+# ~~~
+#
+# Example 3: Target added to the 'ccov' and 'ccov-all' targets
+#
+# ~~~
+# add_code_coverage_all_targets(EXCLUDE test/*) # Adds the 'ccov-all' target set and sets it to exclude all files in test/ folders.
+#
+# add_executable(theExe main.cpp non_covered.cpp)
+# target_code_coverage(theExe AUTO ALL EXCLUDE non_covered.cpp test/*) # As an executable target, adds to the 'ccov' and ccov-all' targets, and the reports will exclude the non-covered.cpp file, and any files in a test/ folder.
+# ~~~
+
+# Options
+option(
+ CODE_COVERAGE
+ "Builds targets with code coverage instrumentation. (Requires GCC or Clang)"
+ OFF)
+
+# Programs
+if(WIN32)
+ find_program(LLVM_COV_PATH llvm-cov PATHS ENV VS2019INSTALLDIR PATH_SUFFIXES "VC/Tools/Llvm/x64/bin")
+ find_program(LLVM_PROFDATA_PATH llvm-profdata PATHS ENV VS2019INSTALLDIR PATH_SUFFIXES "VC/Tools/Llvm/x64/bin")
+ find_program(LCOV_PATH lcov PATHS ENV VS2019INSTALLDIR PATH_SUFFIXES "VC/Tools/Llvm/x64/bin")
+ find_program(GENHTML_PATH genhtml PATHS ENV VS2019INSTALLDIR PATH_SUFFIXES "VC/Tools/Llvm/x64/bin")
+else()
+ find_program(LLVM_COV_PATH llvm-cov)
+ find_program(LLVM_PROFDATA_PATH llvm-profdata)
+ find_program(LCOV_PATH lcov)
+ find_program(GENHTML_PATH genhtml)
+endif()
+
+# Variables
+set(CMAKE_COVERAGE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/ccov)
+
+# Common initialization/checks
+if(CODE_COVERAGE AND NOT CODE_COVERAGE_ADDED)
+ set(CODE_COVERAGE_ADDED ON)
+
+ # Common Targets
+ add_custom_target(
+ ccov-preprocessing
+ COMMAND ${CMAKE_COMMAND} -E make_directory
+ ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}
+ DEPENDS ccov-clean)
+
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ # Messages
+ message(STATUS "Building with llvm Code Coverage Tools")
+
+ if(NOT LLVM_COV_PATH)
+ message(FATAL_ERROR "llvm-cov not found! Aborting.")
+ else()
+ # Version number checking for 'EXCLUDE' compatibility
+ execute_process(COMMAND ${LLVM_COV_PATH} --version
+ OUTPUT_VARIABLE LLVM_COV_VERSION_CALL_OUTPUT)
+ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" LLVM_COV_VERSION
+ ${LLVM_COV_VERSION_CALL_OUTPUT})
+
+ if(LLVM_COV_VERSION VERSION_LESS "7.0.0")
+ message(
+ WARNING
+ "target_code_coverage()/add_code_coverage_all_targets() 'EXCLUDE' option only available on llvm-cov >= 7.0.0"
+ )
+ endif()
+ endif()
+
+ # Targets
+ add_custom_target(
+ ccov-clean
+ COMMAND rm -f ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list
+ COMMAND rm -f ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list)
+
+ # Used to get the shared object file list before doing the main all-
+ # processing
+ add_custom_target(
+ ccov-libs
+ COMMAND ;
+ COMMENT "libs ready for coverage report.")
+
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ # Messages
+ message(STATUS "Building with lcov Code Coverage Tools")
+
+ if(CMAKE_BUILD_TYPE)
+ string(TOUPPER ${CMAKE_BUILD_TYPE} upper_build_type)
+ if(NOT ${upper_build_type} STREQUAL "DEBUG")
+ message(
+ WARNING
+ "Code coverage results with an optimized (non-Debug) build may be misleading"
+ )
+ endif()
+ else()
+ message(
+ WARNING
+ "Code coverage results with an optimized (non-Debug) build may be misleading"
+ )
+ endif()
+ if(NOT LCOV_PATH)
+ message(FATAL_ERROR "lcov not found! Aborting...")
+ endif()
+ if(NOT GENHTML_PATH)
+ message(FATAL_ERROR "genhtml not found! Aborting...")
+ endif()
+
+ # Targets
+ add_custom_target(ccov-clean COMMAND ${LCOV_PATH} --directory
+ ${CMAKE_BINARY_DIR} --zerocounters)
+
+ else()
+ set(CODE_COVERAGE_ADDED OFF)
+ message(STATUS "Code coverage requires Clang or GCC.(${CMAKE_C_COMPILER_ID})")
+ endif()
+endif()
+
+# Adds code coverage instrumentation to a library, or instrumentation/targets
+# for an executable target.
+# ~~~
+# EXECUTABLE ADDED TARGETS:
+# GCOV/LCOV:
+# ccov : Generates HTML code coverage report for every target added with 'AUTO' parameter.
+# ccov-${TARGET_NAME} : Generates HTML code coverage report for the associated named target.
+# ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report.
+#
+# LLVM-COV:
+# ccov : Generates HTML code coverage report for every target added with 'AUTO' parameter.
+# ccov-report : Generates HTML code coverage report for every target added with 'AUTO' parameter.
+# ccov-${TARGET_NAME} : Generates HTML code coverage report.
+# ccov-report-${TARGET_NAME} : Prints to command line summary per-file coverage information.
+# ccov-show-${TARGET_NAME} : Prints to command line detailed per-line coverage information.
+# ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report.
+# ccov-all-report : Prints summary per-file coverage information for every target added with ALL' parameter to the command line.
+#
+# Required:
+# TARGET_NAME - Name of the target to generate code coverage for.
+# Optional:
+# AUTO - Adds the target to the 'ccov' target so that it can be run in a batch with others easily. Effective on executable targets.
+# ALL - Adds the target to the 'ccov-all' and 'ccov-all-report' targets, which merge several executable targets coverage data to a single report. Effective on executable targets.
+# EXTERNAL - For GCC's lcov, allows the profiling of 'external' files from the processing directory
+# EXCLUDE <REGEX_PATTERNS> - Excludes files of the patterns provided from coverage. **These do not copy to the 'all' targets.**
+# OBJECTS <TARGETS> - For executables ONLY, if the provided targets are shared libraries, adds coverage information to the output
+# ~~~
+function(target_code_coverage TARGET_NAME)
+ # Argument parsing
+ set(options AUTO ALL EXTERNAL)
+ set(multi_value_keywords EXCLUDE OBJECTS)
+ cmake_parse_arguments(target_code_coverage "${options}" ""
+ "${multi_value_keywords}" ${ARGN})
+
+ if(CODE_COVERAGE)
+
+ # Add code coverage instrumentation to the target's linker command
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ target_compile_options(${TARGET_NAME} PRIVATE -fprofile-instr-generate
+ -fcoverage-mapping)
+ set_property(
+ TARGET ${TARGET_NAME}
+ APPEND_STRING
+ PROPERTY LINK_FLAGS "-fprofile-instr-generate ")
+ set_property(
+ TARGET ${TARGET_NAME}
+ APPEND_STRING
+ PROPERTY LINK_FLAGS "-fcoverage-mapping ")
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ target_compile_options(${TARGET_NAME} PRIVATE -fprofile-arcs
+ -ftest-coverage)
+ target_link_libraries(${TARGET_NAME} PRIVATE gcov)
+ endif()
+
+ # Targets
+ get_target_property(target_type ${TARGET_NAME} TYPE)
+
+ # Add shared library to processing for 'all' targets
+ if(target_type STREQUAL "SHARED_LIBRARY" AND target_code_coverage_ALL)
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ add_custom_target(
+ ccov-run-${TARGET_NAME}
+ COMMAND echo "-object=$<TARGET_FILE:${TARGET_NAME}>" >>
+ ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list
+ DEPENDS ccov-preprocessing ${TARGET_NAME})
+
+ if(NOT TARGET ccov-libs)
+ message(
+ FATAL_ERROR
+ "Calling target_code_coverage with 'ALL' must be after a call to 'add_code_coverage_all_targets'."
+ )
+ endif()
+
+ add_dependencies(ccov-libs ccov-run-${TARGET_NAME})
+ endif()
+ endif()
+
+ # For executables add targets to run and produce output
+ if(target_type STREQUAL "EXECUTABLE")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Cc]lang")
+
+ # If there are shared objects to also work with, generate the string to
+ # add them here
+ foreach(SO_TARGET ${target_code_coverage_OBJECTS})
+ # Check to see if the target is a shared object
+ if(TARGET ${SO_TARGET})
+ get_target_property(SO_TARGET_TYPE ${SO_TARGET} TYPE)
+ if(${SO_TARGET_TYPE} STREQUAL "SHARED_LIBRARY")
+ set(SO_OBJECTS ${SO_OBJECTS} -object=$<TARGET_FILE:${SO_TARGET}>)
+ endif()
+ endif()
+ endforeach()
+
+ # Run the executable, generating raw profile data
+ add_custom_target(
+ ccov-run-${TARGET_NAME}
+ COMMAND LLVM_PROFILE_FILE=${TARGET_NAME}.profraw
+ $<TARGET_FILE:${TARGET_NAME}>
+ COMMAND echo "-object=$<TARGET_FILE:${TARGET_NAME}>" >>
+ ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list
+ COMMAND echo "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.profraw " >>
+ ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list
+ DEPENDS ccov-preprocessing ccov-libs ${TARGET_NAME})
+
+ # Merge the generated profile data so llvm-cov can process it
+ add_custom_target(
+ ccov-processing-${TARGET_NAME}
+ COMMAND ${LLVM_PROFDATA_PATH} merge -sparse ${TARGET_NAME}.profraw -o
+ ${TARGET_NAME}.profdata
+ DEPENDS ccov-run-${TARGET_NAME})
+
+ # Ignore regex only works on LLVM >= 7
+ if(LLVM_COV_VERSION VERSION_GREATER_EQUAL "7.0.0")
+ foreach(EXCLUDE_ITEM ${target_code_coverage_EXCLUDE})
+ set(EXCLUDE_REGEX ${EXCLUDE_REGEX}
+ -ignore-filename-regex='${EXCLUDE_ITEM}')
+ endforeach()
+ endif()
+
+ # Print out details of the coverage information to the command line
+ add_custom_target(
+ ccov-show-${TARGET_NAME}
+ COMMAND
+ ${LLVM_COV_PATH} show $<TARGET_FILE:${TARGET_NAME}> ${SO_OBJECTS}
+ -instr-profile=${TARGET_NAME}.profdata -show-line-counts-or-regions
+ ${EXCLUDE_REGEX}
+ DEPENDS ccov-processing-${TARGET_NAME})
+
+ # Print out a summary of the coverage information to the command line
+ add_custom_target(
+ ccov-report-${TARGET_NAME}
+ COMMAND ${LLVM_COV_PATH} report $<TARGET_FILE:${TARGET_NAME}>
+ ${SO_OBJECTS} -instr-profile=${TARGET_NAME}.profdata
+ ${EXCLUDE_REGEX}
+ DEPENDS ccov-processing-${TARGET_NAME})
+
+ # Generates HTML output of the coverage information for perusal
+ add_custom_target(
+ ccov-${TARGET_NAME}
+ COMMAND
+ ${LLVM_COV_PATH} show $<TARGET_FILE:${TARGET_NAME}> ${SO_OBJECTS}
+ -instr-profile=${TARGET_NAME}.profdata -show-line-counts-or-regions
+ -output-dir=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${TARGET_NAME}
+ -format="html" ${EXCLUDE_REGEX}
+ DEPENDS ccov-processing-${TARGET_NAME})
+
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ set(COVERAGE_INFO
+ "${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${TARGET_NAME}.info")
+
+ # Run the executable, generating coverage information
+ add_custom_target(
+ ccov-run-${TARGET_NAME}
+ COMMAND $<TARGET_FILE:${TARGET_NAME}>
+ DEPENDS ccov-preprocessing ${TARGET_NAME})
+
+ # Generate exclusion string for use
+ foreach(EXCLUDE_ITEM ${target_code_coverage_EXCLUDE})
+ set(EXCLUDE_REGEX ${EXCLUDE_REGEX} --remove ${COVERAGE_INFO}
+ '${EXCLUDE_ITEM}')
+ endforeach()
+
+ if(EXCLUDE_REGEX)
+ set(EXCLUDE_COMMAND ${LCOV_PATH} ${EXCLUDE_REGEX} --output-file
+ ${COVERAGE_INFO})
+ else()
+ set(EXCLUDE_COMMAND ;)
+ endif()
+
+ if(NOT ${target_code_coverage_EXTERNAL})
+ set(EXTERNAL_OPTION --no-external)
+ endif()
+
+ # Capture coverage data
+ add_custom_target(
+ ccov-capture-${TARGET_NAME}
+ COMMAND ${CMAKE_COMMAND} -E remove ${COVERAGE_INFO}
+ COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters
+ COMMAND $<TARGET_FILE:${TARGET_NAME}>
+ COMMAND
+ ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --base-directory
+ ${CMAKE_SOURCE_DIR} --capture ${EXTERNAL_OPTION} --output-file
+ ${COVERAGE_INFO}
+ COMMAND ${EXCLUDE_COMMAND}
+ DEPENDS ccov-preprocessing ${TARGET_NAME})
+
+ # Generates HTML output of the coverage information for perusal
+ add_custom_target(
+ ccov-${TARGET_NAME}
+ COMMAND ${GENHTML_PATH} -o
+ ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${TARGET_NAME}
+ ${COVERAGE_INFO}
+ DEPENDS ccov-capture-${TARGET_NAME})
+ endif()
+
+ add_custom_command(
+ TARGET ccov-${TARGET_NAME}
+ POST_BUILD
+ COMMAND ;
+ COMMENT
+ "Open ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${TARGET_NAME}/index.html in your browser to view the coverage report."
+ )
+
+ # AUTO
+ if(target_code_coverage_AUTO)
+ if(NOT TARGET ccov)
+ add_custom_target(ccov)
+ endif()
+ add_dependencies(ccov ccov-${TARGET_NAME})
+
+ if(NOT CMAKE_COMPILER_IS_GNUCXX)
+ if(NOT TARGET ccov-report)
+ add_custom_target(ccov-report)
+ endif()
+ add_dependencies(ccov-report ccov-report-${TARGET_NAME})
+ endif()
+ endif()
+
+ # ALL
+ if(target_code_coverage_ALL)
+ if(NOT TARGET ccov-all-processing)
+ message(
+ FATAL_ERROR
+ "Calling target_code_coverage with 'ALL' must be after a call to 'add_code_coverage_all_targets'."
+ )
+ endif()
+
+ add_dependencies(ccov-all-processing ccov-run-${TARGET_NAME})
+ endif()
+ endif()
+ endif()
+endfunction()
+
+# Adds code coverage instrumentation to all targets in the current directory and
+# any subdirectories. To add coverage instrumentation to only specific targets,
+# use `target_code_coverage`.
+function(add_code_coverage)
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ add_compile_options(-fprofile-instr-generate -fcoverage-mapping)
+ add_link_options(-fprofile-instr-generate -fcoverage-mapping)
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ add_compile_options(-fprofile-arcs -ftest-coverage)
+ link_libraries(gcov)
+ endif()
+endfunction()
+
+# Adds the 'ccov-all' type targets that calls all targets added via
+# `target_code_coverage` with the `ALL` parameter, but merges all the coverage
+# data from them into a single large report instead of the numerous smaller
+# reports. Also adds the ccov-all-capture Generates an all-merged.info file, for
+# use with coverage dashboards (e.g. codecov.io, coveralls).
+# ~~~
+# Optional:
+# EXCLUDE <REGEX_PATTERNS> - Excludes files of the regex patterns provided from coverage.
+# ~~~
+function(add_code_coverage_all_targets)
+ # Argument parsing
+ set(multi_value_keywords EXCLUDE)
+ cmake_parse_arguments(add_code_coverage_all_targets "" ""
+ "${multi_value_keywords}" ${ARGN})
+
+ if(CODE_COVERAGE)
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+
+ # Merge the profile data for all of the run executables
+ add_custom_target(
+ ccov-all-processing
+ COMMAND
+ ${LLVM_PROFDATA_PATH} merge -o
+ ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata -sparse `cat
+ ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list`)
+
+ # Regex exclude only available for LLVM >= 7
+ if(LLVM_COV_VERSION VERSION_GREATER_EQUAL "7.0.0")
+ foreach(EXCLUDE_ITEM ${add_code_coverage_all_targets_EXCLUDE})
+ set(EXCLUDE_REGEX ${EXCLUDE_REGEX}
+ -ignore-filename-regex='${EXCLUDE_ITEM}')
+ endforeach()
+ endif()
+
+ # Print summary of the code coverage information to the command line
+ add_custom_target(
+ ccov-all-report
+ COMMAND
+ ${LLVM_COV_PATH} report `cat
+ ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list`
+ -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata
+ ${EXCLUDE_REGEX}
+ DEPENDS ccov-all-processing)
+
+ # Export coverage information so continuous integration tools (e.g.
+ # Jenkins) can consume it
+ add_custom_target(
+ ccov-all-export
+ COMMAND
+ ${LLVM_COV_PATH} export `cat
+ ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list`
+ -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata
+ -format="text" ${EXCLUDE_REGEX} >
+ ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/coverage.json
+ DEPENDS ccov-all-processing)
+
+ # Generate HTML output of all added targets for perusal
+ add_custom_target(
+ ccov-all
+ COMMAND
+ ${LLVM_COV_PATH} show `cat
+ ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list`
+ -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata
+ -show-line-counts-or-regions
+ -output-dir=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged
+ -format="html" ${EXCLUDE_REGEX}
+ DEPENDS ccov-all-processing)
+
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ set(COVERAGE_INFO "${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.info")
+
+ # Nothing required for gcov
+ add_custom_target(ccov-all-processing COMMAND ;)
+
+ # Exclusion regex string creation
+ foreach(EXCLUDE_ITEM ${add_code_coverage_all_targets_EXCLUDE})
+ set(EXCLUDE_REGEX ${EXCLUDE_REGEX} --remove ${COVERAGE_INFO}
+ '${EXCLUDE_ITEM}')
+ endforeach()
+
+ if(EXCLUDE_REGEX)
+ set(EXCLUDE_COMMAND ${LCOV_PATH} ${EXCLUDE_REGEX} --output-file
+ ${COVERAGE_INFO})
+ else()
+ set(EXCLUDE_COMMAND ;)
+ endif()
+
+ # Capture coverage data
+ add_custom_target(
+ ccov-all-capture
+ COMMAND ${CMAKE_COMMAND} -E remove ${COVERAGE_INFO}
+ COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --capture
+ --output-file ${COVERAGE_INFO}
+ COMMAND ${EXCLUDE_COMMAND}
+ DEPENDS ccov-all-processing)
+
+ # Generates HTML output of all targets for perusal
+ add_custom_target(
+ ccov-all
+ COMMAND ${GENHTML_PATH} -o ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged
+ ${COVERAGE_INFO}
+ DEPENDS ccov-all-capture)
+
+ endif()
+
+ add_custom_command(
+ TARGET ccov-all
+ POST_BUILD
+ COMMAND ;
+ COMMENT
+ "Open ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged/index.html in your browser to view the coverage report."
+ )
+ endif()
+endfunction()
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
new file mode 100644
index 0000000..b06992f
--- /dev/null
+++ b/config/sanitizer/sanitizers.cmake
@@ -0,0 +1,103 @@
+#
+# Copyright (C) 2018 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.
+
+set(USE_SANITIZER
+ ""
+ CACHE
+ STRING
+ "Compile with a sanitizer. Options are: Address, Memory, MemoryWithOrigins, Undefined, Thread, Leak, 'Address;Undefined'"
+)
+
+function(append value)
+ foreach(variable ${ARGN})
+ set(${variable}
+ "${${variable}} ${value}"
+ PARENT_SCOPE)
+ endforeach(variable)
+endfunction()
+
+message(STATUS "USE_SANITIZER=${USE_SANITIZER}, CMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}")
+if(USE_SANITIZER)
+ if(INTEL_CLANG OR CMAKE_C_COMPILER_ID MATCHES "[Cc]lang")
+ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+ if(UNIX)
+ 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(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)
+ 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(
+ FATAL_ERROR "Unsupported value of USE_SANITIZER: ${USE_SANITIZER}")
+ 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()
+ 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
new file mode 100644
index 0000000..242e33f
--- /dev/null
+++ b/config/sanitizer/tools.cmake
@@ -0,0 +1,114 @@
+#
+# 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
+# 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.
+
+option(CLANG_TIDY "Turns on clang-tidy processing if it is found." OFF)
+option(IWYU "Turns on include-what-you-use processing if it is found." OFF)
+option(CPPCHECK "Turns on cppcheck processing if it is found." OFF)
+
+# Adds clang-tidy checks to the compilation, with the given arguments being used
+# as the options set.
+macro(clang_tidy)
+ if(CLANG_TIDY AND CLANG_TIDY_EXE)
+ set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_EXE} ${ARGN})
+ endif()
+endmacro()
+
+# Adds include_what_you_use to the compilation, with the given arguments being
+# used as the options set.
+macro(include_what_you_use)
+ if(IWYU AND IWYU_EXE)
+ set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_EXE} ${ARGN})
+ endif()
+endmacro()
+
+# Adds cppcheck to the compilation, with the given arguments being used as the
+# options set.
+macro(cppcheck)
+ if(CPPCHECK AND CPPCHECK_EXE)
+ 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)
+ message(STATUS "clang-tidy NOT ENABLED via 'CLANG_TIDY' variable!")
+ set(CMAKE_CXX_CLANG_TIDY
+ ""
+ CACHE STRING "" FORCE) # delete it
+ endif()
+elseif(CLANG_TIDY)
+ message(SEND_ERROR "Cannot enable clang-tidy, as executable not found!")
+ set(CMAKE_CXX_CLANG_TIDY
+ ""
+ CACHE STRING "" FORCE) # delete it
+else()
+ message(STATUS "clang-tidy not found!")
+ set(CMAKE_CXX_CLANG_TIDY
+ ""
+ CACHE STRING "" FORCE) # delete it
+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)
+ message(STATUS "include-what-you-use NOT ENABLED via 'IWYU' variable!")
+ set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
+ ""
+ CACHE STRING "" FORCE) # delete it
+ endif()
+elseif(IWYU)
+ message(
+ SEND_ERROR "Cannot enable include-what-you-use, as executable not found!")
+ set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
+ ""
+ CACHE STRING "" FORCE) # delete it
+else()
+ message(STATUS "include-what-you-use not found!")
+ set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
+ ""
+ CACHE STRING "" FORCE) # delete it
+endif()
+
+find_program(CPPCHECK_EXE NAMES "cppcheck")
+mark_as_advanced(FORCE CPPCHECK_EXE)
+if(CPPCHECK_EXE)
+ message(STATUS "cppcheck found: ${CPPCHECK_EXE}")
+ if(CPPECHECK)
+ set(CMAKE_CXX_CPPCHECK
+ "${CPPCHECK_EXE};--enable=warning,performance,portability,missingInclude;--template=\"[{severity}][{id}] {message} {callstack} \(On {file}:{line}\)\";--suppress=missingIncludeSystem;--quiet;--verbose;--force"
+ )
+ endif()
+ if(NOT CPPCHECK)
+ message(STATUS "cppcheck NOT ENABLED via 'CPPCHECK' variable!")
+ set(CMAKE_CXX_CPPCHECK
+ ""
+ CACHE STRING "" FORCE) # delete it
+ endif()
+elseif(CPPCHECK)
+ message(SEND_ERROR "Cannot enable cppcheck, as executable not found!")
+ set(CMAKE_CXX_CPPCHECK
+ ""
+ CACHE STRING "" FORCE) # delete it
+else()
+ message(STATUS "cppcheck not found!")
+ set(CMAKE_CXX_CPPCHECK
+ ""
+ CACHE STRING "" FORCE) # delete it
+endif()
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..6b6b74d 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
@@ -37,21 +39,30 @@ if test "X-" = "X-$cc_flags_set"; then
# Debug
# NDEBUG is handled explicitly by the configure script
- # -g is hanled by the symbols flags
+ # -g is handled by the symbols flags
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
@@ -90,7 +101,7 @@ if test "X-" = "X-$f9x_flags_set"; then
# Debug
# NDEBUG is handled explicitly by the configure script
- # -g is hanled by the symbols flags
+ # -g is handled by the symbols flags
DEBUG_FCFLAGS=
# Symbols
@@ -146,7 +157,7 @@ if test -z "$cxx_flags_set"; then
# Debug
# NDEBUG is handled explicitly by the configure script
- # -g is hanled by the symbols flags
+ # -g is handled by the symbols flags
DEBUG_CXXFLAGS=
# Symbols
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/clang.cmake b/config/toolchain/clang.cmake
new file mode 100644
index 0000000..af176aa
--- /dev/null
+++ b/config/toolchain/clang.cmake
@@ -0,0 +1,16 @@
+# Uncomment the following to use cross-compiling
+#set(CMAKE_SYSTEM_NAME Linux)
+
+set(CMAKE_COMPILER_VENDOR "clang")
+
+if(WIN32)
+ set(CMAKE_C_COMPILER clang-cl)
+ set(CMAKE_CXX_COMPILER clang-cl)
+else()
+ set(CMAKE_C_COMPILER clang)
+ set(CMAKE_CXX_COMPILER clang++)
+endif()
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+# the following is used if cross-compiling
+set(CMAKE_CROSSCOMPILING_EMULATOR "")
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 721c39a..1830488 100644
--- a/config/toolchain/mingw64.cmake
+++ b/config/toolchain/mingw64.cmake
@@ -1,10 +1,14 @@
+set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
set (CMAKE_SYSTEM_NAME Windows)
-set (CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
-set (CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
-set (CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
-set (CMAKE_Fortran_COMPILER x86_64-w64-mingw32-gfortran)
-set (CMAKE_FIND_ROOT_PATH /usr/x86_64-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_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/${TOOLCHAIN_PREFIX}/include)
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On CACHE BOOL "Export windows symbols")