From d9d6e19d6faa2fb60df8c8e011b4d0d66201de5c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 31 Mar 2020 07:38:25 -0500 Subject: TRILAB-192 merging warnings changes from develop --- MANIFEST | 45 +- c++/examples/Makefile.am | 4 +- c++/examples/run-c++-ex.sh.in | 4 +- c++/examples/testh5c++.sh.in | 2 +- c++/src/CMakeLists.txt | 6 + c++/src/h5c++.in | 6 +- config/clang-warnings/developer-general | 3 + config/clang-warnings/error-general | 79 +++ config/clang-warnings/general | 26 + config/clang-warnings/no-developer-general | 1 + config/cmake/HDFCompilerFlags.cmake | 197 ++++---- config/cmake/libhdf5.settings.cmake.in | 9 +- config/commence.am | 2 +- config/gnu-flags | 756 ++++++++--------------------- config/gnu-warnings-no-developer-general | 4 - config/gnu-warnings/4.2-4.3 | 3 + config/gnu-warnings/4.2-4.4 | 2 + config/gnu-warnings/4.2-4.6 | 2 + config/gnu-warnings/4.2-4.last | 3 + config/gnu-warnings/4.3 | 2 + config/gnu-warnings/4.4 | 3 + config/gnu-warnings/4.5 | 1 + config/gnu-warnings/4.5-4.6 | 3 + config/gnu-warnings/4.6 | 2 + config/gnu-warnings/4.7 | 5 + config/gnu-warnings/4.8 | 1 + config/gnu-warnings/4.9 | 1 + config/gnu-warnings/5 | 2 + config/gnu-warnings/6 | 9 + config/gnu-warnings/7 | 7 + config/gnu-warnings/8 | 3 + config/gnu-warnings/9 | 2 + config/gnu-warnings/developer-4.5 | 7 + config/gnu-warnings/developer-4.6 | 1 + config/gnu-warnings/developer-4.7 | 7 + config/gnu-warnings/developer-4.8 | 1 + config/gnu-warnings/developer-7 | 1 + config/gnu-warnings/developer-8 | 3 + config/gnu-warnings/developer-general | 13 + config/gnu-warnings/error-5 | 12 + config/gnu-warnings/error-8 | 9 + config/gnu-warnings/error-general | 91 ++++ config/gnu-warnings/general | 32 ++ config/gnu-warnings/no-developer-4.5 | 1 + config/gnu-warnings/no-developer-4.6 | 1 + config/gnu-warnings/no-developer-4.7 | 2 + config/gnu-warnings/no-developer-4.8 | 1 + config/gnu-warnings/no-developer-8 | 2 + config/gnu-warnings/no-developer-general | 4 + config/linux-gnueabihf | 16 + config/linux-gnulibc1 | 13 +- config/netbsd | 56 +++ config/sanitizer/sanitizers.cmake | 109 ++--- config/solaris | 1 + config/toolchain/intel.cmake | 13 +- configure.ac | 455 +++++++++-------- examples/Makefile.am | 4 +- examples/README | 2 +- examples/run-c-ex.sh.in | 29 +- examples/testh5cc.sh.in | 3 +- fortran/examples/Makefile.am | 4 +- fortran/examples/run-fortran-ex.sh.in | 30 +- hl/c++/examples/Makefile.am | 4 +- hl/c++/examples/run-hlc++-ex.sh.in | 28 +- hl/c++/src/CMakeLists.txt | 3 + hl/examples/Makefile.am | 4 +- hl/examples/run-hlc-ex.sh.in | 27 +- hl/fortran/examples/Makefile.am | 4 +- hl/fortran/examples/run-hlfortran-ex.sh.in | 4 +- hl/src/CMakeLists.txt | 6 + hl/test/Makefile.am | 1 - release_docs/RELEASE.txt | 17 + src/CMakeLists.txt | 6 + src/H5Dio.c | 277 +++++------ src/H5FDhdfs.c | 14 +- src/H5FDmulti.c | 175 +++---- src/H5FDpublic.h | 4 +- src/H5Oefl.c | 2 +- src/H5Shyper.c | 1 - src/H5Tconv.c | 4 +- src/H5Tprivate.h | 7 +- tools/h5copy/CMakeLists.txt | 2 + tools/h5diff/CMakeLists.txt | 4 + tools/h5dump/CMakeLists.txt | 4 + tools/h5ls/CMakeLists.txt | 2 + tools/h5repack/CMakeLists.txt | 2 + tools/h5stat/CMakeLists.txt | 2 + tools/lib/CMakeLists.txt | 6 + tools/misc/CMakeLists.txt | 6 + 89 files changed, 1520 insertions(+), 1214 deletions(-) create mode 100644 config/clang-warnings/developer-general create mode 100644 config/clang-warnings/error-general create mode 100644 config/clang-warnings/general create mode 100644 config/clang-warnings/no-developer-general delete mode 100644 config/gnu-warnings-no-developer-general create mode 100644 config/gnu-warnings/4.2-4.3 create mode 100644 config/gnu-warnings/4.2-4.4 create mode 100644 config/gnu-warnings/4.2-4.6 create mode 100644 config/gnu-warnings/4.2-4.last create mode 100644 config/gnu-warnings/4.3 create mode 100644 config/gnu-warnings/4.4 create mode 100644 config/gnu-warnings/4.5 create mode 100644 config/gnu-warnings/4.5-4.6 create mode 100644 config/gnu-warnings/4.6 create mode 100644 config/gnu-warnings/4.7 create mode 100644 config/gnu-warnings/4.8 create mode 100644 config/gnu-warnings/4.9 create mode 100644 config/gnu-warnings/5 create mode 100644 config/gnu-warnings/6 create mode 100644 config/gnu-warnings/7 create mode 100644 config/gnu-warnings/8 create mode 100644 config/gnu-warnings/9 create mode 100644 config/gnu-warnings/developer-4.5 create mode 100644 config/gnu-warnings/developer-4.6 create mode 100644 config/gnu-warnings/developer-4.7 create mode 100644 config/gnu-warnings/developer-4.8 create mode 100644 config/gnu-warnings/developer-7 create mode 100644 config/gnu-warnings/developer-8 create mode 100644 config/gnu-warnings/developer-general create mode 100644 config/gnu-warnings/error-5 create mode 100644 config/gnu-warnings/error-8 create mode 100644 config/gnu-warnings/error-general create mode 100644 config/gnu-warnings/general create mode 100644 config/gnu-warnings/no-developer-4.5 create mode 100644 config/gnu-warnings/no-developer-4.6 create mode 100644 config/gnu-warnings/no-developer-4.7 create mode 100644 config/gnu-warnings/no-developer-4.8 create mode 100644 config/gnu-warnings/no-developer-8 create mode 100644 config/gnu-warnings/no-developer-general create mode 100644 config/linux-gnueabihf create mode 100644 config/netbsd diff --git a/MANIFEST b/MANIFEST index 8522f0c..bb9bf0c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -101,29 +101,66 @@ ./config/cce-flags ./config/commence.am ./config/conclude.am -./config/cygwin ./config/examples.am ./config/freebsd ./config/gnu-fflags ./config/gnu-flags +./config/cygwin ./config/ibm-aix ./config/ibm-flags ./config/intel-fflags ./config/intel-flags ./config/linux-gnu ./config/linux-gnuaout +./config/linux-gnueabihf ./config/linux-gnulibc1 ./config/linux-gnulibc2 ./config/lt_vers.am ./config/Makefile.am.blank +./config/netbsd ./config/pgi-fflags ./config/pgi-flags ./config/solaris #warnings files for both autotools and CMake -./config/gnu-warnings-general -./config/gnu-warnings-developer-general -./config/gnu-warnings-no-developer-general +./config/clang-warnings/developer-general +./config/clang-warnings/error-general +./config/clang-warnings/general +./config/clang-warnings/no-developer-general +./config/gnu-warnings/4.2-4.3 +./config/gnu-warnings/4.2-4.4 +./config/gnu-warnings/4.2-4.6 +./config/gnu-warnings/4.2-4.last +./config/gnu-warnings/4.3 +./config/gnu-warnings/4.4 +./config/gnu-warnings/4.5 +./config/gnu-warnings/4.5-4.6 +./config/gnu-warnings/4.6 +./config/gnu-warnings/4.7 +./config/gnu-warnings/4.8 +./config/gnu-warnings/4.9 +./config/gnu-warnings/5 +./config/gnu-warnings/6 +./config/gnu-warnings/7 +./config/gnu-warnings/8 +./config/gnu-warnings/9 +./config/gnu-warnings/developer-4.5 +./config/gnu-warnings/developer-4.6 +./config/gnu-warnings/developer-4.7 +./config/gnu-warnings/developer-4.8 +./config/gnu-warnings/developer-7 +./config/gnu-warnings/developer-8 +./config/gnu-warnings/developer-general +./config/gnu-warnings/error-5 +./config/gnu-warnings/error-8 +./config/gnu-warnings/error-general +./config/gnu-warnings/general +./config/gnu-warnings/no-developer-4.5 +./config/gnu-warnings/no-developer-4.6 +./config/gnu-warnings/no-developer-4.7 +./config/gnu-warnings/no-developer-4.8 +./config/gnu-warnings/no-developer-8 +./config/gnu-warnings/no-developer-general ./config/intel-warnings-general ./config/site-specific/BlankForm diff --git a/c++/examples/Makefile.am b/c++/examples/Makefile.am index 51ab8e3..0648504 100644 --- a/c++/examples/Makefile.am +++ b/c++/examples/Makefile.am @@ -49,8 +49,8 @@ CXX_API=yes # Where to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/c++ -EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples +EXAMPLEDIR=$(examplesdir)/c++ +EXAMPLETOPDIR=$(examplesdir) # How to build programs using h5c++ $(EXTRA_PROG): $(H5CPP) diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in index 315010e..4667878 100644 --- a/c++/examples/run-c++-ex.sh.in +++ b/c++/examples/run-c++-ex.sh.in @@ -18,7 +18,7 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This script will compile and run the c++ examples from source files # -# installed in .../share/hdf5_examples/c++ using h5c++. The # +# installed in @examplesdir@/c++ using h5c++. The # # order for running programs with RunTest in the MAIN section below is taken # # from the Makefile. The order is important since some of the test programs # # use data files created by earlier test programs. Any future additions should # @@ -32,7 +32,7 @@ EXIT_FAILURE=1 # Where the tool is installed. # default is relative path to installed location of the tools -prefix="${prefix:-../../../}" +prefix="${prefix:-../${prefix_relto_examplesdir}}" AR="@AR@" RANLIB="@RANLIB@" H5TOOL="h5c++" # The tool name diff --git a/c++/examples/testh5c++.sh.in b/c++/examples/testh5c++.sh.in index c82ccc3..be3669b 100644 --- a/c++/examples/testh5c++.sh.in +++ b/c++/examples/testh5c++.sh.in @@ -57,7 +57,7 @@ applib=libapp${H5TOOL}.a # short hands # Caution: if some *.h5 files must be cleaned here, list them by names. # Don't use the wildcard form of *.h5 as it will wipe out even *.h5 generated -# by otehr test programs. This will cause a racing condition error when +# by other test programs. This will cause a racing condition error when # parallel make (e.g., gmake -j 4) is used. temp_SRC="$hdf5main $appmain $prog1 $prog2" temp_OBJ=`echo $temp_SRC | sed -e "s/\.${suffix}/.o/g"` diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index ff03269..f5a52e7 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -92,6 +92,9 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_CPP_LIB_TARGET} + PRIVATE "${HDF5_CMAKE_CXX_FLAGS}" + ) target_compile_definitions(${HDF5_CPP_LIB_TARGET} PRIVATE $<$:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings ) @@ -109,6 +112,9 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_CPP_LIBSH_TARGET} + PRIVATE "${HDF5_CMAKE_CXX_FLAGS}" + ) target_compile_definitions(${HDF5_CPP_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" PRIVATE $<$:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index 00502d9..f068f51 100644 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -38,7 +38,7 @@ HL="@HL@" ## $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS ## ## $LDFLAGS $LIBS $clibpath $link_objs $link_args $shared_link ## ## ## -## These settings can be overriden by setting HDF5_CXXFLAGS, ## +## These settings can be overridden by setting HDF5_CXXFLAGS, ## ## HDF5_CPPFLAGS, HDF5_LDFLAGS, or HDF5_LIBS in the environment. ## ## ## ############################################################################ @@ -140,7 +140,7 @@ usage() { echo " [default: no except when built with only" echo " shared libraries]" echo " You can also add or change paths and flags to the compile line using" - echo " the following environment varibles or by assigning them to their counterparts" + echo " the following environment variables or by assigning them to their counterparts" echo " in the 'Things You Can Modify to Override...'" section of $prog_name echo " " echo " Variable Current value to be replaced" @@ -311,7 +311,7 @@ fi if test "x$do_link" = "xyes"; then shared_link="" - # conditionnaly link with the hl library + # conditionally link with the hl library if test "X$HL" = "Xhl"; then libraries=" $libraries -lhdf5_hl_cpp -lhdf5_cpp -lhdf5_hl -lhdf5 " else diff --git a/config/clang-warnings/developer-general b/config/clang-warnings/developer-general new file mode 100644 index 0000000..aa8c32e --- /dev/null +++ b/config/clang-warnings/developer-general @@ -0,0 +1,3 @@ +-Wformat-nonliteral +-Wmissing-noreturn +-Wswitch-enum diff --git a/config/clang-warnings/error-general b/config/clang-warnings/error-general new file mode 100644 index 0000000..a9aa516 --- /dev/null +++ b/config/clang-warnings/error-general @@ -0,0 +1,79 @@ +# +# 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=sometimes-uninitialized +-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/h5tools_utils.c +# -Werror=unused-parameter +# +# +# NOTE: JNI files are not compatible with these warnings as errors +# jni/h5pDCPLImp.c,jni/nativeData.c,jni/h5util.c,jni/h5rImp.c +# jni/h5sImp.c,jni/h5tImp.c +# -Werror=cast-align +# jni/h5util.c +# -Werror=format(-overflow) +# +-Wformat +# +# +#Examples and tests do not use the same set of extensive warning flags as libraries +# Here is a list of tests and examples that have issues with the stricter warnings as error +# +# NOTE: Test files are not compatible with these warnings as errors +# thread_id.c, +# -Werror=unused-function +# dsets.c +# -Werror=unused-parameter +# +# +# NOTE: Examples files are not compatible with these warnings as errors +# h5_vds-eiger.c,h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c,h5_vds-percival-unlim-maxmin.c +# h5_vds-percival.c,h5_read.c,h5_rdwt.c,h5_mount.c,h5_extend.c,h5_extend_write.c +# h5_write.c,h5_vds-simpleIO.c,h5_ref2reg_deprec.c,h5_crtgrp.c,h5_select.c +# h5_vds-percival-unlim.c,h5_crtatt.c,h5_group.c,h5_attribute.c,h5_crtdat.c +# h5_reference_deprec.c +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=strict-prototypes +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=old-style-definition +# h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c, +# -Werror=unused-variable +# h5_elink_unix2win.c,h5_extlink.c,h5_attribute.c +# -Werror=unused-parameter + diff --git a/config/clang-warnings/general b/config/clang-warnings/general new file mode 100644 index 0000000..f0c9b93 --- /dev/null +++ b/config/clang-warnings/general @@ -0,0 +1,26 @@ +# general clang warnings flags +-Wall +-Warray-bounds +-Wcast-qual +-Wconversion +-Wdouble-promotion +-Wextra +-Wformat=2 +-Wframe-larger-than=16384 +-Wimplicit-fallthrough +# +# NOTE: Due to the divergence in the C and C++, we're dropping support for +# compiling the C library with a C++ compiler and dropping the -Wc++-compat +# warning. +# +-Wno-c++-compat +# +# NOTE: Disable the -Wformat-nonliteral from -Wformat=2 here and re-add +# it to the developer flags. +# +-Wno-format-nonliteral +-Wnull-dereference +-Wunused-const-variable +-Wwrite-strings +-Wpedantic +-Wvolatile-register-var diff --git a/config/clang-warnings/no-developer-general b/config/clang-warnings/no-developer-general new file mode 100644 index 0000000..2f4e0c5 --- /dev/null +++ b/config/clang-warnings/no-developer-general @@ -0,0 +1 @@ +-Wmissing-noreturn diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 17b0854..03c6936 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -23,7 +23,7 @@ macro (ADD_H5_FLAGS h5_flag_var infile) string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") #message (STATUS "str_flag=${str_flag}") if (str_flag) - set (${h5_flag_var} "${${h5_flag_var}} ${str_flag}") + list (APPEND ${h5_flag_var} "${str_flag}") endif () endforeach () endif () @@ -98,12 +98,16 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) endif () #----------------------------------------------------------------------------- +# HDF5 library compile options +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- # CDash is configured to only allow 3000 warnings, so # break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- -if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) +if (NOT MSVC) if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") + list (APPEND HDF5_CMAKE_C_FLAGS "-erroff=%none -DBSD_COMP") else () # General flags # @@ -115,32 +119,30 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) # warnings that are emitted. If you need it, add it at configure time. if (CMAKE_C_COMPILER_ID STREQUAL "Intel") - ADD_H5_FLAGS (CMAKE_C_FLAGS_GENERAL "${HDF5_SOURCE_DIR}/config/intel-warnings-general") - message (STATUS "CMAKE_C_FLAGS_GENERAL=${CMAKE_C_FLAGS_GENERAL}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_GENERAL}") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wreturn-type -Wstrict-prototypes -Wuninitialized") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunknown-pragmas -Wunused-function -Wunused-variable") + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings-general") + message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") + list (APPEND H5_CFLAGS0 "-Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith") + list (APPEND H5_CFLAGS0 "-Wreturn-type -Wstrict-prototypes -Wuninitialized") + list (APPEND H5_CFLAGS0 "-Wunknown-pragmas -Wunused-function -Wunused-variable") # this is just a failsafe - set (H5_CFLAGS0 "${H5_CFLAGS0} -finline-functions") + list (APPEND H5_CFLAGS0 "-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") + list (APPEND H5_CFLAGS0 "-Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow") + list (APPEND H5_CFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings") endif() elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - ADD_H5_FLAGS (CMAKE_C_FLAGS_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-general") - message (STATUS "CMAKE_C_FLAGS_GENERAL=${CMAKE_C_FLAGS_GENERAL}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_GENERAL}") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wbad-function-cast -Wcast-align") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wdeclaration-after-statement -Wdisabled-optimization") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-declarations") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wswitch-default") - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunused-macros -Wunsafe-loop-optimizations") + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") + message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") # gcc automatically inlines based on the optimization level # this is just a failsafe - set (H5_CFLAGS0 "${H5_CFLAGS0} -finline-functions") - message (STATUS "H5_CFLAGS0=${H5_CFLAGS0}") + list (APPEND H5_CFLAGS0 "-finline-functions") + elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") + message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general") + elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI") + list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform") endif () endif () @@ -152,100 +154,127 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) 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") + list (APPEND H5_CFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing") elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - ADD_H5_FLAGS (CMAKE_C_FLAGS_DEV_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-developer-general") - set (H5_CFLAGS0 "${H5_CFLAGS0} ${CMAKE_C_FLAGS_DEV_GENERAL}") + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") + elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") endif () else () if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - ADD_H5_FLAGS (CMAKE_C_FLAGS_NO_DEV_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-no-developer-general") - set (H5_CFLAGS0 "${H5_CFLAGS0} ${CMAKE_C_FLAGS_NO_DEV_GENERAL}") + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") + elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") endif () endif () if (CMAKE_C_COMPILER_ID STREQUAL "GNU") # Append warning flags that only gcc 4.3+ knows about + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") # # 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") + # we should approach them a bit cautiously... Only needed for gcc 4.X + if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last") + endif () # 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") + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4") + endif () endif () # Append more extra warning flags that only gcc 4.5+ know about if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wstrict-overflow=5 -Wjump-misses-init") - if (HDF5_ENABLE_DEV_WARNINGS) - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunsuffixed-float-constants") - else () - set (H5_CFLAGS0 "${H5_CFLAGS0} -Wno-unsuffixed-float-constants") - endif () + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5") + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5") + else () + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5") + endif () + endif () + + # Append more extra warning flags that only gcc 4.6 and less know about + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6") + endif () + + # Append more extra warning flags that only gcc 4.5-4.6 know about + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5-4.6") 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") + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.6") if (HDF5_ENABLE_DEV_WARNINGS) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=const") + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.6") else () - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=const") + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.6") 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") + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.7") if (HDF5_ENABLE_DEV_WARNINGS) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.7") else () - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn") + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.7") endif () 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) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8") if (HDF5_ENABLE_DEV_WARNINGS) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=format") + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8") else () - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=format") + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8") endif () endif () # Append more extra warning flags that only gcc 4.9+ know about if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdate-time") + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9") 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") + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/5") + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5") 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") + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/6") endif () # Append more extra warning flags that only gcc 7.x+ know about if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0) - set (H5_CFLAGS4 "${H5_CFLAGS4} -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=1 -Wimplicit-fallthrough=5 -Wrestrict") + ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7") + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7") + #else () + # ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7") + endif () 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") + ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") + else () + ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8") + endif () 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") + ADD_H5_FLAGS (H5_CFLAGS4 "${HDF5_SOURCE_DIR}/config/gnu-warnings/9") endif () -elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Minform=inform") endif () #----------------------------------------------------------------------------- @@ -257,22 +286,22 @@ if (HDF5_ENABLE_ALL_WARNINGS) 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") + list (APPEND HDF5_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") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall /wd4668") endif () else () string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + list (APPEND HDF5_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") + list (APPEND HDF5_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}") + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}) endif () endif () endif () @@ -284,15 +313,15 @@ 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") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}") + list (APPEND HDF5_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") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/W1") endif () else () if (CMAKE_COMPILER_IS_GNUCC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS0}") + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0}) endif () endif () endif () @@ -304,14 +333,14 @@ 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") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}") + list (APPEND HDF5_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") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/W2") endif () else () - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1}) endif () endif () @@ -322,14 +351,14 @@ 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") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}") + list (APPEND HDF5_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") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3") endif () else () - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2}) endif () endif () @@ -340,14 +369,14 @@ 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") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}") + list (APPEND HDF5_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") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/W4") endif () else () - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3}) endif () endif () @@ -358,7 +387,7 @@ 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_CFLAGS4}) endif () endif () @@ -430,9 +459,9 @@ 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}") + list (APPEND HDF5_CMAKE_C_FLAGS "${PROFILE_CFLAGS}") if(CMAKE_CXX_COMPILER_LOADED) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PROFILE_CXXFLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "${PROFILE_CXXFLAGS}") endif () endif () MARK_AS_ADVANCED (HDF5_ENABLE_PROFILING) @@ -443,9 +472,9 @@ 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}") + list (APPEND HDF5_CMAKE_C_FLAGS "${OPTIMIZE_CFLAGS}") if(CMAKE_CXX_COMPILER_LOADED) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPTIMIZE_CXXFLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "${OPTIMIZE_CXXFLAGS}") endif () endif () MARK_AS_ADVANCED (HDF5_ENABLE_OPTIMIZATION) diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 7bfadb1..ddc1e65 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -1,12 +1,11 @@ - SUMMARY OF THE HDF5 CONFIGURATION - ================================= + SUMMARY OF THE HDF5 CONFIGURATION + ================================= General Information: ------------------- HDF5 Version: @HDF5_PACKAGE_VERSION_STRING@ Configured on: @CONFIG_DATE@ Configured by: @CMAKE_GENERATOR@ - Configure mode: CMAKE @CMAKE_VERSION@ Host system: @CMAKE_HOST_SYSTEM@ Uname information: @CMAKE_SYSTEM_NAME@ Byte sex: @BYTESEX@ @@ -39,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@ @@ -56,7 +55,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@ diff --git a/config/commence.am b/config/commence.am index eed5304..d4469dc 100644 --- a/config/commence.am +++ b/config/commence.am @@ -69,7 +69,7 @@ H5CPP=${DESTDIR}$(bindir)/h5c++ # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS=@AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS=@AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_FCFLAGS=@AM_FCFLAGS@ @H5_FCFLAGS@ AM_CXXFLAGS=@AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_CPPFLAGS=@AM_CPPFLAGS@ @H5_CPPFLAGS@ diff --git a/config/gnu-flags b/config/gnu-flags index c73ec21..9f9deb1 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -18,6 +18,24 @@ # # +# For now, do not promote any warnings to errors. +# +PROMOTE_ERRORS_DFLT=no + +# +# This filter rewrites -Werror= as -W, in that way demoting warnings +# promoted to errors back to warnings, if PROMOTE_ERRORS is no. +# +demote_errors() +{ + if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then + sed 's,-Werror=,-W,g' + else + cat + fi +} + +# # Prepend `$srcdir/config/gnu-` 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, @@ -26,7 +44,7 @@ load_gcc_arguments() { set -- $(for arg; do - sed 's,#.*$,,' $srcdir/config/gnu-${arg} + sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | demote_errors done) IFS=' ' echo "$*" } @@ -71,7 +89,11 @@ fi # Common GCC flags for various situations case "$cc_vendor-$cc_version" in gcc*) - # Architecture-specific flags + + ############################### + # Architecture-specific flags # + ############################### + arch= case "$host_os-$host_cpu" in # FreeBSD sets the information from "uname -m" to the general machine @@ -99,578 +121,63 @@ case "$cc_vendor-$cc_version" in ;; esac - # Host-specific flags - case "`hostname`" in - sleipnir.ncsa.uiuc.edu) - arch="$arch -pipe" + 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 # General - H5_CFLAGS="$H5_CFLAGS $arch -std=c99" - H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments warnings-general)" - - # Production - case "$cc_vendor-$cc_version" in - gcc-[34].*) - PROD_CFLAGS="-O3" - ;; - gcc-5.*) - PROD_CFLAGS="-O3 -fstdarg-opt" - ;; - *) - PROD_CFLAGS="-O -finline-functions" - ;; - esac + H5_CFLAGS="$H5_CFLAGS $arch" + + ############## + # Production # + ############## + + # NDEBUG is handled explicitly by the configure script + if test $cc_vers_major -le 4; then + PROD_CFLAGS= + else + PROD_CFLAGS="-fstdarg-opt" + fi PROD_CPPFLAGS= - # Debug - case "$cc_vendor-$cc_version" in - gcc-5.*) - DEBUG_CFLAGS="-Og -g -ftrapv -fno-common" - ;; - *) - DEBUG_CFLAGS="-g" - ;; - esac - #DEBUG_CFLAGS="$DEBUG_CFLAGS -fsanitize=undefined" + ######### + # Debug # + ######### + + # NDEBUG is handled explicitly by the configure script + # -g is handled by the symbols flags + if test $cc_vers_major -le 4; then + DEBUG_CFLAGS= + else + DEBUG_CFLAGS="-ftrapv -fno-common" + fi DEBUG_CPPFLAGS= - # Try out the new "stack protector" feature introduced in gcc 4.1 - # (We should also think about adding some of the other memory protection options) - #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" + ############# + # Profiling # + ############# - # Profile - PROFILE_CFLAGS="-Og -g -pg" + PROFILE_CFLAGS="-pg" PROFILE_CPPFLAGS= - - # Flags are set - cc_flags_set=yes ;; esac + ############ + # Warnings # + ############ + # Version specific GCC 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 "$cc_vendor-$cc_version" in - -# Closer to the gcc 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 - gcc-5*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" - - # 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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - - # Append more extra warning flags that only gcc 4.5+ know about - H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - - # Append more extra warning flags that only gcc 4.6+ know about - H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" - - # Append more extra warning flags that only gcc 4.7+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wsuggest-attribute=format" - - # Append more extra warning flags that only gcc 4.9+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat" - ;; - - gcc-4.9*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" - - # 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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - - # Append more extra warning flags that only gcc 4.5+ know about - H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - - # Append more extra warning flags that only gcc 4.6+ know about - H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" - - # Append more extra warning flags that only gcc 4.7+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wsuggest-attribute=format" - - # Append more extra warning flags that only gcc 4.9+ know about - H5_CFLAGS="$H5_CFLAGS -Wdate-time -Wopenmp-simd" - ;; - - gcc-4.8*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" - - # 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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - - # Append more extra warning flags that only gcc 4.5+ know about - H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init" - - # Append more extra warning flags that only gcc 4.6+ know about - H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" - - # Append more extra warning flags that only gcc 4.7+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wsuggest-attribute=format" - ;; - - gcc-4.7*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" - - # 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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - #H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - - # Append more extra warning flags that only gcc 4.5+ know about - H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - - # Append more extra warning flags that only gcc 4.6+ know about - H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" - - # Append more extra warning flags that only gcc 4.7+ know about - H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" - ;; - - gcc-4.6*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - #H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - - # Append more extra warning flags that only gcc 4.5+ know about - H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - - # Append more extra warning flags that only gcc 4.6+ know about - H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" - ;; - - gcc-4.5*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - #H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - - # Append more extra warning flags that only gcc 4.5+ know about - H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - ;; - - gcc-4.4*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - - # Append more extra warning flags that only gcc 4.4+ know about - H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - ;; - - gcc-4.3*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wlogical-op -Wvla" - ;; - - gcc-4.2*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var" - - # Append more extra warning flags that only gcc 4.2+ know about - H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow" - ;; - + # older compiler versions gcc-4.1.*) # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" @@ -831,10 +338,139 @@ case "$cc_vendor-$cc_version" in #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" ;; + + gcc-*) + + ########### + # General # + ########### + + H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments general)" + H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-general)" + + ###################### + # Developer warnings # + ###################### + + NO_DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments no-developer-general) + DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments developer-general) + + ####################### + # gcc 4 special cases # + ####################### + + # GCC 4.2 through 4.6 + 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 $(load_gcc_arguments 4.2-4.6)" + fi + + # GCC 4.2 through 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 $(load_gcc_arguments 4.2-4.3)" + fi + + # GCC 4.5 through 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 $(load_gcc_arguments 4.5-4.6)" + fi + + # GCC 4.2 through 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 $(load_gcc_arguments 4.2-4.4)" + fi + + # GCC 4.2 through the end of GCC 4 series + if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then + H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-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 $(load_gcc_arguments 4.3)" + 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 $(load_gcc_arguments 4.4)" + 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 $(load_gcc_arguments 4.5)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.5)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.5)" + 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 $(load_gcc_arguments 4.6)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.6)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.6)" + 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 $(load_gcc_arguments 4.7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.7)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.7)" + fi + + # gcc >= 4.8 + if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then + H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.8)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.8)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.8)" + fi + + # 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 $(load_gcc_arguments 4.9)" + fi + + # gcc >= 5 + if test $cc_vers_major -ge 5; then + H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 5)" + H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-5)" + fi + + # gcc >= 6 + if test $cc_vers_major -ge 6; then + H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 6)" + fi + + # gcc >= 7 + if test $cc_vers_major -ge 7; then + H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-7)" + fi + + # gcc 8 + if test $cc_vers_major -ge 8; then + H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 8)" + H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-8)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-8)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-8)" + fi + + # gcc 9 + if test $cc_vers_major -ge 9; then + H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 9)" + fi + ;; esac + ################# + # 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/gnu-warnings-no-developer-general b/config/gnu-warnings-no-developer-general deleted file mode 100644 index 85dc0a3..0000000 --- a/config/gnu-warnings-no-developer-general +++ /dev/null @@ -1,4 +0,0 @@ --Wno-aggregate-return --Wno-inline --Wno-missing-format-attribute --Wno-missing-noreturn diff --git a/config/gnu-warnings/4.2-4.3 b/config/gnu-warnings/4.2-4.3 new file mode 100644 index 0000000..1881797 --- /dev/null +++ b/config/gnu-warnings/4.2-4.3 @@ -0,0 +1,3 @@ +# -Wvolatile-register-var was later incorporated into -Wall and +# only needs to be specified explicitly for gcc 4.2-4.3 +-Wvolatile-register-var diff --git a/config/gnu-warnings/4.2-4.4 b/config/gnu-warnings/4.2-4.4 new file mode 100644 index 0000000..ec4876f --- /dev/null +++ b/config/gnu-warnings/4.2-4.4 @@ -0,0 +1,2 @@ +# The non-valued form of -Wstrict-overflow is used in gcc 4.2-4.4 +-Wstrict-overflow diff --git a/config/gnu-warnings/4.2-4.6 b/config/gnu-warnings/4.2-4.6 new file mode 100644 index 0000000..37df4ab --- /dev/null +++ b/config/gnu-warnings/4.2-4.6 @@ -0,0 +1,2 @@ +# Disable warnings about using the 'long long' type w/ gcc 4.6 and earlier +-Wno-long-long diff --git a/config/gnu-warnings/4.2-4.last b/config/gnu-warnings/4.2-4.last new file mode 100644 index 0000000..2db90fb --- /dev/null +++ b/config/gnu-warnings/4.2-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.3 b/config/gnu-warnings/4.3 new file mode 100644 index 0000000..13d8558 --- /dev/null +++ b/config/gnu-warnings/4.3 @@ -0,0 +1,2 @@ +-Wlarger-than=2560 +-Wlogical-op diff --git a/config/gnu-warnings/4.4 b/config/gnu-warnings/4.4 new file mode 100644 index 0000000..42929b5 --- /dev/null +++ b/config/gnu-warnings/4.4 @@ -0,0 +1,3 @@ +-Wframe-larger-than=16384 +-Wpacked-bitfield-compat +-Wsync-nand diff --git a/config/gnu-warnings/4.5 b/config/gnu-warnings/4.5 new file mode 100644 index 0000000..ddb96df --- /dev/null +++ b/config/gnu-warnings/4.5 @@ -0,0 +1 @@ +-Wstrict-overflow=5 diff --git a/config/gnu-warnings/4.5-4.6 b/config/gnu-warnings/4.5-4.6 new file mode 100644 index 0000000..d3035fe --- /dev/null +++ b/config/gnu-warnings/4.5-4.6 @@ -0,0 +1,3 @@ +# -Wstrict-aliasing was later incorporated into -Wall and +# only needs to be specified explicitly for gcc 4.5-4.6 +-Wstrict-aliasing diff --git a/config/gnu-warnings/4.6 b/config/gnu-warnings/4.6 new file mode 100644 index 0000000..140a20c --- /dev/null +++ b/config/gnu-warnings/4.6 @@ -0,0 +1,2 @@ +-Wdouble-promotion +-Wtrampolines diff --git a/config/gnu-warnings/4.7 b/config/gnu-warnings/4.7 new file mode 100644 index 0000000..c47fe4b --- /dev/null +++ b/config/gnu-warnings/4.7 @@ -0,0 +1,5 @@ +# +# -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 diff --git a/config/gnu-warnings/4.8 b/config/gnu-warnings/4.8 new file mode 100644 index 0000000..5dc577f --- /dev/null +++ b/config/gnu-warnings/4.8 @@ -0,0 +1 @@ +-Wmaybe-uninitialized 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..266f5c1 --- /dev/null +++ b/config/gnu-warnings/7 @@ -0,0 +1,7 @@ +-Walloca +-Walloc-zero +-Wduplicated-branches +-Wformat-overflow=2 +-Wformat-truncation=1 +-Wimplicit-fallthrough=5 +-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/developer-4.5 b/config/gnu-warnings/developer-4.5 new file mode 100644 index 0000000..48df846 --- /dev/null +++ b/config/gnu-warnings/developer-4.5 @@ -0,0 +1,7 @@ +# +# -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 +-Wunsuffixed-float-constants diff --git a/config/gnu-warnings/developer-4.6 b/config/gnu-warnings/developer-4.6 new file mode 100644 index 0000000..2372fbf --- /dev/null +++ b/config/gnu-warnings/developer-4.6 @@ -0,0 +1 @@ +-Wsuggest-attribute=const diff --git a/config/gnu-warnings/developer-4.7 b/config/gnu-warnings/developer-4.7 new file mode 100644 index 0000000..a3b0781 --- /dev/null +++ b/config/gnu-warnings/developer-4.7 @@ -0,0 +1,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 diff --git a/config/gnu-warnings/developer-4.8 b/config/gnu-warnings/developer-4.8 new file mode 100644 index 0000000..b0109e2 --- /dev/null +++ b/config/gnu-warnings/developer-4.8 @@ -0,0 +1 @@ +-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..b34c4b7 --- /dev/null +++ b/config/gnu-warnings/developer-general @@ -0,0 +1,13 @@ +# (suggestions from gcc, not code problems) +# NOTE: -Wformat-nonliteral added back in here (from being disabled in +# H5_CFLAGS) +-Waggregate-return +-Wdisabled-optimization +-Wformat-nonliteral +-Winline +-Wmissing-format-attribute +-Wmissing-noreturn +-Wswitch-default +-Wswitch-enum +-Wunsafe-loop-optimizations +-Wunused-macros diff --git a/config/gnu-warnings/error-5 b/config/gnu-warnings/error-5 new file mode 100644 index 0000000..f7e1138 --- /dev/null +++ b/config/gnu-warnings/error-5 @@ -0,0 +1,12 @@ +-Werror=incompatible-pointer-types +# +# In GCC 4.4.7, the compiler gripes about shadowed global +# declarations when a local variable uses the name of a +# function that's in a system header file. For some reason, +# later versions of GCC (e.g., 5.2.0) don't complain about +# the shadowed globals. Maybe later versions are less fussy? +# Anyway, the shadowing seems to be harmless, and GCC 4.4.7 +# is not a supported compiler, so let us promote shadowed globals +# warnings to errors only for GCC 5 and later. +# +-Werror=shadow diff --git a/config/gnu-warnings/error-8 b/config/gnu-warnings/error-8 new file mode 100644 index 0000000..36c1414 --- /dev/null +++ b/config/gnu-warnings/error-8 @@ -0,0 +1,9 @@ +-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. +# +-Werror=maybe-uninitialized diff --git a/config/gnu-warnings/error-general b/config/gnu-warnings/error-general new file mode 100644 index 0000000..f0e61f8 --- /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=declaration-after-statement +-Werror=implicit-function-declaration +-Werror=missing-declarations +-Werror=missing-prototypes +-Werror=nested-externs +-Werror=old-style-definition +-Werror=packed +-Werror=pointer-sign +-Werror=pointer-to-int-cast +-Werror=redundant-decls +-Werror=strict-prototypes +-Werror=switch +# +#-Werror=discarded-qualifiers +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDdirect.c,H5FDmpio.c,H5FDros3.c, +# -Werror=unused-function +# +-Wunused-function +# +# H5FDdrvr_module.h +# -Werror=unused-variable +# +-Wunused-variable +# +# H5VLpassthru.c +# -Werror=unused-parameter +# +-Wunused-parameter +# +# +# +# NOTE: Tools files are not compatible with these warnings as errors +# lib/h5tools.c +# -Werror=cast-align +# +-Wcast-align +# +# lib/h5diff_array.c +# -Werror=unused-but-set-variable +# +-Wunused-but-set-variable +# +# lib/h5tools_utils.c +# -Werror=unused-parameter +# +# +# NOTE: JNI files are not compatible with these warnings as errors +# jni/h5pDCPLImp.c,jni/nativeData.c,jni/h5util.c,jni/h5rImp.c +# jni/h5sImp.c,jni/h5tImp.c +# -Werror=cast-align +# jni/h5util.c +# -Werror=format(-overflow) +# +-Wformat +# +# +#Examples and tests do not use the same set of extensive warning flags as libraries +# Here is a list of tests and examples that have issues with the stricter warnings as error +# +# NOTE: Test files are not compatible with these warnings as errors +# thread_id.c, +# -Werror=unused-function +# dsets.c +# -Werror=unused-parameter +# external.c,perform/sio_engine.c +# -Werror=format(-truncation) +# +# +# NOTE: Examples files are not compatible with these warnings as errors +# h5_vds-eiger.c,h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c,h5_vds-percival-unlim-maxmin.c +# h5_vds-percival.c,h5_read.c,h5_rdwt.c,h5_mount.c,h5_extend.c,h5_extend_write.c +# h5_write.c,h5_vds-simpleIO.c,h5_ref2reg_deprec.c,h5_crtgrp.c,h5_select.c +# h5_vds-percival-unlim.c,h5_crtatt.c,h5_group.c,h5_attribute.c,h5_crtdat.c +# h5_reference_deprec.c +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=strict-prototypes +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=old-style-definition +# h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c, +# -Werror=unused-variable +# h5_elink_unix2win.c,h5_extlink.c,h5_attribute.c +# -Werror=unused-parameter + diff --git a/config/gnu-warnings/general b/config/gnu-warnings/general new file mode 100644 index 0000000..a7a20b7 --- /dev/null +++ b/config/gnu-warnings/general @@ -0,0 +1,32 @@ +# 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 +# +# NOTE: Due to the divergence in the C and C++, we're dropping support for +# compiling the C library with a C++ compiler and dropping the -Wc++-compat +# warning. +# +-Wno-c++-compat +# +# NOTE: Disable the -Wformat-nonliteral from -Wformat=2 here and re-add +# it to the developer flags. +# +-Wno-format-nonliteral +-Wshadow +-Wundef +-Wwrite-strings +-pedantic diff --git a/config/gnu-warnings/no-developer-4.5 b/config/gnu-warnings/no-developer-4.5 new file mode 100644 index 0000000..ef7d38f --- /dev/null +++ b/config/gnu-warnings/no-developer-4.5 @@ -0,0 +1 @@ +-Wno-unsuffixed-float-constants diff --git a/config/gnu-warnings/no-developer-4.6 b/config/gnu-warnings/no-developer-4.6 new file mode 100644 index 0000000..ea9cc66 --- /dev/null +++ b/config/gnu-warnings/no-developer-4.6 @@ -0,0 +1 @@ +-Wno-suggest-attribute=const diff --git a/config/gnu-warnings/no-developer-4.7 b/config/gnu-warnings/no-developer-4.7 new file mode 100644 index 0000000..5b85e1f --- /dev/null +++ b/config/gnu-warnings/no-developer-4.7 @@ -0,0 +1,2 @@ +-Wno-suggest-attribute=noreturn +-Wno-suggest-attribute=pure diff --git a/config/gnu-warnings/no-developer-4.8 b/config/gnu-warnings/no-developer-4.8 new file mode 100644 index 0000000..e42e09f --- /dev/null +++ b/config/gnu-warnings/no-developer-4.8 @@ -0,0 +1 @@ +-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..85dc0a3 --- /dev/null +++ b/config/gnu-warnings/no-developer-general @@ -0,0 +1,4 @@ +-Wno-aggregate-return +-Wno-inline +-Wno-missing-format-attribute +-Wno-missing-noreturn diff --git a/config/linux-gnueabihf b/config/linux-gnueabihf new file mode 100644 index 0000000..326edeb --- /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://support.hdfgroup.org/ftp/HDF5/releases. +# 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 ce07853..51fad2a 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -49,7 +49,7 @@ if test "X-" = "X-$FC"; then FC=gfortran FC_BASENAME=gfortran ;; - pgcc*) + pgcc*) FC=pgf90 FC_BASENAME=pgf90 ;; @@ -98,12 +98,14 @@ else echo "compiler '$FC' is $fc_version_info" $RM $tmpfile ;; - *) ;; esac fi +# Figure out GNU FC compiler flags +. $srcdir/config/gnu-fflags + # Figure out PGI FC compiler flags . $srcdir/config/pgi-fflags @@ -119,10 +121,10 @@ case $FC_BASENAME in # f95) # Set required flag for compiling C stubs - H5_CFLAGS="$H5_CFLAGS" + H5_CFLAGS="$H5_CFLAGS" F9XSUFFIXFLAG="" -# We force compiler to use upper case for external names +# We force compiler to use upper case for external names # (just in case since this should be a default EIP) H5_FCFLAGS="$H5_FCFLAGS" FSEARCH_DIRS="" @@ -173,6 +175,9 @@ if test -z "$CXX"; then CXX_BASENAME=g++ fi +# Figure out GNU CXX compiler flags +. $srcdir/config/gnu-cxxflags + # compiler version strings # check if the compiler_version_info is already set diff --git a/config/netbsd b/config/netbsd new file mode 100644 index 0000000..9a9348b --- /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://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 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/sanitizer/sanitizers.cmake b/config/sanitizer/sanitizers.cmake index ecee2de..0803279 100644 --- a/config/sanitizer/sanitizers.cmake +++ b/config/sanitizer/sanitizers.cmake @@ -29,69 +29,66 @@ function(append value) endfunction() message(STATUS "USE_SANITIZER=${USE_SANITIZER}, CMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}") -if(USE_SANITIZER AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang") - set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +if(USE_SANITIZER) + if(INTEL_CLANG OR "${CMAKE_C_COMPILER_ID}" MATCHES "Clang") + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - append("-fno-omit-frame-pointer" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - message(STATUS "Building with sanitize, base flags=${CMAKE_C_SANITIZER_FLAGS}") + append("-fno-omit-frame-pointer" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + message(STATUS "Building with sanitize, base flags=${CMAKE_C_SANITIZER_FLAGS}") - if(UNIX) - - if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") - append("-O1" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - endif() + if(UNIX) + if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") + append("-O1" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + endif() - if(USE_SANITIZER MATCHES "([Aa]ddress);([Uu]ndefined)" - OR USE_SANITIZER MATCHES "([Uu]ndefined);([Aa]ddress)") - message(STATUS "Building with Address, Undefined sanitizers") - append("-fsanitize=address,undefined" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - set(MEMCHECK_TYPE AddressSanitizer) - elseif(USE_SANITIZER MATCHES "([Aa]ddress)") - # Optional: -fno-optimize-sibling-calls -fsanitize-address-use-after-scope - message(STATUS "Building with Address sanitizer") - append("-fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - set(MEMCHECK_TYPE AddressSanitizer) - elseif(USE_SANITIZER MATCHES "([Mm]emory([Ww]ith[Oo]rigins)?)") - # Optional: -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 - append("-fsanitize=memory" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - if(USE_SANITIZER MATCHES "([Mm]emory[Ww]ith[Oo]rigins)") - message(STATUS "Building with MemoryWithOrigins sanitizer") - append("-fsanitize-memory-track-origins" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + if(USE_SANITIZER MATCHES "([Aa]ddress);([Uu]ndefined)" + OR USE_SANITIZER MATCHES "([Uu]ndefined);([Aa]ddress)") + message(STATUS "Building with Address, Undefined sanitizers") + append("-fsanitize=address,undefined" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + set(MEMCHECK_TYPE AddressSanitizer) + elseif(USE_SANITIZER MATCHES "([Aa]ddress)") + # Optional: -fno-optimize-sibling-calls -fsanitize-address-use-after-scope + message(STATUS "Building with Address sanitizer") + append("-fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + set(MEMCHECK_TYPE AddressSanitizer) + elseif(USE_SANITIZER MATCHES "([Mm]emory([Ww]ith[Oo]rigins)?)") + # Optional: -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 + append("-fsanitize=memory" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + if(USE_SANITIZER MATCHES "([Mm]emory[Ww]ith[Oo]rigins)") + message(STATUS "Building with MemoryWithOrigins sanitizer") + append("-fsanitize-memory-track-origins" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + else() + message(STATUS "Building with Memory sanitizer") + endif() + set(MEMCHECK_TYPE MemorySanitizer) + elseif(USE_SANITIZER MATCHES "([Uu]ndefined)") + message(STATUS "Building with Undefined sanitizer") + append("-fsanitize=undefined" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + if(EXISTS "${BLACKLIST_FILE}") + append("-fsanitize-blacklist=${BLACKLIST_FILE}" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + endif() + set(MEMCHECK_TYPE UndefinedBehaviorSanitizer) + elseif(USE_SANITIZER MATCHES "([Tt]hread)") + message(STATUS "Building with Thread sanitizer") + append("-fsanitize=thread" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + set(MEMCHECK_TYPE ThreadSanitizer) + elseif(USE_SANITIZER MATCHES "([Ll]eak)") + message(STATUS "Building with Leak sanitizer") + append("-fsanitize=leak" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + set(MEMCHECK_TYPE LeakSanitizer) else() - message(STATUS "Building with Memory sanitizer") + message( + FATAL_ERROR "Unsupported value of USE_SANITIZER: ${USE_SANITIZER}") endif() - set(MEMCHECK_TYPE MemorySanitizer) - elseif(USE_SANITIZER MATCHES "([Uu]ndefined)") - message(STATUS "Building with Undefined sanitizer") - append("-fsanitize=undefined" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - if(EXISTS "${BLACKLIST_FILE}") - append("-fsanitize-blacklist=${BLACKLIST_FILE}" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + elseif(MSVC) + if(USE_SANITIZER MATCHES "([Aa]ddress)") + message(STATUS "Building with Address sanitizer") + append("-fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) + else() + message(FATAL_ERROR "This sanitizer not yet supported in the MSVC environment: ${USE_SANITIZER}") endif() - set(MEMCHECK_TYPE UndefinedBehaviorSanitizer) - elseif(USE_SANITIZER MATCHES "([Tt]hread)") - message(STATUS "Building with Thread sanitizer") - append("-fsanitize=thread" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - set(MEMCHECK_TYPE ThreadSanitizer) - elseif(USE_SANITIZER MATCHES "([Ll]eak)") - message(STATUS "Building with Leak sanitizer") - append("-fsanitize=leak" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - set(MEMCHECK_TYPE LeakSanitizer) else() - message( - FATAL_ERROR "Unsupported value of USE_SANITIZER: ${USE_SANITIZER}") + message(FATAL_ERROR "USE_SANITIZER is not supported on this platform.") endif() - elseif(MSVC) - if(USE_SANITIZER MATCHES "([Aa]ddress)") - message(STATUS "Building with Address sanitizer") - append("-fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) - else() - message( - FATAL_ERROR - "This sanitizer not yet supported in the MSVC environment: ${USE_SANITIZER}" - ) - endif() - else() - message(FATAL_ERROR "USE_SANITIZER is not supported on this platform.") endif() - endif() diff --git a/config/solaris b/config/solaris index 394daaf..4c55f54 100644 --- a/config/solaris +++ b/config/solaris @@ -67,6 +67,7 @@ fi if test "X-" = "X-$f9x_flags_set"; then F9XSUFFIXFLAG="" FSEARCH_DIRS="" + H5_FCFLAGS="$H5_FCFLAGS" # -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. 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/configure.ac b/configure.ac index 67c2ec4..5558d29 100644 --- a/configure.ac +++ b/configure.ac @@ -99,7 +99,11 @@ AC_SUBST([CPPFLAGS]) ## H5_CFLAGS (and company) are for CFLAGS that should be used on HDF5, but ## not exported to h5cc (or h5fc, etc.) +## +## H5_ECFLAGS is for warnings that should be treated as errors. +## AC_SUBST([H5_CFLAGS]) +AC_SUBST([H5_ECFLAGS]) AC_SUBST([H5_CPPFLAGS]) AC_SUBST([H5_FCFLAGS]) AC_SUBST([H5_CXXFLAGS]) @@ -190,7 +194,7 @@ AC_SUBST([UNAME_INFO]) UNAME_INFO=`uname -a` ## ---------------------------------------------------------------------- ## Some platforms have broken basename, and/or xargs programs. Check ## that it actually does what it's supposed to do. Catch this early -## since configure and scripts relies upon them heavily and there's +## since configure and scripts relies upon them heavily and there's ## no use continuing if it's broken. ## AC_MSG_CHECKING([if basename works]) @@ -229,13 +233,13 @@ fi ## turning on debug or profiling flags for the compiler. The search order ## is: ## -## CPU-VENDOR-OS -## VENDOR-OS -## CPU-OS -## CPU-VENDOR -## OS -## VENDOR -## CPU +## CPU-VENDOR-OS +## VENDOR-OS +## CPU-OS +## CPU-VENDOR +## OS +## VENDOR +## CPU ## ## If the `OS' ends with a version number then remove it. For instance, ## `freebsd3.1' would become `freebsd' @@ -247,6 +251,9 @@ case $host_os in freebsd*) host_os_novers=freebsd ;; + netbsd*) + host_os_novers=netbsd + ;; solaris*) host_os_novers=solaris ;; @@ -332,7 +339,7 @@ AC_ARG_ENABLE([unsupported], [Allow unsupported combinations of configure options])], [ALLOW_UNSUPPORTED=$enableval]) -case "X-$ALLOW_UNSUPPORTED" in +case "X-$ALLOW_UNSUPPORTED" in X-|X-no) AC_MSG_RESULT([no]) ;; @@ -413,7 +420,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## -------------------------------------------------------------------- ## Check for a Fortran compiler and how to include modules. - ## + ## AC_PROG_FC([PAC_FC_SEARCH_LIST],) AC_F9X_MODS @@ -433,7 +440,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then PAC_PROG_FC_C_SIZEOF ## See if the fortran compiler supports the intrinsic function "STORAGE_SIZE" - PAC_PROG_FC_STORAGE_SIZE + PAC_PROG_FC_STORAGE_SIZE ## Check to see if -r8 was specified to determine if we need to ## compile the DOUBLE PRECISION interfaces. @@ -470,8 +477,8 @@ AM_CONDITIONAL([FORTRAN_DEFAULT_REALisDBLE_F], [test "X$FORTRAN_DEFAULT_REALisDB ## We need to check for a C++ compiler unconditionally, since ## AC_PROG_CXX defines some macros that Automake 1.9.x uses and will ## miss even if c++ is not enabled. - AC_PROG_CXX - AC_PROG_CXXCPP ## this is checked for when AC_HEADER_STDC is done +AC_PROG_CXX +AC_PROG_CXXCPP ## this is checked for when AC_HEADER_STDC is done AC_MSG_CHECKING([if c++ interface enabled]) @@ -484,21 +491,26 @@ if test "X$HDF_CXX" = "Xyes"; then echo "yes" HDF5_INTERFACES="$HDF5_INTERFACES c++" + ## Expose the compiler for *.in files + AC_SUBST([CXX]) + ## Change to the C++ language AC_LANG_PUSH(C++) - # Checking if C++ needs old style header files in includes + ## Checking if C++ needs old style header files in includes PAC_PROG_CXX_HEADERS - # Checking if C++ can handle namespaces + ## Checking if C++ can handle namespaces PAC_PROG_CXX_NAMESPACE - - # Checking if C++ has offsetof extension - PAC_PROG_CXX_OFFSETOF - # if C++ can handle static cast + ## if C++ can handle static cast PAC_PROG_CXX_STATIC_CAST + ## Checking if C++ has offsetof extension, + ## note: this test has to be the last of the C++ tests because it sets a definition + ## which would be used in the other tests, causing them to fail. + PAC_PROG_CXX_OFFSETOF + else AC_MSG_RESULT([no]) CXX="no" @@ -551,7 +563,6 @@ fi ## Check which archiving tool to use. This needs to be done before ## the AM_PROG_LIBTOOL macro. ## - if test -z "$AR"; then AC_CHECK_PROGS([AR], [ar xar], [:], [$PATH]) fi @@ -597,36 +608,36 @@ fi ## The following variables are used to distinguish between building a ## serial and parallel library. ## -## HAVE_PARALLEL -- defined in H5config.h if we are building -## a parallel library even if configure wasn't -## able to find some header file or library that -## might be required. This is defined if the -## user explicitly states -## that a parallel library is being built by supplying -## the `--enable-parallel' configure switch. -## -## PARALLEL -- This variable is set to a non-null value if -## we're building a parallel version of the library. -## -## RUNSERIAL -- This is a command which will be prepended to -## the executable name to run the executable using -## a single process. For serial versions of the -## library this will normally be empty. For parallel -## versions it might be something like `mpiexec -n 1'. -## The value of this variable is substituted in *.in -## files. -## -## RUNPARALLEL -- This is a command which will be prepended to -## the executable name to run the executable on -## multiple processors. For the serial library the -## value will normally be the empty string. For -## parallel library it should be something like -## "mpiexec -n \$\${NPROCS:=6}" where NPROCS will -## eventually contain the number of processors on which -## to run the executable (the double dollarsigns are to -## protect the expansion until make executes the -## command). The value of this variable is -## substituted in *.in files. +## HAVE_PARALLEL -- defined in H5config.h if we are building +## a parallel library even if configure wasn't +## able to find some header file or library that +## might be required. This is defined if the +## user explicitly states +## that a parallel library is being built by supplying +## the `--enable-parallel' configure switch. +## +## PARALLEL -- This variable is set to a non-null value if +## we're building a parallel version of the library. +## +## RUNSERIAL -- This is a command which will be prepended to +## the executable name to run the executable using +## a single process. For serial versions of the +## library this will normally be empty. For parallel +## versions it might be something like `mpiexec -n 1'. +## The value of this variable is substituted in *.in +## files. +## +## RUNPARALLEL -- This is a command which will be prepended to +## the executable name to run the executable on +## multiple processors. For the serial library the +## value will normally be the empty string. For +## parallel library it should be something like +## "mpiexec -n \$\${NPROCS:=6}" where NPROCS will +## eventually contain the number of processors on which +## to run the executable (the double dollarsigns are to +## protect the expansion until make executes the +## command). The value of this variable is +## substituted in *.in files. ## AC_SUBST([PARALLEL]) AC_SUBST([RUNSERIAL]) @@ -642,8 +653,8 @@ H5_FORTRAN_SHARED="no" if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then AC_MSG_CHECKING([if shared Fortran libraries are supported]) H5_FORTRAN_SHARED="yes" - ## tell libtool to do the right thing with COMMON symbols, this fixes - ## corrupt values with COMMON and EQUIVALENCE when building shared + ## tell libtool to do the right thing with COMMON symbols, this fixes + ## corrupt values with COMMON and EQUIVALENCE when building shared ## Fortran libraries on OSX with gnu and Intel compilers (HDFFV-2772). case "`uname`" in Darwin*) @@ -652,7 +663,7 @@ if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then esac ## Report results of check(s) - + if test "X${H5_FORTRAN_SHARED}" = "Xno"; then AC_MSG_RESULT([no]) AC_MSG_WARN([$CHECK_WARN]) @@ -674,7 +685,7 @@ fi AM_CONDITIONAL([FORTRAN_SHARED_CONDITIONAL], [test "X$H5_FORTRAN_SHARED" = "Xyes"]) ## ---------------------------------------------------------------------- -## Check if they would like to disable building tests +## Check if they would like to disable building tests ## ## This needs to be exposed for the library info file. @@ -715,6 +726,7 @@ if test "X$HDF5_TOOLS" = "Xno"; then echo "Building HDF5 tools is disabled" fi +## ---------------------------------------------------------------------- ## Create libtool. If shared/static libraries are going to be enabled ## or disabled, it should happen before these macros. LT_PREREQ([2.2]) @@ -727,7 +739,7 @@ LT_INIT([dlopen,win32-dll]) ## ---------------------------------------------------------------------- ## Check if we should install only statically linked executables. ## This check needs to occur after libtool is initialized because -## we check a libtool cache value and may issue a warning based +## we check a libtool cache value and may issue a warning based ## on its result. AC_MSG_CHECKING([if we should install only statically linked executables]) AC_ARG_ENABLE([static_exec], @@ -740,8 +752,8 @@ if test "X$STATIC_EXEC" = "Xyes"; then echo "yes" ## Issue a warning if -static flag is not supported. if test "X$lt_cv_prog_compiler_static_works" = "Xno"; then - echo " warning: -static flag not supported on this system; executable won't statically link shared system libraries." - LT_STATIC_EXEC="" + echo " warning: -static flag not supported on this system; executable won't statically link shared system libraries." + LT_STATIC_EXEC="" else LT_STATIC_EXEC="-all-static" fi @@ -933,11 +945,11 @@ fi ## ---------------------------------------------------------------------- ## Use the macro _AC_SYS_LARGEFILE_MACRO_VALUE to test defines -## that might need to be set for largefile support to behave +## that might need to be set for largefile support to behave ## correctly. This macro is defined in acsite.m4 and overrides ## the version provided by Autoconf (as of v2.65). The custom -## macro additionally adds the appropriate defines to AM_CPPFLAGS -## so that later configure checks have them visible. +## macro additionally adds the appropriate defines to AM_CPPFLAGS +## so that later configure checks have them visible. ## Check for _FILE_OFFSET_BITS _AC_SYS_LARGEFILE_MACRO_VALUE([_FILE_OFFSET_BITS], [64], @@ -960,10 +972,10 @@ case "$host_cpu-$host_vendor-$host_os" in *linux*) ## Add POSIX support on Linux systems, so defines ## __USE_POSIX, which is required to get the prototype for fdopen - ## defined correctly in . + ## defined correctly in . ## ## This flag was removed from h5cc as of 2009-10-17 when it was found - ## that the flag broke compiling netCDF-4 code with h5cc, but kept in + ## that the flag broke compiling netCDF-4 code with h5cc, but kept in ## H5_CPPFLAGS because fdopen and HDfdopen fail without it. HDfdopen ## is used only by H5_debug_mask which is used only when debugging in ## H5_init_library (all in H5.c). When the flag was removed this was @@ -986,7 +998,7 @@ case "$host_cpu-$host_vendor-$host_os" in ;; esac -## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible +## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible ## for configure checks. ## Note: Both will be restored by the end of configure. CPPFLAGS="$H5_CPPFLAGS $AM_CPPFLAGS $CPPFLAGS" @@ -1075,17 +1087,16 @@ AC_CACHE_SAVE ## Check if the dev_t type is a scalar type (must come after the check for ## sys/types.h) AC_MSG_CHECKING([if dev_t is scalar]) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_SYS_TYPES_H #include #endif - ], - [dev_t d1, d2; if(d1==d2) return 0;], - AC_DEFINE([DEV_T_IS_SCALAR], [1], - [Define if `dev_t' is a scalar]) - AC_MSG_RESULT([yes]), - AC_MSG_RESULT([no]) -) + ]], + [[dev_t d1, d2; if(d1==d2) return 0;]])], + [AC_DEFINE([DEV_T_IS_SCALAR], [1], + [Define if dev_t is a scalar]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) ## ---------------------------------------------------------------------- ## Fake --with-xxx option to allow us to create a help message for the @@ -1104,18 +1115,24 @@ AC_ARG_WITH([fnord], ]) ## ---------------------------------------------------------------------- -## Is the dmalloc present? It has a header file `dmalloc.h' and a library -## `-ldmalloc' and their locations might be specified with the `--with-dmalloc' -## command-line switch. The value is an include path and/or a library path. -## If the library path is specified then it must be preceded by a comma. +## Is dmalloc (debug malloc library) requested? It has a header file +## `dmalloc.h' and a library `-ldmalloc' and their locations might be +## specified with the `--with-dmalloc' command-line switch. The value +## is an include path and/or a library path. If the library path is +## specified then it must be preceded by a comma. ## +AC_SUBST([HAVE_DMALLOC]) + +## Default is not present +HAVE_DMALLOC=no + AC_ARG_WITH([dmalloc], [AS_HELP_STRING([--with-dmalloc=DIR], [Use dmalloc memory debugging aid [default=no]])],, [withval=no]) -case $withval in - yes) +case "X-$withval" in + X-yes) HAVE_DMALLOC="yes" AC_CHECK_HEADERS([dmalloc.h],, [unset HAVE_DMALLOC]) if test "x$HAVE_DMALLOC" = "xyes"; then @@ -1125,7 +1142,7 @@ case $withval in AC_MSG_ERROR([couldn't find dmalloc library]) fi ;; - no) + X-|X-no|X-none) HAVE_DMALLOC="no" AC_MSG_CHECKING([for dmalloc library]) AC_MSG_RESULT([suppressed]) @@ -1185,8 +1202,8 @@ AC_ARG_WITH([zlib], filter [default=yes]])],, [withval=yes]) -case $withval in - yes) +case "X-$withval" in + X-yes) HAVE_ZLIB="yes" AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H="yes"], [unset HAVE_ZLIB]) if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes"; then @@ -1200,7 +1217,7 @@ case $withval in AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"]) fi ;; - no) + X-|X-no|X-none) HAVE_ZLIB="no" AC_MSG_CHECKING([for zlib]) AC_MSG_RESULT([suppressed]) @@ -1262,7 +1279,7 @@ if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes" -a "x$HAVE_COMPRESS2" if test "X$EXTERNAL_FILTERS" != "X"; then EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)" + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)" fi @@ -1279,8 +1296,8 @@ AC_ARG_WITH([szlib], filter [default=no]])],, [withval=no]) -case $withval in - yes) +case "X-$withval" in + X-yes) HAVE_SZLIB="yes" AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"], [unset HAVE_SZLIB]) if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then @@ -1290,7 +1307,7 @@ case $withval in AC_MSG_ERROR([couldn't find szlib library]) fi ;; - no) + X-|X-no|X-none) HAVE_SZLIB="no" AC_MSG_CHECKING([for szlib]) AC_MSG_RESULT([suppressed]) @@ -1309,17 +1326,17 @@ case $withval in fi ;; esac - + saved_CPPFLAGS="$CPPFLAGS" saved_AM_CPPFLAGS="$AM_CPPFLAGS" saved_LDFLAGS="$LDFLAGS" saved_AM_LDFLAGS="$AM_LDFLAGS" - + if test -n "$szlib_inc"; then CPPFLAGS="$CPPFLAGS -I$szlib_inc" AM_CPPFLAGS="$AM_CPPFLAGS -I$szlib_inc" fi - + AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"], [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZLIB]) @@ -1328,7 +1345,7 @@ case $withval in LDFLAGS="$LDFLAGS -L$szlib_lib" AM_LDFLAGS="$AM_LDFLAGS -L$szlib_lib" fi - + if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB]) @@ -1345,53 +1362,53 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then AC_MSG_CHECKING([for szlib encoder]) ## Set LD_LIBRARY_PATH so encoder test can find the library and run. - ## Also add LL_PATH substitution to Makefiles so they can use the + ## Also add LL_PATH substitution to Makefiles so they can use the ## path as well, for testing examples. if test -z "$LD_LIBRARY_PATH"; then export LD_LIBRARY_PATH="$szlib_lib" else - export LD_LIBRARY_PATH="$szlib_lib:$LD_LIBRARY_PATH" + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$szlib_lib" fi AC_SUBST([LL_PATH]) LL_PATH="$LD_LIBRARY_PATH" AC_CACHE_VAL([hdf5_cv_szlib_can_encode], - [AC_TRY_RUN([ - #include - - int main(void) - { + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([ + #include "szlib.h" + ],[[ /* SZ_encoder_enabled returns 1 if encoder is present */ - if(SZ_encoder_enabled() == 1) - exit(0); - else - exit(1); - } - ], [hdf5_cv_szlib_can_encode=yes], [hdf5_cv_szlib_can_encode=no],)]) - - AC_DEFINE([HAVE_FILTER_SZIP], [1], + if(SZ_encoder_enabled() == 1) + exit(0); + else + exit(1); + ]])] + , [hdf5_cv_szlib_can_encode=yes], [hdf5_cv_szlib_can_encode=no],)] + ) + + AC_DEFINE([HAVE_FILTER_SZIP], [1], [Define if support for szip filter is enabled]) USE_FILTER_SZIP="yes" if test ${hdf5_cv_szlib_can_encode} = "yes"; then AC_MSG_RESULT([yes]) - fi + fi if test ${hdf5_cv_szlib_can_encode} = "no"; then AC_MSG_RESULT([no]) - fi - + fi + ## Add "szip" to external filter list if test ${hdf5_cv_szlib_can_encode} = "yes"; then if test "X$EXTERNAL_FILTERS" != "X"; then EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" - fi + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" + fi if test ${hdf5_cv_szlib_can_encode} = "no"; then if test "X$EXTERNAL_FILTERS" != "X"; then EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" fi fi @@ -1404,6 +1421,11 @@ AC_CACHE_SAVE ## Enable thread-safe version of library. It requires Pthreads support ## on POSIX systems. ## +AC_SUBST([THREADSAFE]) + +## Default is no thread-safety +THREADSAFE=no + AC_MSG_CHECKING([for thread safe support]) AC_ARG_ENABLE([threadsafe], [AS_HELP_STRING([--enable-threadsafe], @@ -1431,7 +1453,7 @@ if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then fi fi -## --enable-threadsafe is also incompatible with --enable-fortran, unless +## --enable-threadsafe is also incompatible with --enable-fortran unless ## --enable-unsupported has been specified on the configure line. if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then if test "X${HDF_FORTRAN}" = "Xyes" -a "X${enable_threadsafe}" = "Xyes"; then @@ -1444,7 +1466,7 @@ case "X-$THREADSAFE" in AC_MSG_RESULT([no]) ;; X-yes) - THREADSAFE=yes + THREADSAFE=yes AC_MSG_RESULT([yes]) ;; *) @@ -1457,7 +1479,7 @@ if test "X$THREADSAFE" = "Xyes"; then AC_DEFINE([HAVE_THREADSAFE], [1], [Define if we have thread safe support]) ## ---------------------------------------------------------------------- - ## Is the pthreads library present? It has a header file `pthread.h' and + ## Is the Pthreads library present? It has a header file `pthread.h' and ## a library `-lpthread' and their locations might be specified with the ## `--with-pthread' command-line switch. The value is an include path ## and/or a library path. If the library path is specified then it must @@ -1537,11 +1559,12 @@ AC_CHECK_DECL([CLOCK_MONOTONIC],[have_clock_monotonic="yes"],[have_clock_monoton ## First check if `struct tm' has a `tm_gmtoff' member. AC_MSG_CHECKING([for tm_gmtoff in struct tm]) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include - #include ], [struct tm tm; tm.tm_gmtoff=0;], + #include +]], [[struct tm tm; tm.tm_gmtoff=0;]])], [AC_DEFINE([HAVE_TM_GMTOFF], [1], - [Define if `tm_gmtoff' is a member of `struct tm']) + [Define if tm_gmtoff is a member of struct tm]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) @@ -1553,11 +1576,11 @@ case "`uname`" in AC_MSG_RESULT([disabled in CYGWIN]) ;; *) - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include - #include ], [timezone=0;], + #include ]], [[timezone=0;]])], [AC_DEFINE([HAVE_TIMEZONE], [1], - [Define if `timezone' is a global variable]) + [Define if timezone is a global variable]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) ;; @@ -1568,10 +1591,10 @@ esac ## Does the struct stat have the st_blocks field? This field is not Posix. ## AC_MSG_CHECKING([for st_blocks in struct stat]) -AC_TRY_COMPILE([ - #include ],[struct stat sb; sb.st_blocks=0;], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM[[ + #include ]],[[struct stat sb; sb.st_blocks=0;]])], [AC_DEFINE([HAVE_STAT_ST_BLOCKS], [1], - [Define if `struct stat' has the `st_blocks' field]) + [Define if struct stat has the st_blocks field]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) @@ -1589,28 +1612,32 @@ esac AC_CHECK_FUNCS([_scrsize ioctl]) AC_MSG_CHECKING([for struct videoconfig]) -AC_TRY_COMPILE(,[struct videoconfig w; w.numtextcols=0;], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[struct videoconfig w; w.numtextcols=0;]])], [AC_DEFINE([HAVE_STRUCT_VIDEOCONFIG], [1], - [Define if `struct videoconfig' is defined]) + [Define if struct videoconfig is defined]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([for struct text_info]) -AC_TRY_COMPILE(, [struct text_info w; w.screenwidth=0;], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[struct text_info w; w.screenwidth=0;]])], [AC_DEFINE([HAVE_STRUCT_TEXT_INFO], [1], - [Define if `struct text_info' is defined]) + [Define if struct text_info is defined]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([for TIOCGWINSZ]) -AC_TRY_COMPILE([#include ],[int w=TIOCGWINSZ;], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +]],[[int w=TIOCGWINSZ;]])], [AC_DEFINE([HAVE_TIOCGWINSZ], [1], [Define if the ioctl TIOGWINSZ is defined]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([for TIOCGETD]) -AC_TRY_COMPILE([#include ],[int w=TIOCGETD;], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +]],[[int w=TIOCGETD;]])], [AC_DEFINE([HAVE_TIOCGETD], [1], [Define if the ioctl TIOCGETD is defined]) AC_MSG_RESULT([yes])], @@ -1658,26 +1685,26 @@ AC_COMPILE_IFELSE( ) AC_MSG_CHECKING([for __attribute__ extension]) -AC_TRY_COMPILE(,[int __attribute__((unused)) x], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[int __attribute__((unused)) x]])], [AC_DEFINE([HAVE_ATTRIBUTE], [1], [Define if the __attribute__(()) extension is present]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([for __func__ extension]) -AC_TRY_COMPILE(,[ const char *fname = __func__; ], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ const char *fname = __func__; ]])], [AC_DEFINE([HAVE_C99_FUNC], [1], [Define if the compiler understands the __func__ keyword]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([for __FUNCTION__ extension]) -AC_TRY_COMPILE(,[ const char *fname = __FUNCTION__; ], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],,[[ const char *fname = __FUNCTION__; ]])], [AC_DEFINE([HAVE_FUNCTION], [1], [Define if the compiler understands the __FUNCTION__ keyword]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([for C99 designated initialization support]) -AC_TRY_COMPILE(,[ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ typedef struct { int x; union { @@ -1685,7 +1712,7 @@ AC_TRY_COMPILE(,[ double d; } u; } di_struct_t; - di_struct_t x = {0, { .d = 0.0}}; ], + di_struct_t x = {0, { .d = 0.0}}; ]])], [AC_DEFINE([HAVE_C99_DESIGNATED_INITIALIZER], [1], [Define if the compiler understands C99 designated initialization of structs and unions]) AC_MSG_RESULT([yes])], @@ -1700,23 +1727,22 @@ AC_MSG_CHECKING([how to print long long]) AC_CACHE_VAL([hdf5_cv_printf_ll], [ for hdf5_cv_printf_ll in l ll L q unknown; do - AC_TRY_RUN([ - #include - #include - #include - - int main(void) - { - char *s = malloc(128); - long long x = (long long)1048576 * (long long)1048576; - sprintf(s,"%${hdf5_cv_printf_ll}d",x); - exit(strcmp(s,"1099511627776")); - } - ], [break],,[continue]) + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([ + #include + #include + #include + ],[[ + char *s = malloc(128); + long long x = (long long)1048576 * (long long)1048576; + sprintf(s,"%${hdf5_cv_printf_ll}d",x); + exit(strcmp(s,"1099511627776")); + ]])] + , [break],,[continue]) done]) AC_MSG_RESULT([%${hdf5_cv_printf_ll}d and %${hdf5_cv_printf_ll}u]) -AC_DEFINE_UNQUOTED([PRINTF_LL_WIDTH], ["$hdf5_cv_printf_ll"], +AC_DEFINE_UNQUOTED([PRINTF_LL_WIDTH], ["$hdf5_cv_printf_ll"], [Width for printf() for type `long long' or `__int64', use `ll']) ## ---------------------------------------------------------------------- @@ -1947,31 +1973,41 @@ esac ## more scrupulous with it's memory operations. Enabling this also ## disables the library's free space manager code. ## -AC_SUBST([USINGMEMCHECKER]) AC_MSG_CHECKING([whether a memory checking tool will be used]) AC_ARG_ENABLE([using-memchecker], [AS_HELP_STRING([--enable-using-memchecker], [Enable this option if a memory allocation and/or bounds checking tool will be used on the HDF5 library. Enabling this causes the library to be - more picky about it's memory operations and also + more picky about its memory operations and also disables the library's free space manager code. - Default=no.])], + [default=no] + ])], [USINGMEMCHECKER=$enableval]) +## Allow this variable to be substituted in +## other files (src/libhdf5.settings.in, etc.) +AC_SUBST([USINGMEMCHECKER]) + +## Set the default level. +if test "X-$USINGMEMCHECKER" = X- ; then + USINGMEMCHECKER=no +fi + case "X-$USINGMEMCHECKER" in X-yes) - USINGMEMCHECKER=yes - AC_MSG_RESULT([yes]) AC_DEFINE([USING_MEMCHECKER], [1], [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.]) + AC_MSG_RESULT([yes]) ;; - *) - USINGMEMCHECKER=no + X-no) AC_MSG_RESULT([no]) ;; + *) + AC_MSG_ERROR([Unrecognized value: $USINGMEMCHECKER]) + ;; esac ## Checkpoint the cache @@ -2018,11 +2054,11 @@ case "X-$enable_parallel" in ## Try link a simple MPI program. AC_MSG_CHECKING([whether a simple MPI-IO C program can be linked]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[ MPI_Init(0, (void *)0); - MPI_File_open(0, (void *)0, 0, 0, (void *)0);]])], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AC_MSG_ERROR([unable to link a simple MPI-IO C program])]) + [[ MPI_Init(0, (void *)0); + MPI_File_open(0, (void *)0, 0, 0, (void *)0);]])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([unable to link a simple MPI-IO C program])]) if test "X$HDF_FORTRAN" = "Xyes"; then PAC_PROG_FC_MPI_CHECK @@ -2042,6 +2078,8 @@ esac ## ---------------------------------------------------------------------- ## Print some other parallel information and do some sanity checks. +## Needs to be done outside of the PARALLEL block since the serial +## build also needs to have values defined. ## AC_SUBST([ADD_PARALLEL_FILES]) ADD_PARALLEL_FILES="no" @@ -2067,7 +2105,7 @@ if test -n "$PARALLEL"; then fi ## If RUNSERIAL or RUNPARALLEL is the word `none' then replace it with - ## the empty string. This means that no launch commands were requested, + ## the empty string. This means that no launch commands were requested, ## so we will not use any launch commands. if test "X$RUNSERIAL" = "Xnone"; then RUNSERIAL="" @@ -2080,21 +2118,23 @@ if test -n "$PARALLEL"; then ADD_PARALLEL_FILES="yes" AC_MSG_CHECKING([for MPI_Comm_c2f and MPI_Comm_f2c functions]) - AC_TRY_LINK([#include ], - [MPI_Comm c_comm; MPI_Comm_c2f(c_comm)], - AC_DEFINE([HAVE_MPI_MULTI_LANG_Comm], [1], - [Define if `MPI_Comm_c2f' and `MPI_Comm_f2c' exists]) - AC_MSG_RESULT([yes]), - AC_MSG_RESULT([no]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], + [[MPI_Comm c_comm; MPI_Comm_c2f(c_comm)]])], + [AC_DEFINE([HAVE_MPI_MULTI_LANG_Comm], [1], + [Define if MPI_Comm_c2f and MPI_Comm_f2c exist]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])] ) AC_MSG_CHECKING([for MPI_Info_c2f and MPI_Info_f2c functions]) - AC_TRY_LINK([#include ], - [MPI_Info c_info; MPI_Info_c2f(c_info)], - AC_DEFINE([HAVE_MPI_MULTI_LANG_Info], [1], - [Define if `MPI_Info_c2f' and `MPI_Info_f2c' exists]) - AC_MSG_RESULT([yes]), - AC_MSG_RESULT([no]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[MPI_Info c_info; MPI_Info_c2f(c_info)]])], + [AC_DEFINE([HAVE_MPI_MULTI_LANG_Info], [1], + [Define if MPI_Info_c2f and MPI_Info_f2c exist]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])] ) fi @@ -2133,7 +2173,7 @@ if test -n "$PARALLEL"; then fi ;; esac - + if test -n "$mpe_inc"; then saved_CPPFLAGS="$CPPFLAGS" saved_AM_CPPFLAGS="$AM_CPPFLAGS" @@ -2143,7 +2183,7 @@ if test -n "$PARALLEL"; then else AC_CHECK_HEADERS([mpe.h],, [unset MPE]) fi - + if test -n "$mpe_lib"; then saved_LDFLAGS="$LDFLAGS" saved_AM_LDFLAGS="$AM_LDFLAGS" @@ -2165,9 +2205,10 @@ fi ## ---------------------------------------------------------------------- ## Check if Direct I/O driver is enabled by --enable-direct-vfd ## +AC_SUBST([DIRECT_VFD]) -## Check these regardless. If the checks are moved inside the main -## direct VFD block, the output is nested. +## Default is no direct VFD +DIRECT_VFD=no AC_CACHE_VAL([hdf5_cv_direct_io], AC_CHECK_DECL([O_DIRECT], [hdf5_cv_direct_io=yes], [hdf5_cv_direct_io=no], [[#include ]])) @@ -2334,6 +2375,28 @@ fi AC_CACHE_SAVE ## ---------------------------------------------------------------------- +## Use custom examples path. +## +AC_MSG_CHECKING([for custom examples path definition]) +AC_ARG_WITH([examplesdir], + [AS_HELP_STRING([--with-examplesdir=location], + [Specify path for examples + [default="DATAROOTDIR/hdf5_examples"]])],, + withval="${datarootdir}/hdf5_examples") + +if test "X$withval" = "X"; then + AC_MSG_RESULT([default]) + examplesdir="${datarootdir}/hdf5_examples" +else + AC_MSG_RESULT([$withval]) + examplesdir=$withval +fi + +AC_SUBST([examplesdir]) +AC_DEFINE_UNQUOTED([EXAMPLESDIR], ["$examplesdir"], + [Define the examples directory]) + +## ---------------------------------------------------------------------- ## Enable custom plugin default path for library. It requires SHARED support. ## AC_MSG_CHECKING([for custom plugin default path definition]) @@ -2358,12 +2421,12 @@ AC_DEFINE_UNQUOTED([DEFAULT_PLUGINDIR], ["$default_plugindir"], ## Decide whether the presence of user's exception handling functions is ## checked and data conversion exceptions are returned. This is mainly ## for the speed optimization of hard conversions. Soft conversions can -## actually benefit little. +## actually benefit little. ## AC_MSG_CHECKING([whether exception handling functions is checked during data conversions]) AC_ARG_ENABLE([dconv-exception], [AS_HELP_STRING([--enable-dconv-exception], - [if exception handling functions is checked during + [if exception handling functions is checked during data conversions [default=yes]])], [DCONV_EXCEPTION=$enableval], [DCONV_EXCEPTION=yes]) @@ -2378,13 +2441,13 @@ fi ## ---------------------------------------------------------------------- ## Decide whether the data accuracy has higher priority during data ## conversions. If not, some hard conversions will still be prefered even -## though the data may be wrong (for example, some compilers don't +## though the data may be wrong (for example, some compilers don't ## support denormalized floating values) to maximize speed. -## +## AC_MSG_CHECKING([whether data accuracy is guaranteed during data conversions]) AC_ARG_ENABLE([dconv-accuracy], [AS_HELP_STRING([--enable-dconv-accuracy], - [if data accuracy is guaranteed during + [if data accuracy is guaranteed during data conversions [default=yes]])], [DATA_ACCURACY=$enableval], [DATA_ACCURACY=yes]) @@ -2417,9 +2480,9 @@ esac ## ---------------------------------------------------------------------- ## Set the flag to indicate that the machine is using a special algorithm to convert -## 'long double' to '(unsigned) long' values. (This flag should only be set for -## the IBM Power6 Linux. When the bit sequence of long double is -## 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long +## 'long double' to '(unsigned) long' values. (This flag should only be set for +## the IBM Power6 Linux. When the bit sequence of long double is +## 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long ## is 0x004733ce17af227f, not the same as the library's conversion to 0x004733ce17af2282. ## The machine's conversion gets the correct value. We define the macro and disable ## this kind of test until we figure out what algorithm they use. @@ -2496,10 +2559,10 @@ fi ## ---------------------------------------------------------------------- ## Set the flag to indicate that the machine is using a special algorithm -## to convert some values of '(unsigned) long' to 'long double' values. -## (This flag should be off for all machines, except for IBM Power6 Linux, -## when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., -## ..., 7fffff..., the compiler uses a unknown algorithm. We define a +## to convert some values of '(unsigned) long' to 'long double' values. +## (This flag should be off for all machines, except for IBM Power6 Linux, +## when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., +## ..., 7fffff..., the compiler uses a unknown algorithm. We define a ## macro and skip the test for now until we know about the algorithm. ## AC_MSG_CHECKING([if using special algorithm to convert (unsigned) long to long double values]) @@ -2940,9 +3003,9 @@ esac AC_MSG_CHECKING([whether to have library information embedded in the executables]) AC_ARG_ENABLE([embedded-libinfo], [AS_HELP_STRING([--enable-embedded-libinfo], - [Enable embedded library information [default=yes]])], - [enable_embedded_libinfo=$enableval], - [enable_embedded_libinfo=yes]) + [Enable embedded library information [default=yes]])], + [enable_embedded_libinfo=$enableval], + [enable_embedded_libinfo=yes]) if test "${enable_embedded_libinfo}" = "yes"; then AC_MSG_RESULT([yes]) @@ -3095,7 +3158,7 @@ fi if test "X$HDF_FORTRAN" = "Xyes"; then - ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler + ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler ### on Linux (other OSs have not been tested). ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037) @@ -3212,8 +3275,8 @@ fi if test "X$HDF_FORTRAN" = "Xyes"; then chmod 755 fortran/src/h5fc - ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler - ## on OS X, which is needed when building shared libraries on OS X. This script + ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler + ## on OS X, which is needed when building shared libraries on OS X. This script ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) case "`uname`" in Darwin*) @@ -3221,14 +3284,14 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ;; esac - ### libtool does not pass the correct argument linking (-WL,-Wl,,) for the NAG Fortran compiler + ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler ### on Linux (other OSs have not been tested). ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037) case "`uname`" in Linux*) if test "X$FC_BASENAME" = "Xnagfor"; then - cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,-Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,-Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool fi ;; esac diff --git a/examples/Makefile.am b/examples/Makefile.am index f737814..4a48b30 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -80,8 +80,8 @@ CHECK_CLEANFILES+=$(EXTLINK_DIRS) # Example directory # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/c -EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples +EXAMPLEDIR=$(examplesdir)/c +EXAMPLETOPDIR=$(examplesdir) # List dependencies for each program. Normally, automake would take # care of this for us, but if we tell automake about the programs it diff --git a/examples/README b/examples/README index 0550b15..e0a3364 100644 --- a/examples/README +++ b/examples/README @@ -2,7 +2,7 @@ This directory contains example programs for the installed APIs and scripts to compile and run them. Examples in the c and hl/c subdirectories are always -installed, and those in fortan, hl/fortran, c++ and hl/c++ will be installed +installed, and those in fortran, hl/fortran, c++ and hl/c++ will be installed when fortran or c++ are enabled. Running the run-all-ex.sh script in this directory will run the scripts and in diff --git a/examples/run-c-ex.sh.in b/examples/run-c-ex.sh.in index a684a38..0bbe7bb 100644 --- a/examples/run-c-ex.sh.in +++ b/examples/run-c-ex.sh.in @@ -18,7 +18,7 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This script will compile and run the c examples from source files installed # -# in .../share/hdf5_examples/c using h5cc or h5pc. The order for running # +# in @examplesdir@/c using h5cc or h5pc. The order for running # # programs with RunTest in the MAIN section below is taken from the Makefile. # # The order is important since some of the test programs use data files created # # by earlier test programs. Any future additions should be placed accordingly. # @@ -28,10 +28,33 @@ # Initializations EXIT_SUCCESS=0 EXIT_FAILURE=1 - + +# +# Try to derive the path to the installation $prefix established +# by ./configure relative to the examples directory established by +# ./configure. If successful, set `prefix_relto_examplesdir` to the +# relative path. Otherwise, set `prefix_relto_examplesdir` to the +# absolute installation $prefix. +# +# This script uses the value of `prefix` in the user's environment, if +# it is set, below. The content of $() is evaluated in a sub-shell, so +# if `prefix` is set in the user's environment, the shell statements in +# $() won't clobbered it. +# +prefix_relto_examplesdir=$( +prefix=@prefix@ +examplesdir=@examplesdir@ +if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then + echo $(echo ${examplesdir##${prefix}/} | \ + sed 's,[^/][^/]*,..,g') +else + echo $prefix +fi +) + # Where the tool is installed. # default is relative path to installed location of the tools -prefix="${prefix:-../../../}" +prefix="${prefix:-../${prefix_relto_examplesdir}}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/examples/testh5cc.sh.in b/examples/testh5cc.sh.in index 4e898c1..800d4d4 100644 --- a/examples/testh5cc.sh.in +++ b/examples/testh5cc.sh.in @@ -29,8 +29,7 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Where the tool is installed. -# Note: no '/' after DESTDIR. Explanation in commence.am -prefix="${prefix:-${DESTDIR}@prefix@}" +prefix="${prefix:-@prefix@}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am index d78cbb3..a2d322f 100644 --- a/fortran/examples/Makefile.am +++ b/fortran/examples/Makefile.am @@ -76,8 +76,8 @@ endif # Tell automake how to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/fortran -EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples +EXAMPLEDIR=$(examplesdir)/fortran +EXAMPLETOPDIR=$(examplesdir) # List dependencies for each example. Normally, automake would take # care of this for us, but if we tell automake about the programs it diff --git a/fortran/examples/run-fortran-ex.sh.in b/fortran/examples/run-fortran-ex.sh.in index 41bf9b1..b3585b6 100644 --- a/fortran/examples/run-fortran-ex.sh.in +++ b/fortran/examples/run-fortran-ex.sh.in @@ -18,7 +18,7 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This script will compile and run the fortran examples from source files # -# installed in .../share/hdf5_examples/fortran using h5fc or h5pfc. The # +# installed in @examplesdir@/fortran using h5fc or h5pfc. The # # order for running programs with RunTest in the MAIN section below is taken # # from the Makefile. The order is important since some of the test programs # # use data files created by earlier test programs. Any future additions should # @@ -30,9 +30,32 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 +# +# Try to derive the path to the installation $prefix established +# by ./configure relative to the examples directory established by +# ./configure. If successful, set `prefix_relto_examplesdir` to the +# relative path. Otherwise, set `prefix_relto_examplesdir` to the +# absolute installation $prefix. +# +# This script uses the value of `prefix` in the user's environment, if +# it is set, below. The content of $() is evaluated in a sub-shell, so +# if `prefix` is set in the user's environment, the shell statements in +# $() won't clobbered it. +# +prefix_relto_examplesdir=$( +prefix=@prefix@ +examplesdir=@examplesdir@ +if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then + echo $(echo ${examplesdir##${prefix}/} | \ + sed 's,[^/][^/]*,..,g') +else + echo $prefix +fi +) + # Where the tool is installed. # default is relative path to installed location of the tools -prefix="${prefix:-../../../}" +prefix="${prefix:-../${prefix_relto_examplesdir}}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" @@ -120,12 +143,11 @@ then EXIT_VALUE=${EXIT_FAILURE} fi fi - # Cleanup rm *.o rm *.h5 echo -exit $EXIT_VALUE +exit $EXIT_VALUE diff --git a/hl/c++/examples/Makefile.am b/hl/c++/examples/Makefile.am index ce719f5..592e8da 100644 --- a/hl/c++/examples/Makefile.am +++ b/hl/c++/examples/Makefile.am @@ -33,8 +33,8 @@ CXX_API=yes # Where to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c++ -EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl +EXAMPLEDIR=$(examplesdir)/hl/c++ +EXAMPLETOPDIR=$(examplesdir)/hl # How to build programs using h5c++ $(EXTRA_PROG): $(H5CPP) diff --git a/hl/c++/examples/run-hlc++-ex.sh.in b/hl/c++/examples/run-hlc++-ex.sh.in index 7443407..43831f5 100644 --- a/hl/c++/examples/run-hlc++-ex.sh.in +++ b/hl/c++/examples/run-hlc++-ex.sh.in @@ -18,7 +18,7 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This script will compile and run the c++ examples from source files # -# installed in .../share/hdf5_examples/hl/c++ using h5c++. The # +# installed in @examplesdir@/hl/c++ using h5c++. The # # order for running programs with RunTest in the MAIN section below is taken # # from the Makefile. The order is important since some of the test programs # # use data files created by earlier test programs. Any future additions should # @@ -29,9 +29,33 @@ # Initializations EXIT_SUCCESS=0 EXIT_FAILURE=1 + +# +# Try to derive the path to the installation $prefix established +# by ./configure relative to the examples directory established by +# ./configure. If successful, set `prefix_relto_examplesdir` to the +# relative path. Otherwise, set `prefix_relto_examplesdir` to the +# absolute installation $prefix. +# +# This script uses the value of `prefix` in the user's environment, if +# it is set, below. The content of $() is evaluated in a sub-shell, so +# if `prefix` is set in the user's environment, the shell statements in +# $() won't clobbered it. +# +prefix_relto_examplesdir=$( +prefix=@prefix@ +examplesdir=@examplesdir@ +if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then + echo $(echo ${examplesdir##${prefix}/} | \ + sed 's,[^/][^/]*,..,g') +else + echo $prefix +fi +) + # Where the tool is installed. # default is relative path to installed location of the tools -prefix="${prefix:-../../../../}" +prefix="${prefix:-../../${prefix_relto_examplesdir}}" AR="@AR@" RANLIB="@RANLIB@" H5TOOL="h5c++" # The tool name diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 866f372..121c0a8 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -28,6 +28,9 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_HL_CPP_LIBSH_TARGET} + PRIVATE "${HDF5_CMAKE_CXX_FLAGS}" + ) target_compile_definitions(${HDF5_HL_CPP_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" ) diff --git a/hl/examples/Makefile.am b/hl/examples/Makefile.am index 29e1a48..cc2d671 100644 --- a/hl/examples/Makefile.am +++ b/hl/examples/Makefile.am @@ -25,8 +25,8 @@ endif # Example directory # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c -EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl +EXAMPLEDIR=$(examplesdir)/hl/c +EXAMPLETOPDIR=$(examplesdir)/hl INSTALL_SCRIPT_FILES = run-hlc-ex.sh INSTALL_TOP_SCRIPT_FILES = run-hl-ex.sh diff --git a/hl/examples/run-hlc-ex.sh.in b/hl/examples/run-hlc-ex.sh.in index 11560ff..e6d0cc9 100644 --- a/hl/examples/run-hlc-ex.sh.in +++ b/hl/examples/run-hlc-ex.sh.in @@ -18,7 +18,7 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This script will compile and run the c examples from source files installed # -# in .../share/hdf5_examples/hl/c using h5cc or h5pc. The order for running # +# in @examplesdir@/hl/c using h5cc or h5pc. The order for running # # programs with RunTest in the MAIN section below is taken from the Makefile. # # The order is important since some of the test programs use data files created # # by earlier test programs. Any future additions should be placed accordingly. # @@ -29,9 +29,32 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 +# +# Try to derive the path to the installation $prefix established +# by ./configure relative to the examples directory established by +# ./configure. If successful, set `prefix_relto_examplesdir` to the +# relative path. Otherwise, set `prefix_relto_examplesdir` to the +# absolute installation $prefix. +# +# This script uses the value of `prefix` in the user's environment, if +# it is set, below. The content of $() is evaluated in a sub-shell, so +# if `prefix` is set in the user's environment, the shell statements in +# $() won't clobbered it. +# +prefix_relto_examplesdir=$( +prefix=@prefix@ +examplesdir=@examplesdir@ +if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then + echo $(echo ${examplesdir##${prefix}/} | \ + sed 's,[^/][^/]*,..,g') +else + echo $prefix +fi +) + # Where the tool is installed. # default is relative path to installed location of the tools -prefix="${prefix:-../../../../}" +prefix="${prefix:-../../${prefix_relto_examplesdir}}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/hl/fortran/examples/Makefile.am b/hl/fortran/examples/Makefile.am index 71c2866..a174094 100644 --- a/hl/fortran/examples/Makefile.am +++ b/hl/fortran/examples/Makefile.am @@ -51,8 +51,8 @@ endif # Tell automake how to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/fortran -EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl +EXAMPLEDIR=$(examplesdir)/hl/fortran +EXAMPLETOPDIR=$(examplesdir)/hl # List dependencies for each example. Normally, automake would take # care of this for us, but if we tell automake about the programs it diff --git a/hl/fortran/examples/run-hlfortran-ex.sh.in b/hl/fortran/examples/run-hlfortran-ex.sh.in index 8e8663d..d7de8e3 100644 --- a/hl/fortran/examples/run-hlfortran-ex.sh.in +++ b/hl/fortran/examples/run-hlfortran-ex.sh.in @@ -18,7 +18,7 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This script will compile and run the fortran examples from source files # -# installed in .../share/hdf5_examples/hl/fortran using h5fc or h5pfc. The # +# installed in @examplesdir@/hl/fortran using h5fc or h5pfc. The # # order for running programs with RunTest in the MAIN section below is taken # # from the Makefile. The order is important since some of the test programs # # use data files created by earlier test programs. Any future additions should # @@ -32,7 +32,7 @@ EXIT_FAILURE=1 # Where the tool is installed. # default is relative path to installed location of the tools -prefix="${prefix:-../../../../}" +prefix="${prefix:-@prefix@}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 136b8ac..f4eae8e 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -36,6 +36,9 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_HL_LIB_TARGET} + PRIVATE "${HDF5_CMAKE_C_FLAGS}" + ) TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC) target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC 0) @@ -50,6 +53,9 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_HL_LIBSH_TARGET} + PRIVATE "${HDF5_CMAKE_C_FLAGS}" + ) target_compile_definitions(${HDF5_HL_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" ) diff --git a/hl/test/Makefile.am b/hl/test/Makefile.am index c176f2e..3365dec 100644 --- a/hl/test/Makefile.am +++ b/hl/test/Makefile.am @@ -1,4 +1,3 @@ -# # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6f6c74c..23449dc 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -56,6 +56,23 @@ New Features Configuration ------------- + - Both build systems use same set of warnings flags + + GNU C warnings flags were moved to files in a config sub-folder + named gnu-warnings. Flags that only are available for a specific + version of the compiler are in files named with that version. + Clang C warnings flags were moved to files in a config sub-folder + named clang-warnings. + + There are flags in named "error-xxx" files with warnings that may + be promoted to errors. Some source files may still need fixes. + + There are also pairs of files named "developer-xxx" and "no-developer-xxx" + that are chosen by the CMake option:HDF5_ENABLE_DEV_WARNINGS or the + configure option:--enable-developer-warnings. + + (ADB - 2020/03/24, TRILAB-192) + - Update CMake minimum version to 3.12 Updated CMake minimum version to 3.12 and added version checks diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0114280..9a22fd5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -965,6 +965,9 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_LIB_TARGET} + PRIVATE "${HDF5_CMAKE_C_FLAGS}" + ) target_compile_definitions(${HDF5_LIB_TARGET} PUBLIC ${HDF_EXTRA_C_FLAGS} @@ -1001,6 +1004,9 @@ if (BUILD_SHARED_LIBS) PUBLIC "$<$:${HDFS_INCLUDE_DIR}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_LIBSH_TARGET} + PRIVATE "${HDF5_CMAKE_C_FLAGS}" + ) target_compile_definitions(${HDF5_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" diff --git a/src/H5Dio.c b/src/H5Dio.c index 1973b54..b359117 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -15,19 +15,20 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#define H5D_PACKAGE /* suppress error about including H5Dpkg */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Dpkg.h" /* Dataset functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Sprivate.h" /* Dataspace */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dpkg.h" /* Dataset functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Sprivate.h" /* Dataspace */ +#include "H5Tprivate.h" /* Datatype */ #ifdef H5_HAVE_PARALLEL /* Remove this if H5R_DATASET_REGION is no longer used in this file */ @@ -89,45 +90,45 @@ static herr_t H5D__typeinfo_term(const H5D_type_info_t *type_info); H5FL_BLK_DEFINE(type_conv); - + /*------------------------------------------------------------------------- - * Function: H5Dread + * Function: H5Dread * - * Purpose: Reads (part of) a DSET from the file into application - * memory BUF. The part of the dataset to read is defined with - * MEM_SPACE_ID and FILE_SPACE_ID. The data points are - * converted from their file type to the MEM_TYPE_ID specified. - * Additional miscellaneous data transfer properties can be - * passed to this function with the PLIST_ID argument. + * Purpose: Reads (part of) a DSET from the file into application + * memory BUF. The part of the dataset to read is defined with + * MEM_SPACE_ID and FILE_SPACE_ID. The data points are + * converted from their file type to the MEM_TYPE_ID specified. + * Additional miscellaneous data transfer properties can be + * passed to this function with the PLIST_ID argument. * - * The FILE_SPACE_ID can be the constant H5S_ALL which indicates - * that the entire file data space is to be referenced. + * The FILE_SPACE_ID can be the constant H5S_ALL which indicates + * that the entire file data space is to be referenced. * - * The MEM_SPACE_ID can be the constant H5S_ALL in which case - * the memory data space is the same as the file data space - * defined when the dataset was created. + * The MEM_SPACE_ID can be the constant H5S_ALL in which case + * the memory data space is the same as the file data space + * defined when the dataset was created. * - * The number of elements in the memory data space must match - * the number of elements in the file data space. + * The number of elements in the memory data space must match + * the number of elements in the file data space. * - * The PLIST_ID can be the constant H5P_DEFAULT in which - * case the default data transfer properties are used. + * The PLIST_ID can be the constant H5P_DEFAULT in which + * case the default data transfer properties are used. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 + * Programmer: Robb Matzke + * Thursday, December 4, 1997 * *------------------------------------------------------------------------- */ herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t plist_id, void *buf/*out*/) + hid_t file_space_id, hid_t plist_id, void *buf/*out*/) { - H5D_t *dset = NULL; - H5P_genplist_t *plist; /* Property list pointer */ - const H5S_t *mem_space = NULL; - const H5S_t *file_space = NULL; + H5D_t *dset = NULL; + H5P_genplist_t *plist; /* Property list pointer */ + const H5S_t *mem_space = NULL; + const H5S_t *file_space = NULL; herr_t ret_value = SUCCEED; /* Return value */ hsize_t *direct_offset = NULL; hbool_t direct_read = FALSE; @@ -227,44 +228,44 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Dread() */ - + /*------------------------------------------------------------------------- - * Function: H5Dwrite + * Function: H5Dwrite * - * Purpose: Writes (part of) a DSET from application memory BUF to the - * file. The part of the dataset to write is defined with the - * MEM_SPACE_ID and FILE_SPACE_ID arguments. The data points - * are converted from their current type (MEM_TYPE_ID) to their - * file datatype. Additional miscellaneous data transfer - * properties can be passed to this function with the - * PLIST_ID argument. + * Purpose: Writes (part of) a DSET from application memory BUF to the + * file. The part of the dataset to write is defined with the + * MEM_SPACE_ID and FILE_SPACE_ID arguments. The data points + * are converted from their current type (MEM_TYPE_ID) to their + * file datatype. Additional miscellaneous data transfer + * properties can be passed to this function with the + * PLIST_ID argument. * - * The FILE_SPACE_ID can be the constant H5S_ALL which indicates - * that the entire file data space is to be referenced. + * The FILE_SPACE_ID can be the constant H5S_ALL which indicates + * that the entire file data space is to be referenced. * - * The MEM_SPACE_ID can be the constant H5S_ALL in which case - * the memory data space is the same as the file data space - * defined when the dataset was created. + * The MEM_SPACE_ID can be the constant H5S_ALL in which case + * the memory data space is the same as the file data space + * defined when the dataset was created. * - * The number of elements in the memory data space must match - * the number of elements in the file data space. + * The number of elements in the memory data space must match + * the number of elements in the file data space. * - * The PLIST_ID can be the constant H5P_DEFAULT in which - * case the default data transfer properties are used. + * The PLIST_ID can be the constant H5P_DEFAULT in which + * case the default data transfer properties are used. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 + * Programmer: Robb Matzke + * Thursday, December 4, 1997 * *------------------------------------------------------------------------- */ herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t dxpl_id, const void *buf) + hid_t file_space_id, hid_t dxpl_id, const void *buf) { - H5D_t *dset = NULL; - H5P_genplist_t *plist; /* Property list pointer */ + H5D_t *dset = NULL; + H5P_genplist_t *plist; /* Property list pointer */ const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; hbool_t direct_write = FALSE; @@ -298,7 +299,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, /* Check dataspace selections if this is not a direct write */ if(!direct_write) { if(mem_space_id < 0 || file_space_id < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") if(H5S_ALL != mem_space_id) { if(NULL == (mem_space = (const H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE))) @@ -325,16 +326,16 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Dwrite() */ - + /*------------------------------------------------------------------------- - * Function: H5D__pre_write + * Function: H5D__pre_write * - * Purpose: Preparation for writing data. + * Purpose: Preparation for writing data. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * 2 November 2012 + * Programmer: Raymond Lu + * 2 November 2012 * *------------------------------------------------------------------------- */ @@ -407,23 +408,23 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__pre_write() */ - + /*------------------------------------------------------------------------- - * Function: H5D__read + * Function: H5D__read * - * Purpose: Reads (part of) a DATASET into application memory BUF. See - * H5Dread() for complete details. + * Purpose: Reads (part of) a DATASET into application memory BUF. See + * H5Dread() for complete details. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 + * Programmer: Robb Matzke + * Thursday, December 4, 1997 * *------------------------------------------------------------------------- */ herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, - const H5S_t *file_space, hid_t dxpl_id, void *buf/*out*/) + const H5S_t *file_space, hid_t dxpl_id, void *buf/*out*/) { H5D_chunk_map_t fm; /* Chunk file<->memory mapping */ H5D_io_info_t io_info; /* Dataset I/O info */ @@ -443,8 +444,8 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* projected mem space must be discarded at the */ /* end of the function to avoid a memory leak. */ H5D_storage_t store; /*union of EFL and chunk pointer in file space */ - hssize_t snelmts; /*total number of elmts (signed) */ - hsize_t nelmts; /*total number of elmts */ + hssize_t snelmts; /*total number of elmts (signed) */ + hsize_t nelmts; /*total number of elmts */ #ifdef H5_HAVE_PARALLEL hbool_t io_info_init = FALSE; /* Whether the I/O info has been initialized */ #endif /*H5_HAVE_PARALLEL*/ @@ -452,7 +453,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ char fake_char; /* Temporary variable for NULL buffer pointers */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -464,7 +465,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if(!mem_space) mem_space = file_space; if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dst dataspace has invalid selection") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dst dataspace has invalid selection") H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t); /* Fill the DXPL cache values for later use */ @@ -496,10 +497,10 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if(nelmts > 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer") - /* If the buffer is nil, and 0 element is selected, make a fake buffer. - * This is for some MPI package like ChaMPIon on NCSA's tungsten which - * doesn't support this feature. - */ + /* If the buffer is nil, and 0 element is selected, make a fake buffer. + * This is for some MPI package like ChaMPIon on NCSA's tungsten which + * doesn't support this feature. + */ buf = &fake_char; } /* end if */ @@ -628,23 +629,23 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__read() */ - + /*------------------------------------------------------------------------- - * Function: H5D__write + * Function: H5D__write * - * Purpose: Writes (part of) a DATASET to a file from application memory - * BUF. See H5Dwrite() for complete details. + * Purpose: Writes (part of) a DATASET to a file from application memory + * BUF. See H5Dwrite() for complete details. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 + * Programmer: Robb Matzke + * Thursday, December 4, 1997 * *------------------------------------------------------------------------- */ static herr_t H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, - const H5S_t *file_space, hid_t dxpl_id, const void *buf) + const H5S_t *file_space, hid_t dxpl_id, const void *buf) { H5D_chunk_map_t fm; /* Chunk file<->memory mapping */ H5D_io_info_t io_info; /* Dataset I/O info */ @@ -664,8 +665,8 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* projected mem space must be discarded at the */ /* end of the function to avoid a memory leak. */ H5D_storage_t store; /*union of EFL and chunk pointer in file space */ - hssize_t snelmts; /*total number of elmts (signed) */ - hsize_t nelmts; /*total number of elmts */ + hssize_t snelmts; /*total number of elmts (signed) */ + hsize_t nelmts; /*total number of elmts */ #ifdef H5_HAVE_PARALLEL hbool_t io_info_init = FALSE; /* Whether the I/O info has been initialized */ #endif /*H5_HAVE_PARALLEL*/ @@ -673,7 +674,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ char fake_char; /* Temporary variable for NULL buffer pointers */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -690,7 +691,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Check if we are allowed to write to this file */ if(0 == (H5F_INTENT(dataset->oloc.file) & H5F_ACC_RDWR)) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "no write intent on file") + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "no write intent on file") /* Fill the DXPL cache values for later use */ if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) @@ -742,12 +743,12 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, mem_space = file_space; if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t); /* Make certain that the number of elements in each selection is the same */ if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest data spaces have different sizes") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest data spaces have different sizes") /* Check for a NULL buffer, after the H5S_ALL dataspace selection has been handled */ if(NULL == buf) { @@ -755,10 +756,10 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if(nelmts > 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer") - /* If the buffer is nil, and 0 element is selected, make a fake buffer. - * This is for some MPI package like ChaMPIon on NCSA's tungsten which - * doesn't support this feature. - */ + /* If the buffer is nil, and 0 element is selected, make a fake buffer. + * This is for some MPI package like ChaMPIon on NCSA's tungsten which + * doesn't support this feature. + */ buf = &fake_char; } /* end if */ @@ -817,7 +818,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, else full_overwrite = (hbool_t)((hsize_t)file_nelmts == nelmts ? TRUE : FALSE); - /* Allocate storage */ + /* Allocate storage */ if(H5D__alloc_storage(dataset, dxpl_id, H5D_ALLOC_WRITE, full_overwrite, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage") } /* end if */ @@ -886,17 +887,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__write() */ - + /*------------------------------------------------------------------------- - * Function: H5D__ioinfo_init + * Function: H5D__ioinfo_init * - * Purpose: Routine for determining correct I/O operations for + * Purpose: Routine for determining correct I/O operations for * each I/O action. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, September 30, 2004 + * Programmer: Quincey Koziol + * Thursday, September 30, 2004 * *------------------------------------------------------------------------- */ @@ -955,17 +956,17 @@ const FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__ioinfo_init() */ - + /*------------------------------------------------------------------------- - * Function: H5D__typeinfo_init + * Function: H5D__typeinfo_init * - * Purpose: Routine for determining correct datatype information for + * Purpose: Routine for determining correct datatype information for * each I/O action. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, March 4, 2008 + * Programmer: Quincey Koziol + * Tuesday, March 4, 2008 * *------------------------------------------------------------------------- */ @@ -974,9 +975,9 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, hid_t mem_type_id, hbool_t do_write, H5D_type_info_t *type_info) { - const H5T_t *src_type; /* Source datatype */ - const H5T_t *dst_type; /* Destination datatype */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5T_t *src_type; /* Source datatype */ + const H5T_t *dst_type; /* Destination datatype */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -989,7 +990,7 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, /* Get the memory & dataset datatypes */ if(NULL == (type_info->mem_type = (const H5T_t *)H5I_object_verify(mem_type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") type_info->dset_type = dset->shared->type; if(do_write) { @@ -1014,7 +1015,7 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, * turns off background preservation. */ if(NULL == (type_info->tpath = H5T_path_find(src_type, dst_type, NULL, NULL, dxpl_id, FALSE))) - HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") + HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") /* Precompute some useful information */ type_info->src_type_size = H5T_get_size(src_type); @@ -1027,7 +1028,7 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, type_info->need_bkg = H5T_BKG_NO; } /* end if */ else { - size_t target_size; /* Desired buffer size */ + size_t target_size; /* Desired buffer size */ /* Check if the datatypes are compound subsets of one another */ type_info->cmpd_subset = H5T_path_compound_subset(type_info->tpath); @@ -1091,7 +1092,7 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, type_info->tconv_buf_allocated = TRUE; } /* end if */ if(type_info->need_bkg && NULL == (type_info->bkg_buf = (uint8_t *)dxpl_cache->bkgr_buf)) { - size_t bkg_size; /* Desired background buffer size */ + size_t bkg_size; /* Desired background buffer size */ /* Compute the background buffer size */ /* (don't try to use buffers smaller than the default size) */ @@ -1112,16 +1113,16 @@ done: } /* end H5D__typeinfo_init() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- - * Function: H5D__ioinfo_adjust + * Function: H5D__ioinfo_adjust * - * Purpose: Adjust operation's I/O info for any parallel I/O + * Purpose: Adjust operation's I/O info for any parallel I/O * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, March 27, 2008 + * Programmer: Quincey Koziol + * Thursday, March 27, 2008 * *------------------------------------------------------------------------- */ @@ -1133,7 +1134,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, H5P_genplist_t *dx_plist; /* Data transer property list */ H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode; /* performed chunk optimization */ H5D_mpio_actual_io_mode_t actual_io_mode; /* performed io mode */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1204,24 +1205,24 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__ioinfo_adjust() */ - + /*------------------------------------------------------------------------- - * Function: H5D__ioinfo_term + * Function: H5D__ioinfo_term * - * Purpose: Common logic for terminating an I/O info object + * Purpose: Common logic for terminating an I/O info object * (Only used for restoring MPI transfer mode currently) * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Friday, February 6, 2004 + * Programmer: Quincey Koziol + * Friday, February 6, 2004 * *------------------------------------------------------------------------- */ static herr_t H5D__ioinfo_term(H5D_io_info_t *io_info) { - herr_t ret_value = SUCCEED; /*return value */ + herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_STATIC @@ -1260,16 +1261,16 @@ done: #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- - * Function: H5D__typeinfo_term + * Function: H5D__typeinfo_term * - * Purpose: Common logic for terminating a type info object + * Purpose: Common logic for terminating a type info object * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, March 6, 2008 + * Programmer: Quincey Koziol + * Thursday, March 6, 2008 * *------------------------------------------------------------------------- */ diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index 49604f4..b1bd4a7 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -478,7 +478,7 @@ static int H5FD_hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2); static herr_t H5FD_hdfs_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static haddr_t H5FD_hdfs_get_eof(const H5FD_t *_file); static herr_t H5FD_hdfs_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, @@ -549,7 +549,7 @@ H5FD_hdfs_init_interface(void) FUNC_LEAVE_NOAPI(H5FD_hdfs_init()) } /* H5FD_hdfs_init_interface() */ - + /*------------------------------------------------------------------------- * Function: H5FD_hdfs_init * @@ -767,7 +767,7 @@ done: } /* H5FD_hdfs_open() */ #endif /* H5_HAVE_LIBHDFS */ - + /*------------------------------------------------------------------------- * Function: H5FD_hdfs_close * @@ -945,7 +945,7 @@ H5FD_hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) /* out FUNC_LEAVE_NOAPI(SUCCEED) } /* H5FD_hdfs_query() */ - + /*------------------------------------------------------------------------- * Function: H5FD_hdfs_get_eoa() * @@ -1056,7 +1056,7 @@ H5FD_hdfs_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, #ifdef H5_HAVE_LIBHDFS static haddr_t -H5FD_hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD_hdfs_get_eof(const H5FD_t *_file) { const H5FD_hdfs_t *file = (const H5FD_hdfs_t *)_file; @@ -1075,7 +1075,7 @@ H5FD_hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) #else /* H5_HAVE_LIBHDFS not defined */ static haddr_t -H5FD_hdfs_get_eof(const H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD_hdfs_get_eof(const H5FD_t H5_ATTR_UNUSED *_file) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1282,7 +1282,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FD_hdfs_write() */ - + /*------------------------------------------------------------------------- * Function: H5FD_hdfs_truncate * diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index f784fac..0c48466 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -46,16 +46,22 @@ #endif /* Loop through all mapped files */ -#define UNIQUE_MEMBERS(MAP,LOOPVAR) { \ - H5FD_mem_t _unmapped, LOOPVAR; \ - hbool_t _seen[H5FD_MEM_NTYPES]; \ +#define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) { \ + H5FD_mem_t ITER, LOOPVAR; \ + unsigned SEEN[H5FD_MEM_NTYPES]; \ \ - memset(_seen, 0, sizeof _seen); \ - for (_unmapped=H5FD_MEM_SUPER; _unmapped0 && LOOPVARfa.memb_fapl[mt]>=0) (void)H5Pclose(file->fa.memb_fapl[mt]); if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]); } END_MEMBERS; + free(file->name); free(file); return 0; @@ -1159,8 +1129,6 @@ H5FD_multi_close(H5FD_t *_file) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1176,14 +1144,18 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) ALL_MEMBERS(mt) { out_mt = mt; - if (f1->memb[mt] && f2->memb[mt]) break; - if (!cmp) { - if (f1->memb[mt]) cmp = -1; - else if (f2->memb[mt]) cmp = 1; + if(f1->memb[mt] && f2->memb[mt]) + break; + if(!cmp) { + if(f1->memb[mt]) + cmp = -1; + else if(f2->memb[mt]) + cmp = 1; } } END_MEMBERS; assert(cmp || out_mt=H5FD_MEM_NTYPES) return cmp; + if(out_mt>=H5FD_MEM_NTYPES) + return cmp; return H5FDcmp(f1->memb[out_mt], f2->memb[out_mt]); } @@ -1202,8 +1174,6 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) * Programmer: Quincey Koziol * Tuesday, September 26, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1297,7 +1267,7 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) memb_eoa = H5FDget_eoa(file->memb[mt], mt); } H5E_END_TRY; - if (HADDR_UNDEF==memb_eoa) + if(HADDR_UNDEF == memb_eoa) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF) } else if (file->fa.relax) { /* @@ -1305,7 +1275,7 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) * best guess about the end-of-file. */ memb_eoa = file->memb_next[mt]; - assert(HADDR_UNDEF!=memb_eoa); + assert(HADDR_UNDEF != memb_eoa); } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF) } @@ -1315,23 +1285,26 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) } END_MEMBERS; } else { H5FD_mem_t mmt = file->fa.memb_map[type]; - if (H5FD_MEM_DEFAULT==mmt) mmt = type; - if (file->memb[mmt]) { + if(H5FD_MEM_DEFAULT == mmt) + mmt = type; + + if(file->memb[mmt]) { H5E_BEGIN_TRY { eoa = H5FDget_eoa(file->memb[mmt], mmt); } H5E_END_TRY; - if (HADDR_UNDEF==eoa) + if(HADDR_UNDEF == eoa) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF) - if (eoa>0) eoa += file->fa.memb_addr[mmt]; - } else if (file->fa.relax) { + if(eoa > 0) + eoa += file->fa.memb_addr[mmt]; + } else if(file->fa.relax) { /* * The member is not open yet (maybe it doesn't exist). Make the * best guess about the end-of-file. */ eoa = file->memb_next[mmt]; - assert(HADDR_UNDEF!=eoa); + assert(HADDR_UNDEF != eoa); } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF) } @@ -1384,13 +1357,15 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) if(H5FD_MEM_DEFAULT == mmt) mmt = type; - /* Handle backward compatibility in a quick and simple way. v1.6 library had EOA for the entire virtual - * file. But it wasn't meaningful. So v1.8 library doesn't have it anymore. It saves the EOA for the - * metadata file, instead. Here we try to figure out whether the EOA is from a v1.6 file by comparing its - * value. If it is a big value, we assume it's from v1.6 and simply discard it. This is the normal case - * when the metadata file has the smallest starting address. If the metadata file has the biggest address, - * the EOAs of v1.6 and v1.8 files are the same. It won't cause any trouble. (Please see Issue 2598 - * in Jira) SLU - 2011/6/21 + /* Handle backward compatibility in a quick and simple way. v1.6 library + * had EOA for the entire virtual file. But it wasn't meaningful. So v1.8 + * library doesn't have it anymore. It saves the EOA for the metadata file, + * instead. Here we try to figure out whether the EOA is from a v1.6 file + * by comparing its value. If it is a big value, we assume it's from v1.6 + * and simply discard it. This is the normal case when the metadata file + * has the smallest starting address. If the metadata file has the biggest + * address, the EOAs of v1.6 and v1.8 files are the same. It won't cause + * any trouble. (Please see Issue 2598 in Jira) SLU - 2011/6/21 */ if(H5FD_MEM_SUPER == type && file->memb_eoa[H5FD_MEM_SUPER] > 0 && eoa > file->memb_eoa[H5FD_MEM_SUPER]) return 0; @@ -1401,7 +1376,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) H5E_BEGIN_TRY { status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt])); } H5E_END_TRY; - if (status<0) + if(status < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1) return 0; @@ -1423,12 +1398,6 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * Raymond Lu - * 5 January 2007 - * Multi driver no longer has EOA for the whole file. Calculate - * it in the same way as EOF instead. - * *------------------------------------------------------------------------- */ static haddr_t @@ -1493,8 +1462,6 @@ H5FD_multi_get_eof(const H5FD_t *_file) * Programmer: Raymond Lu * Sept. 16, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1528,8 +1495,6 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) * Programmer: Robb Matzke * Thursday, August 12, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static haddr_t @@ -1577,8 +1542,6 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) * Programmer: Robb Matzke * Thursday, August 12, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1827,8 +1790,6 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) * Programmer: Robb Matzke * Monday, August 23, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1842,7 +1803,7 @@ compute_next(H5FD_multi_t *file) } END_MEMBERS; UNIQUE_MEMBERS(file->fa.memb_map, mt1) { - UNIQUE_MEMBERS(file->fa.memb_map, mt2) { + UNIQUE_MEMBERS2(file->fa.memb_map, mt2) { if (file->fa.memb_addr[mt1]fa.memb_addr[mt2] && (HADDR_UNDEF==file->memb_next[mt1] || file->memb_next[mt1]>file->fa.memb_addr[mt2])) { @@ -1870,8 +1831,6 @@ compute_next(H5FD_multi_t *file) * Programmer: Robb Matzke * Monday, August 23, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static int diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 3faaf33..819385f 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -238,8 +238,8 @@ typedef struct H5FD_class_t { haddr_t addr, size_t size, const void *buffer); herr_t (*flush)(H5FD_t *file, hid_t dxpl_id, unsigned closing); herr_t (*truncate)(H5FD_t *file, hid_t dxpl_id, hbool_t closing); - herr_t (*lock)(H5FD_t *file, unsigned char *oid, unsigned lock_type, hbool_t last); - herr_t (*unlock)(H5FD_t *file, unsigned char *oid, hbool_t last); + herr_t (*lock)(H5FD_t *file, hbool_t last); + herr_t (*unlock)(H5FD_t *file); H5FD_mem_t fl_map[H5FD_MEM_NTYPES]; } H5FD_class_t; diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 546eb4f..958c1e0 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -152,7 +152,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, if((s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "unable to get external file name") - if(*s == (char)NULL) + if(*s == (char)'\0') HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "invalid external file name") mesg->slot[u].name = H5MM_xstrdup (s); HDassert(mesg->slot[u].name); diff --git a/src/H5Shyper.c b/src/H5Shyper.c index af37b81..6c94b4d 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -2131,7 +2131,6 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) /* Check for a "regular" hyperslab selection */ if(space->select.sel_info.hslab->diminfo_valid) { - unsigned u; /* Local counting variable */ /* Encode number of hyperslabs */ H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t); diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 2054eb5..90391aa 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -8912,7 +8912,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Allocate enough space for the buffer holding temporary * converted value */ - buf_size = (size_t)HDpow((double)2.0f, (double)src.u.f.esize) / 8 + 1; + buf_size = (size_t) (HDpow((double)2.0f, (double)src.u.f.esize) / 8 + 1); int_buf = (uint8_t*)H5MM_calloc(buf_size); /* Get the plist structure. Do I need to close it? */ @@ -9709,7 +9709,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Check if the exponent is too big */ - expo_max = (hsize_t)HDpow((double)2.0f, (double)dst.u.f.esize) - 1; + expo_max = (hsize_t) (HDpow((double)2.0f, (double)dst.u.f.esize) - 1); if(expo > expo_max) { /*overflows*/ if(cb_struct.func) { /*user's exception handler. Reverse back source order*/ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index f519141..e7211f7 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -24,9 +24,9 @@ #include "H5MMpublic.h" /* Memory management */ /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Rprivate.h" /* References */ +#include "H5private.h" /* Generic Functions */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Rprivate.h" /* References */ /* Macro for size of temporary buffers to contain a single element */ #define H5T_ELEM_BUF_SIZE 256 @@ -138,6 +138,7 @@ H5_DLL uint32_t H5T_hash(H5F_t * file, const H5T_t *dt); H5_DLL herr_t H5T_set_latest_version(H5T_t *dt); H5_DLL herr_t H5T_patch_file(H5T_t *dt, H5F_t *f); H5_DLL htri_t H5T_is_variable_str(const H5T_t *dt); +H5_DLL herr_t H5T_patch_vlen_file(H5T_t *dt, H5F_t *f); /* Reference specific functions */ H5_DLL H5R_type_t H5T_get_ref_type(const H5T_t *dt); diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 28e98c2..1044f6c 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -7,6 +7,7 @@ project (HDF5_TOOLS_H5COPY C) if (NOT ONLY_SHARED_LIBS) add_executable (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) target_include_directories (h5copy PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5copy PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5copy STATIC) target_link_libraries (h5copy PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5copy PROPERTIES FOLDER tools) @@ -18,6 +19,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h5copy-shared ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) target_include_directories (h5copy-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5copy-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5copy-shared SHARED) target_link_libraries (h5copy-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5copy-shared PROPERTIES FOLDER tools) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 4808290..7facbe1 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -10,6 +10,8 @@ if (NOT ONLY_SHARED_LIBS) ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c ) target_include_directories (h5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5diff PRIVATE "${HDF5_CMAKE_C_FLAGS}") + #target_compile_definitions (h5diff PRIVATE H5_TOOLS_DEBUG) TARGET_C_PROPERTIES (h5diff STATIC) target_link_libraries (h5diff PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5diff PROPERTIES FOLDER tools) @@ -23,6 +25,8 @@ if (BUILD_SHARED_LIBS) ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c ) target_include_directories (h5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5diff-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") + #target_compile_definitions (h5diff-shared PRIVATE H5_TOOLS_DEBUG) TARGET_C_PROPERTIES (h5diff-shared SHARED) target_link_libraries (h5diff-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5diff-shared PROPERTIES FOLDER tools) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 97cf0e5..2ffa4a8 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -11,8 +11,10 @@ if (NOT ONLY_SHARED_LIBS) ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) target_include_directories (h5dump PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5dump PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5dump STATIC) target_link_libraries (h5dump PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + #target_compile_definitions(h5dump PRIVATE H5_TOOLS_DEBUG) set_target_properties (h5dump PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump") @@ -26,8 +28,10 @@ if (BUILD_SHARED_LIBS) ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) target_include_directories (h5dump-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5dump-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5dump-shared SHARED) target_link_libraries (h5dump-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + #target_compile_definitions(h5dump-shared PRIVATE H5_TOOLS_DEBUG) set_target_properties (h5dump-shared PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump-shared") diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index b8f0c0c..18d7b17 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -7,6 +7,7 @@ project (HDF5_TOOLS_H5LS C) if (NOT ONLY_SHARED_LIBS) add_executable (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) target_include_directories (h5ls PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5ls PRIVATE "${HDF5_CMAKE_C_FLAGS}") #target_compile_definitions(h5ls PRIVATE H5_TOOLS_DEBUG) TARGET_C_PROPERTIES (h5ls STATIC) target_link_libraries (h5ls PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -19,6 +20,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h5ls-shared ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) target_include_directories (h5ls-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5ls-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") #target_compile_definitions(h5ls-shared PRIVATE H5_TOOLS_DEBUG) TARGET_C_PROPERTIES (h5ls-shared SHARED) target_link_libraries (h5ls-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 0a58a31..0346da1 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -17,6 +17,7 @@ set (REPACK_COMMON_SOURCES if (NOT ONLY_SHARED_LIBS) add_executable (h5repack ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) target_include_directories (h5repack PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5repack PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5repack STATIC) target_link_libraries (h5repack PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5repack PROPERTIES FOLDER tools) @@ -28,6 +29,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h5repack-shared ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) target_include_directories (h5repack-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5repack-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5repack-shared SHARED) target_link_libraries (h5repack-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5repack-shared PROPERTIES FOLDER tools) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 96b95ca..c18925e 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -7,6 +7,7 @@ project (HDF5_TOOLS_H5STAT C) if (NOT ONLY_SHARED_LIBS) add_executable (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) target_include_directories (h5stat PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5stat PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5stat STATIC) target_link_libraries (h5stat PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5stat PROPERTIES FOLDER tools) @@ -18,6 +19,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h5stat-shared ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) target_include_directories (h5stat-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5stat-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5stat-shared SHARED) target_link_libraries (h5stat-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5stat-shared PROPERTIES FOLDER tools) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 9ce7538..306c033 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -38,6 +38,9 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_TOOLS_LIB_TARGET} + PRIVATE "${HDF5_CMAKE_C_FLAGS}" + ) #target_compile_definitions(${HDF5_TOOLS_LIB_TARGET} PRIVATE H5_TOOLS_DEBUG) #target_compile_definitions(${HDF5_TOOLS_LIB_TARGET} PRIVATE H5DIFF_DEBUG) TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC) @@ -57,6 +60,9 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_TOOLS_LIBSH_TARGET} + PRIVATE "${HDF5_CMAKE_C_FLAGS}" + ) target_compile_definitions(${HDF5_TOOLS_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" #PRIVATE H5_TOOLS_DEBUG diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index a28f8f9..88f7a45 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -8,6 +8,7 @@ project (HDF5_TOOLS_MISC C) if (NOT ONLY_SHARED_LIBS) add_executable (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) target_include_directories (h5debug PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5debug PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5debug STATIC) target_link_libraries (h5debug PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5debug PROPERTIES FOLDER tools) @@ -15,6 +16,7 @@ if (NOT ONLY_SHARED_LIBS) add_executable (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) target_include_directories (h5repart PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5repart PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5repart STATIC) target_link_libraries (h5repart PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5repart PROPERTIES FOLDER tools) @@ -22,6 +24,7 @@ if (NOT ONLY_SHARED_LIBS) add_executable (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) target_include_directories (h5mkgrp PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5mkgrp PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5mkgrp STATIC) target_link_libraries (h5mkgrp PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5mkgrp PROPERTIES FOLDER tools) @@ -37,12 +40,14 @@ if (BUILD_SHARED_LIBS) add_executable (h5debug-shared ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) target_include_directories (h5debug-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5debug-shared SHARED) + target_compile_options(h5debug-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_link_libraries (h5debug-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5debug-shared PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5debug-shared") add_executable (h5repart-shared ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) target_include_directories (h5repart-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5repart-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5repart-shared SHARED) target_link_libraries (h5repart-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5repart-shared PROPERTIES FOLDER tools) @@ -50,6 +55,7 @@ if (BUILD_SHARED_LIBS) add_executable (h5mkgrp-shared ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) target_include_directories (h5mkgrp-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(h5mkgrp-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5mkgrp-shared SHARED) target_link_libraries (h5mkgrp-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5mkgrp-shared PROPERTIES FOLDER tools) -- cgit v0.12 From 9079eb7c1fd0db5773bb7ceb79c8e1ab356b22fc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 31 Mar 2020 11:31:58 -0500 Subject: Autotools reconfigure update --- MANIFEST | 1 + Makefile.in | 4 +- bin/Makefile.in | 4 +- c++/Makefile.in | 4 +- c++/examples/Makefile.in | 8 +- c++/src/Makefile.in | 4 +- c++/test/Makefile.in | 4 +- config/gnu-cxxflags | 828 ++++++++++++++++++++++++++++++++++ config/gnu-warnings-developer-general | 8 - config/gnu-warnings-general | 32 -- configure | 367 +++++++++------ examples/Makefile.in | 8 +- fortran/Makefile.in | 4 +- fortran/examples/Makefile.in | 8 +- fortran/src/Makefile.in | 4 +- fortran/test/Makefile.in | 4 +- fortran/testpar/Makefile.in | 4 +- hl/Makefile.in | 4 +- hl/c++/Makefile.in | 4 +- hl/c++/examples/Makefile.in | 8 +- hl/c++/src/Makefile.in | 4 +- hl/c++/test/Makefile.in | 4 +- hl/examples/Makefile.in | 8 +- hl/fortran/Makefile.in | 4 +- hl/fortran/examples/Makefile.in | 8 +- hl/fortran/src/Makefile.in | 4 +- hl/fortran/test/Makefile.in | 4 +- hl/src/Makefile.in | 4 +- hl/test/Makefile.in | 5 +- hl/tools/Makefile.in | 4 +- hl/tools/gif2h5/Makefile.in | 4 +- src/H5Edefin.h | 228 +++++----- src/H5Einit.h | 762 +++++++++++++++---------------- src/H5Epubgen.h | 418 ++++++++--------- src/H5Eterm.h | 230 +++++----- src/H5config.h.in | 19 +- src/Makefile.in | 4 +- test/Makefile.in | 4 +- testpar/Makefile.in | 4 +- tools/Makefile.in | 4 +- tools/h5copy/Makefile.in | 4 +- tools/h5diff/Makefile.in | 4 +- tools/h5dump/Makefile.in | 4 +- tools/h5import/Makefile.in | 4 +- tools/h5jam/Makefile.in | 4 +- tools/h5ls/Makefile.in | 4 +- tools/h5repack/Makefile.in | 4 +- tools/h5stat/Makefile.in | 4 +- tools/lib/Makefile.in | 4 +- tools/libtest/Makefile.in | 4 +- tools/misc/Makefile.in | 4 +- tools/perform/Makefile.in | 4 +- 52 files changed, 2033 insertions(+), 1053 deletions(-) create mode 100644 config/gnu-cxxflags delete mode 100644 config/gnu-warnings-developer-general delete mode 100644 config/gnu-warnings-general diff --git a/MANIFEST b/MANIFEST index bb9bf0c..eddbaa4 100644 --- a/MANIFEST +++ b/MANIFEST @@ -103,6 +103,7 @@ ./config/conclude.am ./config/examples.am ./config/freebsd +./config/gnu-cxxflags ./config/gnu-fflags ./config/gnu-flags ./config/cygwin diff --git a/Makefile.in b/Makefile.in index cbdc707..5be2e6e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -243,7 +243,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -305,6 +305,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -424,6 +425,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/bin/Makefile.in b/bin/Makefile.in index 497ab90..95ca83b 100644 --- a/bin/Makefile.in +++ b/bin/Makefile.in @@ -352,7 +352,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -417,6 +417,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -536,6 +537,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/c++/Makefile.in b/c++/Makefile.in index 3ecc49e..cd3e110 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -406,7 +406,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -468,6 +468,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -587,6 +588,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 1358326..e2580bc 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -353,7 +353,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -415,6 +415,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -534,6 +535,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ @@ -642,8 +644,8 @@ CXX_API = yes # Where to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/c++ -EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples +EXAMPLEDIR = $(examplesdir)/c++ +EXAMPLETOPDIR = $(examplesdir) # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 7ad81a0..dfe99da 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -417,7 +417,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src @@ -481,6 +481,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -600,6 +601,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index c08ce1e..db66730 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -405,7 +405,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src, test, and c++/src directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -470,6 +470,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -589,6 +590,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags new file mode 100644 index 0000000..e0f2999 --- /dev/null +++ b/config/gnu-cxxflags @@ -0,0 +1,828 @@ +# -*- 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://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 should be sourced into configure if the compiler is the +# GNU g++ compiler or a derivative. It is careful not to do anything +# if the compiler is not GNU; otherwise `cxx_flags_set' is set to `yes' +# + +# 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 + # 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 + # "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. + cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 | grep -v 'PathScale' |\ + 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++ + fi + if test "-" != "$cxx_vendor-$cxx_version"; then + echo "compiler '$CXX' is GNU $cxx_vendor-$cxx_version" + fi + + # Some 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 + 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 + 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 + + # 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" + + # Production + # NDEBUG is handled explicitly by the configure script + case "$cxx_vendor-$cxx_version" in + g++-[34].*) + PROD_CXXFLAGS= + ;; + g++-[56].*) + PROD_CXXFLAGS="-fstdarg-opt" + ;; + *) + PROD_CXXFLAGS="-finline-functions" + ;; + esac + + # 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" + ;; + *) + DEBUG_CXXFLAGS= + ;; + esac + + # Symbols + NO_SYMBOLS_CXXFLAGS="-s" + SYMBOLS_CXXFLAGS="-g" + + # Profile + PROFILE_CXXFLAGS="-pg" + + # Optimization + case "$cxx_vendor-$cxx_version" in + g++-[34].*) + HIGH_OPT_CXXFLAGS="-O3" + DEBUG_OPT_CXXFLAGS= + ;; + g++-[56].*) + HIGH_OPT_CXXFLAGS="-O3" + DEBUG_OPT_CXXFLAGS="-Og" + ;; + *) + HIGH_OPT_CXXFLAGS="-O" + DEBUG_OPT_CXXFLAGS= + ;; + esac + 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" + + # 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" + ;; + + 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'`" + + # 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" + ;; + + g++-4.0*) + # 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 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" + ;; + + g++-3.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" + + # 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 + +# Clear cxx info if no flags set +if test "X$cxx_flags_set" = "X"; then + cxx_vendor= + cxx_version= +fi diff --git a/config/gnu-warnings-developer-general b/config/gnu-warnings-developer-general deleted file mode 100644 index 698f0e0..0000000 --- a/config/gnu-warnings-developer-general +++ /dev/null @@ -1,8 +0,0 @@ -# (suggestions from gcc, not code problems) -# NOTE: -Wformat-nonliteral added back in here (from being disabled in -# H5_CFLAGS) --Waggregate-return --Wformat-nonliteral --Winline --Wmissing-format-attribute --Wmissing-noreturn diff --git a/config/gnu-warnings-general b/config/gnu-warnings-general deleted file mode 100644 index 9e67b71..0000000 --- a/config/gnu-warnings-general +++ /dev/null @@ -1,32 +0,0 @@ -# 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 -# -# NOTE: Due to the divergence in the C and C++, we're dropping support for -# compiling the C library with a C++ compiler and dropping the -Wc++-compat -# warning. -# --Wno-c++-compat -# -# NOTE: Disable the -Wformat-nonliteral from -Wformat=2 here and re-add -# it to the developer flags. -# --Wno-format-nonliteral --Wshadow --Wundef --Wwrite-strings --pedantic \ No newline at end of file diff --git a/configure b/configure index 48e8e1b..0aa94ae 100755 --- a/configure +++ b/configure @@ -671,6 +671,7 @@ CONFIG_MODE CONFIG_USER CONFIG_DATE H5_VERSION +examplesdir JNI_LDFLAGS HAVE_LIBHDFS ROS3_VFD_CONDITIONAL_FALSE @@ -812,6 +813,7 @@ H5_LDFLAGS H5_CXXFLAGS H5_FCFLAGS H5_CPPFLAGS +H5_ECFLAGS H5_CFLAGS CPPFLAGS host_os @@ -932,6 +934,7 @@ with_mpe enable_direct_vfd enable_ros3_vfd with_libhdfs +with_examplesdir with_default_plugindir enable_dconv_exception enable_dconv_accuracy @@ -1625,8 +1628,8 @@ Optional Features: Enable this option if a memory allocation and/or bounds checking tool will be used on the HDF5 library. Enabling this causes the library to be more - picky about it's memory operations and also disables - the library's free space manager code. Default=no. + picky about its memory operations and also disables + the library's free space manager code. [default=no] --enable-parallel Search for MPI-IO and MPI support files --enable-direct-vfd Build the direct I/O virtual file driver (VFD). This is based on the POSIX (sec2) VFD and requires the @@ -1678,6 +1681,9 @@ Optional Packages: --with-mpe=DIR Use MPE instrumentation [default=no] --with-libhdfs=DIR Provide libhdfs library to enable HDFS virtual file driver (VFD) [default=no] + --with-examplesdir=location + Specify path for examples + [default="DATAROOTDIR/hdf5_examples"] --with-default-plugindir=location Specify default location for plugins [default="/usr/local/hdf5/lib/plugin"] @@ -3849,6 +3855,10 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ## H5_CFLAGS (and company) are for CFLAGS that should be used on HDF5, but ## not exported to h5cc (or h5fc, etc.) +## +## H5_ECFLAGS is for warnings that should be treated as errors. +## + @@ -3993,13 +4003,13 @@ fi ## turning on debug or profiling flags for the compiler. The search order ## is: ## -## CPU-VENDOR-OS -## VENDOR-OS -## CPU-OS -## CPU-VENDOR -## OS -## VENDOR -## CPU +## CPU-VENDOR-OS +## VENDOR-OS +## CPU-OS +## CPU-VENDOR +## OS +## VENDOR +## CPU ## ## If the `OS' ends with a version number then remove it. For instance, ## `freebsd3.1' would become `freebsd' @@ -4011,6 +4021,9 @@ case $host_os in freebsd*) host_os_novers=freebsd ;; + netbsd*) + host_os_novers=netbsd + ;; solaris*) host_os_novers=solaris ;; @@ -6712,7 +6725,7 @@ fi ## We need to check for a C++ compiler unconditionally, since ## AC_PROG_CXX defines some macros that Automake 1.9.x uses and will ## miss even if c++ is not enabled. - ac_ext=cpp +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -7129,7 +7142,7 @@ else fi - ac_ext=cpp +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -7261,7 +7274,7 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - ## this is checked for when AC_HEADER_STDC is done + ## this is checked for when AC_HEADER_STDC is done { $as_echo "$as_me:${as_lineno-$LINENO}: checking if c++ interface enabled" >&5 $as_echo_n "checking if c++ interface enabled... " >&6; } @@ -7276,6 +7289,9 @@ if test "X$HDF_CXX" = "Xyes"; then echo "yes" HDF5_INTERFACES="$HDF5_INTERFACES c++" + ## Expose the compiler for *.in files + + ## Change to the C++ language ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -7284,7 +7300,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # Checking if C++ needs old style header files in includes + ## Checking if C++ needs old style header files in includes { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX needs old style header files in includes" >&5 @@ -7310,7 +7326,7 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - # Checking if C++ can handle namespaces + ## Checking if C++ can handle namespaces { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX can handle namespaces" >&5 $as_echo_n "checking if $CXX can handle namespaces... " >&6; } @@ -7341,7 +7357,38 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - # Checking if C++ has offsetof extension + ## if C++ can handle static cast + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX can handle static cast" >&5 +$as_echo_n "checking if $CXX can handle static cast... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int main(void) { + float test_float; + int test_int; + test_float = 37.0; + test_int = static_cast (test_float); + return 0; +} + +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CXXFLAGS="${CXXFLAGS} -DNO_STATIC_CAST" + AM_CXXFLAGS="${AM_CXXFLAGS} -DNO_STATIC_CAST" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + + ## Checking if C++ has offsetof extension, + ## note: this test has to be the last of the C++ tests because it sets a definition + ## which would be used in the other tests, causing them to fail. { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX has offsetof extension" >&5 $as_echo_n "checking if $CXX has offsetof extension... " >&6; } @@ -7392,35 +7439,6 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - # if C++ can handle static cast - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX can handle static cast" >&5 -$as_echo_n "checking if $CXX can handle static cast... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int main(void) { - float test_float; - int test_int; - test_float = 37.0; - test_int = static_cast (test_float); - return 0; -} - -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CXXFLAGS="${CXXFLAGS} -DNO_STATIC_CAST" - AM_CXXFLAGS="${AM_CXXFLAGS} -DNO_STATIC_CAST" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -7524,7 +7542,6 @@ fi ## Check which archiving tool to use. This needs to be done before ## the AM_PROG_LIBTOOL macro. ## - if test -z "$AR"; then for ac_prog in ar xar do @@ -7684,36 +7701,36 @@ fi ## The following variables are used to distinguish between building a ## serial and parallel library. ## -## HAVE_PARALLEL -- defined in H5config.h if we are building -## a parallel library even if configure wasn't -## able to find some header file or library that -## might be required. This is defined if the -## user explicitly states -## that a parallel library is being built by supplying -## the `--enable-parallel' configure switch. +## HAVE_PARALLEL -- defined in H5config.h if we are building +## a parallel library even if configure wasn't +## able to find some header file or library that +## might be required. This is defined if the +## user explicitly states +## that a parallel library is being built by supplying +## the `--enable-parallel' configure switch. ## -## PARALLEL -- This variable is set to a non-null value if -## we're building a parallel version of the library. +## PARALLEL -- This variable is set to a non-null value if +## we're building a parallel version of the library. ## -## RUNSERIAL -- This is a command which will be prepended to -## the executable name to run the executable using -## a single process. For serial versions of the -## library this will normally be empty. For parallel -## versions it might be something like `mpiexec -n 1'. -## The value of this variable is substituted in *.in -## files. +## RUNSERIAL -- This is a command which will be prepended to +## the executable name to run the executable using +## a single process. For serial versions of the +## library this will normally be empty. For parallel +## versions it might be something like `mpiexec -n 1'. +## The value of this variable is substituted in *.in +## files. ## -## RUNPARALLEL -- This is a command which will be prepended to -## the executable name to run the executable on -## multiple processors. For the serial library the -## value will normally be the empty string. For -## parallel library it should be something like -## "mpiexec -n \$\${NPROCS:=6}" where NPROCS will -## eventually contain the number of processors on which -## to run the executable (the double dollarsigns are to -## protect the expansion until make executes the -## command). The value of this variable is -## substituted in *.in files. +## RUNPARALLEL -- This is a command which will be prepended to +## the executable name to run the executable on +## multiple processors. For the serial library the +## value will normally be the empty string. For +## parallel library it should be something like +## "mpiexec -n \$\${NPROCS:=6}" where NPROCS will +## eventually contain the number of processors on which +## to run the executable (the double dollarsigns are to +## protect the expansion until make executes the +## command). The value of this variable is +## substituted in *.in files. ## @@ -7820,6 +7837,7 @@ if test "X$HDF5_TOOLS" = "Xno"; then echo "Building HDF5 tools is disabled" fi +## ---------------------------------------------------------------------- ## Create libtool. If shared/static libraries are going to be enabled ## or disabled, it should happen before these macros. @@ -22360,8 +22378,8 @@ if test "X$STATIC_EXEC" = "Xyes"; then echo "yes" ## Issue a warning if -static flag is not supported. if test "X$lt_cv_prog_compiler_static_works" = "Xno"; then - echo " warning: -static flag not supported on this system; executable won't statically link shared system libraries." - LT_STATIC_EXEC="" + echo " warning: -static flag not supported on this system; executable won't statically link shared system libraries." + LT_STATIC_EXEC="" else LT_STATIC_EXEC="-all-static" fi @@ -25030,7 +25048,6 @@ $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -25047,12 +25064,18 @@ fi ## ---------------------------------------------------------------------- -## Is the dmalloc present? It has a header file `dmalloc.h' and a library -## `-ldmalloc' and their locations might be specified with the `--with-dmalloc' -## command-line switch. The value is an include path and/or a library path. -## If the library path is specified then it must be preceded by a comma. +## Is dmalloc (debug malloc library) requested? It has a header file +## `dmalloc.h' and a library `-ldmalloc' and their locations might be +## specified with the `--with-dmalloc' command-line switch. The value +## is an include path and/or a library path. If the library path is +## specified then it must be preceded by a comma. ## + +## Default is not present +HAVE_DMALLOC=no + + # Check whether --with-dmalloc was given. if test "${with_dmalloc+set}" = set; then : withval=$with_dmalloc; @@ -25061,8 +25084,8 @@ else fi -case $withval in - yes) +case "X-$withval" in + X-yes) HAVE_DMALLOC="yes" for ac_header in dmalloc.h do : @@ -25139,7 +25162,7 @@ fi as_fn_error $? "couldn't find dmalloc library" "$LINENO" 5 fi ;; - no) + X-|X-no|X-none) HAVE_DMALLOC="no" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc library" >&5 $as_echo_n "checking for dmalloc library... " >&6; } @@ -25271,8 +25294,8 @@ else fi -case $withval in - yes) +case "X-$withval" in + X-yes) HAVE_ZLIB="yes" for ac_header in zlib.h do : @@ -25357,7 +25380,7 @@ fi fi ;; - no) + X-|X-no|X-none) HAVE_ZLIB="no" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib" >&5 $as_echo_n "checking for zlib... " >&6; } @@ -25491,7 +25514,7 @@ $as_echo "#define HAVE_FILTER_DEFLATE 1" >>confdefs.h if test "X$EXTERNAL_FILTERS" != "X"; then EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)" + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)" fi @@ -25511,8 +25534,8 @@ else fi -case $withval in - yes) +case "X-$withval" in + X-yes) HAVE_SZLIB="yes" for ac_header in szlib.h do : @@ -25589,7 +25612,7 @@ fi as_fn_error $? "couldn't find szlib library" "$LINENO" 5 fi ;; - no) + X-|X-no|X-none) HAVE_SZLIB="no" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for szlib" >&5 $as_echo_n "checking for szlib... " >&6; } @@ -25716,7 +25739,7 @@ $as_echo_n "checking for szlib encoder... " >&6; } if test -z "$LD_LIBRARY_PATH"; then export LD_LIBRARY_PATH="$szlib_lib" else - export LD_LIBRARY_PATH="$szlib_lib:$LD_LIBRARY_PATH" + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$szlib_lib" fi LL_PATH="$LD_LIBRARY_PATH" @@ -25733,16 +25756,29 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include + #include "szlib.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 () +{ - int main(void) - { /* SZ_encoder_enabled returns 1 if encoder is present */ - if(SZ_encoder_enabled() == 1) - exit(0); - else - exit(1); - } + if(SZ_encoder_enabled() == 1) + exit(0); + else + exit(1); + + ; + return 0; +} _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -25754,6 +25790,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi @@ -25776,13 +25813,13 @@ $as_echo "no" >&6; } if test "X$EXTERNAL_FILTERS" != "X"; then EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" fi if test ${hdf5_cv_szlib_can_encode} = "no"; then if test "X$EXTERNAL_FILTERS" != "X"; then EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" fi fi @@ -25886,6 +25923,11 @@ rm -f confcache ## Enable thread-safe version of library. It requires Pthreads support ## on POSIX systems. ## + + +## Default is no thread-safety +THREADSAFE=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread safe support" >&5 $as_echo_n "checking for thread safe support... " >&6; } # Check whether --enable-threadsafe was given. @@ -25914,7 +25956,7 @@ if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then fi fi -## --enable-threadsafe is also incompatible with --enable-fortran, unless +## --enable-threadsafe is also incompatible with --enable-fortran unless ## --enable-unsupported has been specified on the configure line. if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then if test "X${HDF_FORTRAN}" = "Xyes" -a "X${enable_threadsafe}" = "Xyes"; then @@ -25945,7 +25987,7 @@ $as_echo "#define HAVE_THREADSAFE 1" >>confdefs.h ## ---------------------------------------------------------------------- - ## Is the pthreads library present? It has a header file `pthread.h' and + ## Is the Pthreads library present? It has a header file `pthread.h' and ## a library `-lpthread' and their locations might be specified with the ## `--with-pthread' command-line switch. The value is an include path ## and/or a library path. If the library path is specified then it must @@ -26244,6 +26286,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include #include + #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -26327,7 +26370,6 @@ $as_echo_n "checking for st_blocks in struct stat... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -26339,10 +26381,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext int main () { -struct stat sb; sb.st_blocks=0; + ; return 0; -} +}[ + #include ],[struct stat sb; sb.st_blocks=0;]) _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -26472,7 +26515,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext $as_echo_n "checking for TIOCGWINSZ... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include + #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -26505,7 +26550,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext $as_echo_n "checking for TIOCGETD... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include + #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -26917,7 +26964,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext int main () { - const char *fname = __FUNCTION__; + ; return 0; } @@ -26993,17 +27040,30 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include - #include + #include + #include + #include + +#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 () +{ + + char *s = malloc(128); + long long x = (long long)1048576 * (long long)1048576; + sprintf(s,"%${hdf5_cv_printf_ll}d",x); + exit(strcmp(s,"1099511627776")); - int main(void) - { - char *s = malloc(128); - long long x = (long long)1048576 * (long long)1048576; - sprintf(s,"%${hdf5_cv_printf_ll}d",x); - exit(strcmp(s,"1099511627776")); - } + ; + return 0; +} _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -27300,7 +27360,6 @@ esac ## more scrupulous with it's memory operations. Enabling this also ## disables the library's free space manager code. ## - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a memory checking tool will be used" >&5 $as_echo_n "checking whether a memory checking tool will be used... " >&6; } # Check whether --enable-using-memchecker was given. @@ -27309,20 +27368,30 @@ if test "${enable_using_memchecker+set}" = set; then : fi +## Allow this variable to be substituted in +## other files (src/libhdf5.settings.in, etc.) + + +## Set the default level. +if test "X-$USINGMEMCHECKER" = X- ; then + USINGMEMCHECKER=no +fi + case "X-$USINGMEMCHECKER" in X-yes) - USINGMEMCHECKER=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } $as_echo "#define USING_MEMCHECKER 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } ;; - *) - USINGMEMCHECKER=no + X-no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; + *) + as_fn_error $? "Unrecognized value: $USINGMEMCHECKER" "$LINENO" 5 + ;; esac ## Checkpoint the cache @@ -27473,7 +27542,7 @@ int main () { MPI_Init(0, (void *)0); - MPI_File_open(0, (void *)0, 0, 0, (void *)0); + MPI_File_open(0, (void *)0, 0, 0, (void *)0); ; return 0; } @@ -27484,7 +27553,7 @@ $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - as_fn_error $? "unable to link a simple MPI-IO C program" "$LINENO" 5 + as_fn_error $? "unable to link a simple MPI-IO C program" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -27544,6 +27613,8 @@ esac ## ---------------------------------------------------------------------- ## Print some other parallel information and do some sanity checks. +## Needs to be done outside of the PARALLEL block since the serial +## build also needs to have values defined. ## ADD_PARALLEL_FILES="no" @@ -27591,7 +27662,9 @@ $as_echo_n "checking for MPI_Comm_c2f and MPI_Comm_f2c functions... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + + #include + #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -27612,7 +27685,7 @@ if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_MPI_MULTI_LANG_Comm 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 @@ -27647,7 +27720,7 @@ if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_MPI_MULTI_LANG_Info 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 @@ -27934,8 +28007,9 @@ fi ## Check if Direct I/O driver is enabled by --enable-direct-vfd ## -## Check these regardless. If the checks are moved inside the main -## direct VFD block, the output is nested. + +## Default is no direct VFD +DIRECT_VFD=no if ${hdf5_cv_direct_io+:} false; then : $as_echo_n "(cached) " >&6 @@ -28517,6 +28591,37 @@ fi rm -f confcache ## ---------------------------------------------------------------------- +## Use custom examples path. +## +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for custom examples path definition" >&5 +$as_echo_n "checking for custom examples path definition... " >&6; } + +# Check whether --with-examplesdir was given. +if test "${with_examplesdir+set}" = set; then : + withval=$with_examplesdir; +else + withval="${datarootdir}/hdf5_examples" +fi + + +if test "X$withval" = "X"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5 +$as_echo "default" >&6; } + examplesdir="${datarootdir}/hdf5_examples" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +$as_echo "$withval" >&6; } + examplesdir=$withval +fi + + + +cat >>confdefs.h <<_ACEOF +#define EXAMPLESDIR "$examplesdir" +_ACEOF + + +## ---------------------------------------------------------------------- ## Enable custom plugin default path for library. It requires SHARED support. ## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for custom plugin default path definition" >&5 @@ -34369,14 +34474,14 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ;; esac - ### libtool does not pass the correct argument linking (-WL,-Wl,,) for the NAG Fortran compiler + ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler ### on Linux (other OSs have not been tested). ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037) case "`uname`" in Linux*) if test "X$FC_BASENAME" = "Xnagfor"; then - cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,-Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,-Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool fi ;; esac diff --git a/examples/Makefile.in b/examples/Makefile.in index 979a2f9..e0d1d9b 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -353,7 +353,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -415,6 +415,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -534,6 +535,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ @@ -652,8 +654,8 @@ EXTLINK_DIRS = red blue u2w # Example directory # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/c -EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples +EXAMPLEDIR = $(examplesdir)/c +EXAMPLETOPDIR = $(examplesdir) @BUILD_SHARED_SZIP_CONDITIONAL_TRUE@LD_LIBRARY_PATH = $(LL_PATH) # Assume that all tests in this directory are examples, and tell diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 8fd1e38..499a09c 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -410,7 +410,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -472,6 +472,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -591,6 +592,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index 24baa4e..eeea786 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -361,7 +361,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -423,6 +423,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -542,6 +543,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ @@ -654,8 +656,8 @@ FORTRAN_API = yes # Tell automake how to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/fortran -EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples +EXAMPLEDIR = $(examplesdir)/fortran +EXAMPLETOPDIR = $(examplesdir) # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 0b0491e..97e343b 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -466,7 +466,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src directory in both Fortran and C flags (C compiler is used # for linking). @@ -532,6 +532,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -651,6 +652,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 0fd73fa..f9a927c 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -474,7 +474,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_builddir)/fortran/src AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @@ -540,6 +540,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -659,6 +660,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index d5eb4e8..8f6cdc7 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -401,7 +401,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -468,6 +468,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -587,6 +588,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/Makefile.in b/hl/Makefile.in index 71b8ffd..492f8d0 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -410,7 +410,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -472,6 +472,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -591,6 +592,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 695e026..cd98f3e 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -406,7 +406,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -468,6 +468,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -587,6 +588,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index 8d0bcd7..e27e485 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -353,7 +353,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -415,6 +415,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -534,6 +535,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ @@ -632,8 +634,8 @@ CXX_API = yes # Where to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c++ -EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl +EXAMPLEDIR = $(examplesdir)/hl/c++ +EXAMPLETOPDIR = $(examplesdir)/hl # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index b58e9a9..76c79b4 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -406,7 +406,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -471,6 +471,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -590,6 +591,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 32c9cc1..62bcbe8 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -401,7 +401,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -468,6 +468,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -587,6 +588,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 5c046b1..45eada2 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -353,7 +353,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -415,6 +415,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -534,6 +535,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ @@ -621,8 +623,8 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 # Example directory # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c -EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl +EXAMPLEDIR = $(examplesdir)/hl/c +EXAMPLETOPDIR = $(examplesdir)/hl INSTALL_SCRIPT_FILES = run-hlc-ex.sh INSTALL_TOP_SCRIPT_FILES = run-hl-ex.sh diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index d05cc89..b607895 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -410,7 +410,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -472,6 +472,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -591,6 +592,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 297e902..df232ba 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -354,7 +354,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -416,6 +416,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -535,6 +536,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ @@ -640,8 +642,8 @@ FORTRAN_API = yes # Tell automake how to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/fortran -EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl +EXAMPLEDIR = $(examplesdir)/hl/fortran +EXAMPLETOPDIR = $(examplesdir)/hl # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index bad1a6c..66bee5e 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -424,7 +424,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src @@ -489,6 +489,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -608,6 +609,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index e4f74f6..22673b7 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -414,7 +414,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_builddir)/src -I$(top_srcdir)/hl/src AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @@ -480,6 +480,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -599,6 +600,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 0581663..b793088 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -406,7 +406,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Add include directories to the C preprocessor flags AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src @@ -470,6 +470,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -589,6 +590,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 4dd0b7b..9b45a37 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -14,7 +14,6 @@ @SET_MAKE@ -# # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. @@ -440,7 +439,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Add include directories to C preprocessor flags AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I. -I$(srcdir) \ @@ -507,6 +506,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -626,6 +626,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index 39b58a2..dbffb8d 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -407,7 +407,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -469,6 +469,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -588,6 +589,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index efa704e..91a0aef 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -419,7 +419,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -484,6 +484,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -603,6 +604,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/src/H5Edefin.h b/src/H5Edefin.h index 88b1e80..6c0e794 100644 --- a/src/H5Edefin.h +++ b/src/H5Edefin.h @@ -19,48 +19,59 @@ #define _H5Edefin_H /* Major error IDs */ -hid_t H5E_LINK_g = FAIL; /* Links */ -hid_t H5E_INTERNAL_g = FAIL; /* Internal error (too specific to document in detail) */ -hid_t H5E_PLUGIN_g = FAIL; /* Plugin for dynamically loaded library */ -hid_t H5E_SLIST_g = FAIL; /* Skip Lists */ -hid_t H5E_SYM_g = FAIL; /* Symbol table */ -hid_t H5E_TST_g = FAIL; /* Ternary Search Trees */ -hid_t H5E_SOHM_g = FAIL; /* Shared Object Header Messages */ +hid_t H5E_DATASET_g = FAIL; /* Dataset */ +hid_t H5E_FUNC_g = FAIL; /* Function entry/exit */ hid_t H5E_STORAGE_g = FAIL; /* Data storage */ +hid_t H5E_FILE_g = FAIL; /* File accessibilty */ +hid_t H5E_SOHM_g = FAIL; /* Shared Object Header Messages */ +hid_t H5E_SYM_g = FAIL; /* Symbol table */ +hid_t H5E_PLUGIN_g = FAIL; /* Plugin for dynamically loaded library */ +hid_t H5E_VFL_g = FAIL; /* Virtual File Layer */ +hid_t H5E_INTERNAL_g = FAIL; /* Internal error (too specific to document in detail) */ +hid_t H5E_BTREE_g = FAIL; /* B-Tree node */ +hid_t H5E_REFERENCE_g = FAIL; /* References */ +hid_t H5E_DATASPACE_g = FAIL; /* Dataspace */ +hid_t H5E_RESOURCE_g = FAIL; /* Resource unavailable */ +hid_t H5E_PLIST_g = FAIL; /* Property lists */ +hid_t H5E_LINK_g = FAIL; /* Links */ +hid_t H5E_DATATYPE_g = FAIL; /* Datatype */ hid_t H5E_RS_g = FAIL; /* Reference Counted Strings */ -hid_t H5E_ATOM_g = FAIL; /* Object atom */ hid_t H5E_HEAP_g = FAIL; /* Heap */ -hid_t H5E_DATASET_g = FAIL; /* Dataset */ -hid_t H5E_DATASPACE_g = FAIL; /* Dataspace */ +hid_t H5E_OHDR_g = FAIL; /* Object header */ +hid_t H5E_ATOM_g = FAIL; /* Object atom */ +hid_t H5E_ATTR_g = FAIL; /* Attribute */ +hid_t H5E_NONE_MAJOR_g = FAIL; /* No error */ +hid_t H5E_IO_g = FAIL; /* Low-level I/O */ +hid_t H5E_SLIST_g = FAIL; /* Skip Lists */ +hid_t H5E_EFL_g = FAIL; /* External file list */ +hid_t H5E_TST_g = FAIL; /* Ternary Search Trees */ hid_t H5E_ARGS_g = FAIL; /* Invalid arguments to routine */ hid_t H5E_ERROR_g = FAIL; /* Error API */ -hid_t H5E_RESOURCE_g = FAIL; /* Resource unavailable */ -hid_t H5E_FUNC_g = FAIL; /* Function entry/exit */ hid_t H5E_PLINE_g = FAIL; /* Data filters */ hid_t H5E_FSPACE_g = FAIL; /* Free Space Manager */ -hid_t H5E_ATTR_g = FAIL; /* Attribute */ -hid_t H5E_PLIST_g = FAIL; /* Property lists */ hid_t H5E_CACHE_g = FAIL; /* Object cache */ -hid_t H5E_FILE_g = FAIL; /* File accessibilty */ -hid_t H5E_REFERENCE_g = FAIL; /* References */ -hid_t H5E_NONE_MAJOR_g = FAIL; /* No error */ -hid_t H5E_IO_g = FAIL; /* Low-level I/O */ -hid_t H5E_EFL_g = FAIL; /* External file list */ -hid_t H5E_DATATYPE_g = FAIL; /* Datatype */ -hid_t H5E_VFL_g = FAIL; /* Virtual File Layer */ -hid_t H5E_BTREE_g = FAIL; /* B-Tree node */ -hid_t H5E_OHDR_g = FAIL; /* Object header */ /* Minor error IDs */ -/* System level errors */ -hid_t H5E_SYSERRSTR_g = FAIL; /* System error message */ +/* Generic low-level file I/O errors */ +hid_t H5E_SEEKERROR_g = FAIL; /* Seek failed */ +hid_t H5E_READERROR_g = FAIL; /* Read failed */ +hid_t H5E_WRITEERROR_g = FAIL; /* Write failed */ +hid_t H5E_CLOSEERROR_g = FAIL; /* Close failed */ +hid_t H5E_OVERFLOW_g = FAIL; /* Address overflowed */ +hid_t H5E_FCNTL_g = FAIL; /* File control (fcntl) failed */ -/* Group related errors */ -hid_t H5E_CANTOPENOBJ_g = FAIL; /* Can't open object */ -hid_t H5E_CANTCLOSEOBJ_g = FAIL; /* Can't close object */ -hid_t H5E_COMPLEN_g = FAIL; /* Name component is too long */ -hid_t H5E_PATH_g = FAIL; /* Problem with path to object */ +/* Resource errors */ +hid_t H5E_NOSPACE_g = FAIL; /* No space available for allocation */ +hid_t H5E_CANTALLOC_g = FAIL; /* Can't allocate space */ +hid_t H5E_CANTCOPY_g = FAIL; /* Unable to copy object */ +hid_t H5E_CANTFREE_g = FAIL; /* Unable to free object */ +hid_t H5E_ALREADYEXISTS_g = FAIL; /* Object already exists */ +hid_t H5E_CANTLOCK_g = FAIL; /* Unable to lock object */ +hid_t H5E_CANTUNLOCK_g = FAIL; /* Unable to unlock object */ +hid_t H5E_CANTGC_g = FAIL; /* Unable to garbage collect */ +hid_t H5E_CANTGETSIZE_g = FAIL; /* Unable to compute size */ +hid_t H5E_OBJOPEN_g = FAIL; /* Object is already open */ /* Heap errors */ hid_t H5E_CANTRESTORE_g = FAIL; /* Can't restore condition */ @@ -75,25 +86,11 @@ hid_t H5E_CANTINIT_g = FAIL; /* Unable to initialize object */ hid_t H5E_ALREADYINIT_g = FAIL; /* Object already initialized */ hid_t H5E_CANTRELEASE_g = FAIL; /* Unable to release object */ -/* B-tree related errors */ -hid_t H5E_NOTFOUND_g = FAIL; /* Object not found */ -hid_t H5E_EXISTS_g = FAIL; /* Object already exists */ -hid_t H5E_CANTENCODE_g = FAIL; /* Unable to encode value */ -hid_t H5E_CANTDECODE_g = FAIL; /* Unable to decode value */ -hid_t H5E_CANTSPLIT_g = FAIL; /* Unable to split node */ -hid_t H5E_CANTREDISTRIBUTE_g = FAIL; /* Unable to redistribute records */ -hid_t H5E_CANTSWAP_g = FAIL; /* Unable to swap records */ -hid_t H5E_CANTINSERT_g = FAIL; /* Unable to insert object */ -hid_t H5E_CANTLIST_g = FAIL; /* Unable to list node */ -hid_t H5E_CANTMODIFY_g = FAIL; /* Unable to modify record */ -hid_t H5E_CANTREMOVE_g = FAIL; /* Unable to remove object */ - -/* Argument errors */ -hid_t H5E_UNINITIALIZED_g = FAIL; /* Information is uinitialized */ -hid_t H5E_UNSUPPORTED_g = FAIL; /* Feature is unsupported */ -hid_t H5E_BADTYPE_g = FAIL; /* Inappropriate type */ -hid_t H5E_BADRANGE_g = FAIL; /* Out of range */ -hid_t H5E_BADVALUE_g = FAIL; /* Bad value */ +/* Property list errors */ +hid_t H5E_CANTGET_g = FAIL; /* Can't get value */ +hid_t H5E_CANTSET_g = FAIL; /* Can't set value */ +hid_t H5E_DUPCLASS_g = FAIL; /* Duplicate class name in parent class */ +hid_t H5E_SETDISALLOWED_g = FAIL; /* Disallowed operation */ /* Free space errors */ hid_t H5E_CANTMERGE_g = FAIL; /* Can't merge objects */ @@ -111,17 +108,47 @@ hid_t H5E_CANTPACK_g = FAIL; /* Can't pack messages */ hid_t H5E_CANTRESET_g = FAIL; /* Can't reset object */ hid_t H5E_CANTRENAME_g = FAIL; /* Unable to rename object */ -/* Datatype conversion errors */ -hid_t H5E_CANTCONVERT_g = FAIL; /* Can't convert datatypes */ -hid_t H5E_BADSIZE_g = FAIL; /* Bad size for object */ +/* System level errors */ +hid_t H5E_SYSERRSTR_g = FAIL; /* System error message */ -/* Dataspace errors */ -hid_t H5E_CANTCLIP_g = FAIL; /* Can't clip hyperslab region */ -hid_t H5E_CANTCOUNT_g = FAIL; /* Can't count elements */ -hid_t H5E_CANTSELECT_g = FAIL; /* Can't select hyperslab */ -hid_t H5E_CANTNEXT_g = FAIL; /* Can't move to next iterator location */ -hid_t H5E_BADSELECT_g = FAIL; /* Invalid selection */ -hid_t H5E_CANTCOMPARE_g = FAIL; /* Can't compare objects */ +/* I/O pipeline errors */ +hid_t H5E_NOFILTER_g = FAIL; /* Requested filter is not available */ +hid_t H5E_CALLBACK_g = FAIL; /* Callback failed */ +hid_t H5E_CANAPPLY_g = FAIL; /* Error from filter 'can apply' callback */ +hid_t H5E_SETLOCAL_g = FAIL; /* Error from filter 'set local' callback */ +hid_t H5E_NOENCODER_g = FAIL; /* Filter present but encoding disabled */ +hid_t H5E_CANTFILTER_g = FAIL; /* Filter operation failed */ + +/* Group related errors */ +hid_t H5E_CANTOPENOBJ_g = FAIL; /* Can't open object */ +hid_t H5E_CANTCLOSEOBJ_g = FAIL; /* Can't close object */ +hid_t H5E_COMPLEN_g = FAIL; /* Name component is too long */ +hid_t H5E_PATH_g = FAIL; /* Problem with path to object */ + +/* No error */ +hid_t H5E_NONE_MINOR_g = FAIL; /* No error */ + +/* Plugin errors */ +hid_t H5E_OPENERROR_g = FAIL; /* Can't open directory or file */ + +/* File accessibilty errors */ +hid_t H5E_FILEEXISTS_g = FAIL; /* File already exists */ +hid_t H5E_FILEOPEN_g = FAIL; /* File already open */ +hid_t H5E_CANTCREATE_g = FAIL; /* Unable to create file */ +hid_t H5E_CANTOPENFILE_g = FAIL; /* Unable to open file */ +hid_t H5E_CANTCLOSEFILE_g = FAIL; /* Unable to close file */ +hid_t H5E_NOTHDF5_g = FAIL; /* Not an HDF5 file */ +hid_t H5E_BADFILE_g = FAIL; /* Bad file ID accessed */ +hid_t H5E_TRUNCATED_g = FAIL; /* File has been truncated */ +hid_t H5E_MOUNT_g = FAIL; /* File mount error */ + +/* Object atom related errors */ +hid_t H5E_BADATOM_g = FAIL; /* Unable to find atom information (already closed?) */ +hid_t H5E_BADGROUP_g = FAIL; /* Unable to find ID group information */ +hid_t H5E_CANTREGISTER_g = FAIL; /* Unable to register new atom */ +hid_t H5E_CANTINC_g = FAIL; /* Unable to increment reference count */ +hid_t H5E_CANTDEC_g = FAIL; /* Unable to decrement reference count */ +hid_t H5E_NOIDS_g = FAIL; /* Out of IDs for group */ /* Cache related errors */ hid_t H5E_CANTFLUSH_g = FAIL; /* Unable to flush data from cache */ @@ -140,9 +167,6 @@ hid_t H5E_CANTDIRTY_g = FAIL; /* Unable to mark metadata as dirty */ hid_t H5E_CANTEXPUNGE_g = FAIL; /* Unable to expunge a metadata cache entry */ hid_t H5E_CANTRESIZE_g = FAIL; /* Unable to resize a metadata cache entry */ -/* Plugin errors */ -hid_t H5E_OPENERROR_g = FAIL; /* Can't open directory or file */ - /* Link related errors */ hid_t H5E_TRAVERSE_g = FAIL; /* Link traversal failure */ hid_t H5E_NLINKS_g = FAIL; /* Too many soft links in path */ @@ -150,65 +174,41 @@ hid_t H5E_NOTREGISTERED_g = FAIL; /* Link class not registered */ hid_t H5E_CANTMOVE_g = FAIL; /* Can't move object */ hid_t H5E_CANTSORT_g = FAIL; /* Can't sort objects */ -/* Object atom related errors */ -hid_t H5E_BADATOM_g = FAIL; /* Unable to find atom information (already closed?) */ -hid_t H5E_BADGROUP_g = FAIL; /* Unable to find ID group information */ -hid_t H5E_CANTREGISTER_g = FAIL; /* Unable to register new atom */ -hid_t H5E_CANTINC_g = FAIL; /* Unable to increment reference count */ -hid_t H5E_CANTDEC_g = FAIL; /* Unable to decrement reference count */ -hid_t H5E_NOIDS_g = FAIL; /* Out of IDs for group */ - -/* Generic low-level file I/O errors */ -hid_t H5E_SEEKERROR_g = FAIL; /* Seek failed */ -hid_t H5E_READERROR_g = FAIL; /* Read failed */ -hid_t H5E_WRITEERROR_g = FAIL; /* Write failed */ -hid_t H5E_CLOSEERROR_g = FAIL; /* Close failed */ -hid_t H5E_OVERFLOW_g = FAIL; /* Address overflowed */ -hid_t H5E_FCNTL_g = FAIL; /* File control (fcntl) failed */ - /* Parallel MPI errors */ hid_t H5E_MPI_g = FAIL; /* Some MPI function failed */ hid_t H5E_MPIERRSTR_g = FAIL; /* MPI Error String */ hid_t H5E_CANTRECV_g = FAIL; /* Can't receive data */ -/* File accessibilty errors */ -hid_t H5E_FILEEXISTS_g = FAIL; /* File already exists */ -hid_t H5E_FILEOPEN_g = FAIL; /* File already open */ -hid_t H5E_CANTCREATE_g = FAIL; /* Unable to create file */ -hid_t H5E_CANTOPENFILE_g = FAIL; /* Unable to open file */ -hid_t H5E_CANTCLOSEFILE_g = FAIL; /* Unable to close file */ -hid_t H5E_NOTHDF5_g = FAIL; /* Not an HDF5 file */ -hid_t H5E_BADFILE_g = FAIL; /* Bad file ID accessed */ -hid_t H5E_TRUNCATED_g = FAIL; /* File has been truncated */ -hid_t H5E_MOUNT_g = FAIL; /* File mount error */ - -/* Resource errors */ -hid_t H5E_NOSPACE_g = FAIL; /* No space available for allocation */ -hid_t H5E_CANTALLOC_g = FAIL; /* Can't allocate space */ -hid_t H5E_CANTCOPY_g = FAIL; /* Unable to copy object */ -hid_t H5E_CANTFREE_g = FAIL; /* Unable to free object */ -hid_t H5E_ALREADYEXISTS_g = FAIL; /* Object already exists */ -hid_t H5E_CANTLOCK_g = FAIL; /* Unable to lock object */ -hid_t H5E_CANTUNLOCK_g = FAIL; /* Unable to unlock object */ -hid_t H5E_CANTGC_g = FAIL; /* Unable to garbage collect */ -hid_t H5E_CANTGETSIZE_g = FAIL; /* Unable to compute size */ -hid_t H5E_OBJOPEN_g = FAIL; /* Object is already open */ +/* Dataspace errors */ +hid_t H5E_CANTCLIP_g = FAIL; /* Can't clip hyperslab region */ +hid_t H5E_CANTCOUNT_g = FAIL; /* Can't count elements */ +hid_t H5E_CANTSELECT_g = FAIL; /* Can't select hyperslab */ +hid_t H5E_CANTNEXT_g = FAIL; /* Can't move to next iterator location */ +hid_t H5E_BADSELECT_g = FAIL; /* Invalid selection */ +hid_t H5E_CANTCOMPARE_g = FAIL; /* Can't compare objects */ -/* I/O pipeline errors */ -hid_t H5E_NOFILTER_g = FAIL; /* Requested filter is not available */ -hid_t H5E_CALLBACK_g = FAIL; /* Callback failed */ -hid_t H5E_CANAPPLY_g = FAIL; /* Error from filter 'can apply' callback */ -hid_t H5E_SETLOCAL_g = FAIL; /* Error from filter 'set local' callback */ -hid_t H5E_NOENCODER_g = FAIL; /* Filter present but encoding disabled */ -hid_t H5E_CANTFILTER_g = FAIL; /* Filter operation failed */ +/* Argument errors */ +hid_t H5E_UNINITIALIZED_g = FAIL; /* Information is uinitialized */ +hid_t H5E_UNSUPPORTED_g = FAIL; /* Feature is unsupported */ +hid_t H5E_BADTYPE_g = FAIL; /* Inappropriate type */ +hid_t H5E_BADRANGE_g = FAIL; /* Out of range */ +hid_t H5E_BADVALUE_g = FAIL; /* Bad value */ -/* No error */ -hid_t H5E_NONE_MINOR_g = FAIL; /* No error */ +/* B-tree related errors */ +hid_t H5E_NOTFOUND_g = FAIL; /* Object not found */ +hid_t H5E_EXISTS_g = FAIL; /* Object already exists */ +hid_t H5E_CANTENCODE_g = FAIL; /* Unable to encode value */ +hid_t H5E_CANTDECODE_g = FAIL; /* Unable to decode value */ +hid_t H5E_CANTSPLIT_g = FAIL; /* Unable to split node */ +hid_t H5E_CANTREDISTRIBUTE_g = FAIL; /* Unable to redistribute records */ +hid_t H5E_CANTSWAP_g = FAIL; /* Unable to swap records */ +hid_t H5E_CANTINSERT_g = FAIL; /* Unable to insert object */ +hid_t H5E_CANTLIST_g = FAIL; /* Unable to list node */ +hid_t H5E_CANTMODIFY_g = FAIL; /* Unable to modify record */ +hid_t H5E_CANTREMOVE_g = FAIL; /* Unable to remove object */ -/* Property list errors */ -hid_t H5E_CANTGET_g = FAIL; /* Can't get value */ -hid_t H5E_CANTSET_g = FAIL; /* Can't set value */ -hid_t H5E_DUPCLASS_g = FAIL; /* Duplicate class name in parent class */ -hid_t H5E_SETDISALLOWED_g = FAIL; /* Disallowed operation */ +/* Datatype conversion errors */ +hid_t H5E_CANTCONVERT_g = FAIL; /* Can't convert datatypes */ +hid_t H5E_BADSIZE_g = FAIL; /* Bad size for object */ #endif /* H5Edefin_H */ diff --git a/src/H5Einit.h b/src/H5Einit.h index af4baa1..eeca33e 100644 --- a/src/H5Einit.h +++ b/src/H5Einit.h @@ -22,125 +22,110 @@ /* Major error codes */ /*********************/ -HDassert(H5E_LINK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Links"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_LINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_INTERNAL_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Internal error (too specific to document in detail)"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_INTERNAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_PLUGIN_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Plugin for dynamically loaded library"))==NULL) +HDassert(H5E_DATASET_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataset"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PLUGIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_DATASET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_SLIST_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Skip Lists"))==NULL) +HDassert(H5E_FUNC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Function entry/exit"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_FUNC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_SYM_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Symbol table"))==NULL) +HDassert(H5E_STORAGE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data storage"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SYM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_STORAGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_TST_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Ternary Search Trees"))==NULL) +HDassert(H5E_FILE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "File accessibilty"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_TST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_FILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") HDassert(H5E_SOHM_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Shared Object Header Messages"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_SOHM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_STORAGE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data storage"))==NULL) +HDassert(H5E_SYM_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Symbol table"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_STORAGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SYM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_RS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Reference Counted Strings"))==NULL) +HDassert(H5E_PLUGIN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Plugin for dynamically loaded library"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_RS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_PLUGIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_ATOM_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object atom"))==NULL) +HDassert(H5E_VFL_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Virtual File Layer"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_VFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_HEAP_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Heap"))==NULL) +HDassert(H5E_INTERNAL_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Internal error (too specific to document in detail)"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_HEAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_INTERNAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_DATASET_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataset"))==NULL) +HDassert(H5E_BTREE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "B-Tree node"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DATASET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BTREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_REFERENCE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "References"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_REFERENCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") HDassert(H5E_DATASPACE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataspace"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_DATASPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_ARGS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Invalid arguments to routine"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ARGS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_ERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Error API"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") HDassert(H5E_RESOURCE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Resource unavailable"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_RESOURCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_FUNC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Function entry/exit"))==NULL) +HDassert(H5E_PLIST_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Property lists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FUNC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_PLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_PLINE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data filters"))==NULL) +HDassert(H5E_LINK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Links"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PLINE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_LINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_FSPACE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Free Space Manager"))==NULL) +HDassert(H5E_DATATYPE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Datatype"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_DATATYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_ATTR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Attribute"))==NULL) +HDassert(H5E_RS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Reference Counted Strings"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ATTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_RS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_PLIST_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Property lists"))==NULL) +HDassert(H5E_HEAP_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Heap"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_HEAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CACHE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object cache"))==NULL) +HDassert(H5E_OHDR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object header"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_OHDR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_FILE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "File accessibilty"))==NULL) +HDassert(H5E_ATOM_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object atom"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_REFERENCE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "References"))==NULL) +HDassert(H5E_ATTR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Attribute"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_REFERENCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ATTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") HDassert(H5E_NONE_MAJOR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "No error"))==NULL) @@ -152,30 +137,45 @@ if((msg = H5E_create_msg(cls, H5E_MAJOR, "Low-level I/O"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_IO_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_SLIST_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Skip Lists"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_SLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") HDassert(H5E_EFL_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "External file list"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_EFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_DATATYPE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Datatype"))==NULL) +HDassert(H5E_TST_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Ternary Search Trees"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DATATYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_TST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_VFL_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Virtual File Layer"))==NULL) +HDassert(H5E_ARGS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Invalid arguments to routine"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_VFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ARGS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_BTREE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "B-Tree node"))==NULL) +HDassert(H5E_ERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Error API"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BTREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_OHDR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object header"))==NULL) +HDassert(H5E_PLINE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data filters"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OHDR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_PLINE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_FSPACE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Free Space Manager"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_FSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CACHE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object cache"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /*********************/ @@ -183,33 +183,88 @@ if((H5E_OHDR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) /*********************/ -/* System level errors */ -HDassert(H5E_SYSERRSTR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "System error message"))==NULL) +/* Generic low-level file I/O errors */ +HDassert(H5E_SEEKERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Seek failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SYSERRSTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SEEKERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_READERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Read failed"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_READERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_WRITEERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Write failed"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_WRITEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CLOSEERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Close failed"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CLOSEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_OVERFLOW_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Address overflowed"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_OVERFLOW_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_FCNTL_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "File control (fcntl) failed"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_FCNTL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Group related errors */ -HDassert(H5E_CANTOPENOBJ_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open object"))==NULL) +/* Resource errors */ +HDassert(H5E_NOSPACE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "No space available for allocation"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTOPENOBJ_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTCLOSEOBJ_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't close object"))==NULL) +HDassert(H5E_CANTALLOC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't allocate space"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCLOSEOBJ_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTALLOC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_COMPLEN_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Name component is too long"))==NULL) +HDassert(H5E_CANTCOPY_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to copy object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_COMPLEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCOPY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_PATH_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Problem with path to object"))==NULL) +HDassert(H5E_CANTFREE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to free object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PATH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTFREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_ALREADYEXISTS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_ALREADYEXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTLOCK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to lock object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTUNLOCK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to unlock object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTUNLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTGC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to garbage collect"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTGC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTGETSIZE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to compute size"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTGETSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_OBJOPEN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Object is already open"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_OBJOPEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Heap errors */ @@ -261,88 +316,26 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to release object"))==NULL) if((H5E_CANTRELEASE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* B-tree related errors */ -HDassert(H5E_NOTFOUND_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Object not found"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOTFOUND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_EXISTS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_EXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTENCODE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to encode value"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTENCODE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTDECODE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decode value"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTDECODE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTSPLIT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to split node"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSPLIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTREDISTRIBUTE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to redistribute records"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREDISTRIBUTE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTSWAP_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to swap records"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSWAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTINSERT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to insert object"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTINSERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTLIST_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to list node"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTMODIFY_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to modify record"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTMODIFY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTREMOVE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to remove object"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Argument errors */ -HDassert(H5E_UNINITIALIZED_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Information is uinitialized"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_UNINITIALIZED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_UNSUPPORTED_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Feature is unsupported"))==NULL) +/* Property list errors */ +HDassert(H5E_CANTGET_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't get value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_UNSUPPORTED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTGET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_BADTYPE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Inappropriate type"))==NULL) +HDassert(H5E_CANTSET_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't set value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADTYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTSET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_BADRANGE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of range"))==NULL) +HDassert(H5E_DUPCLASS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Duplicate class name in parent class"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADRANGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_DUPCLASS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_BADVALUE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad value"))==NULL) +HDassert(H5E_SETDISALLOWED_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Disallowed operation"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADVALUE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SETDISALLOWED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Free space errors */ @@ -409,48 +402,158 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to rename object"))==NULL) if((H5E_CANTRENAME_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Datatype conversion errors */ -HDassert(H5E_CANTCONVERT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't convert datatypes"))==NULL) +/* System level errors */ +HDassert(H5E_SYSERRSTR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "System error message"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCONVERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SYSERRSTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_BADSIZE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad size for object"))==NULL) + +/* I/O pipeline errors */ +HDassert(H5E_NOFILTER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Requested filter is not available"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CALLBACK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Callback failed"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CALLBACK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANAPPLY_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'can apply' callback"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANAPPLY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_SETLOCAL_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'set local' callback"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_SETLOCAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_NOENCODER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter present but encoding disabled"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_NOENCODER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTFILTER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter operation failed"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Dataspace errors */ -HDassert(H5E_CANTCLIP_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't clip hyperslab region"))==NULL) +/* Group related errors */ +HDassert(H5E_CANTOPENOBJ_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCLIP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTOPENOBJ_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTCOUNT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't count elements"))==NULL) +HDassert(H5E_CANTCLOSEOBJ_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't close object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCLOSEOBJ_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTSELECT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't select hyperslab"))==NULL) +HDassert(H5E_COMPLEN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Name component is too long"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSELECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_COMPLEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTNEXT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't move to next iterator location"))==NULL) +HDassert(H5E_PATH_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Problem with path to object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTNEXT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_PATH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_BADSELECT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Invalid selection"))==NULL) + +/* No error */ +HDassert(H5E_NONE_MINOR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "No error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADSELECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTCOMPARE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't compare objects"))==NULL) + +/* Plugin errors */ +HDassert(H5E_OPENERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open directory or file"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCOMPARE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_OPENERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") + +/* File accessibilty errors */ +HDassert(H5E_FILEEXISTS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "File already exists"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_FILEEXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_FILEOPEN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "File already open"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_FILEOPEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTCREATE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to create file"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTCREATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTOPENFILE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to open file"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTOPENFILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTCLOSEFILE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to close file"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTCLOSEFILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_NOTHDF5_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Not an HDF5 file"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_NOTHDF5_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_BADFILE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad file ID accessed"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_BADFILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_TRUNCATED_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "File has been truncated"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_TRUNCATED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_MOUNT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "File mount error"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_MOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") + +/* Object atom related errors */ +HDassert(H5E_BADATOM_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find atom information (already closed?)"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_BADATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_BADGROUP_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find ID group information"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_BADGROUP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTREGISTER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to register new atom"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTREGISTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTINC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to increment reference count"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTINC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTDEC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decrement reference count"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTDEC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_NOIDS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of IDs for group"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_NOIDS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Cache related errors */ @@ -530,13 +633,6 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to resize a metadata cache entr if((H5E_CANTRESIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Plugin errors */ -HDassert(H5E_OPENERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open directory or file"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OPENERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - /* Link related errors */ HDassert(H5E_TRAVERSE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Link traversal failure"))==NULL) @@ -564,70 +660,6 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't sort objects"))==NULL) if((H5E_CANTSORT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Object atom related errors */ -HDassert(H5E_BADATOM_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find atom information (already closed?)"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_BADGROUP_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find ID group information"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADGROUP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTREGISTER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to register new atom"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREGISTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTINC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to increment reference count"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTINC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTDEC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decrement reference count"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTDEC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_NOIDS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of IDs for group"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOIDS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Generic low-level file I/O errors */ -HDassert(H5E_SEEKERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Seek failed"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SEEKERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_READERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Read failed"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_READERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_WRITEERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Write failed"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_WRITEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CLOSEERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Close failed"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CLOSEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_OVERFLOW_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Address overflowed"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OVERFLOW_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_FCNTL_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "File control (fcntl) failed"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FCNTL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - /* Parallel MPI errors */ HDassert(H5E_MPI_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Some MPI function failed"))==NULL) @@ -645,164 +677,132 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't receive data"))==NULL) if((H5E_CANTRECV_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* File accessibilty errors */ -HDassert(H5E_FILEEXISTS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "File already exists"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FILEEXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_FILEOPEN_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "File already open"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FILEOPEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTCREATE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to create file"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCREATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTOPENFILE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to open file"))==NULL) +/* Dataspace errors */ +HDassert(H5E_CANTCLIP_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't clip hyperslab region"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTOPENFILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCLIP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTCLOSEFILE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to close file"))==NULL) +HDassert(H5E_CANTCOUNT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't count elements"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCLOSEFILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_NOTHDF5_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Not an HDF5 file"))==NULL) +HDassert(H5E_CANTSELECT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't select hyperslab"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOTHDF5_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTSELECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_BADFILE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad file ID accessed"))==NULL) +HDassert(H5E_CANTNEXT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't move to next iterator location"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADFILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTNEXT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_TRUNCATED_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "File has been truncated"))==NULL) +HDassert(H5E_BADSELECT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Invalid selection"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_TRUNCATED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADSELECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_MOUNT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "File mount error"))==NULL) +HDassert(H5E_CANTCOMPARE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't compare objects"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_MOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCOMPARE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Resource errors */ -HDassert(H5E_NOSPACE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "No space available for allocation"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTALLOC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't allocate space"))==NULL) +/* Argument errors */ +HDassert(H5E_UNINITIALIZED_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Information is uinitialized"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTALLOC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_UNINITIALIZED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTCOPY_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to copy object"))==NULL) +HDassert(H5E_UNSUPPORTED_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Feature is unsupported"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCOPY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_UNSUPPORTED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTFREE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to free object"))==NULL) +HDassert(H5E_BADTYPE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Inappropriate type"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTFREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADTYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_ALREADYEXISTS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL) +HDassert(H5E_BADRANGE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of range"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ALREADYEXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADRANGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTLOCK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to lock object"))==NULL) +HDassert(H5E_BADVALUE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADVALUE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTUNLOCK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to unlock object"))==NULL) + +/* B-tree related errors */ +HDassert(H5E_NOTFOUND_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Object not found"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTUNLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOTFOUND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTGC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to garbage collect"))==NULL) +HDassert(H5E_EXISTS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTGC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_EXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTGETSIZE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to compute size"))==NULL) +HDassert(H5E_CANTENCODE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to encode value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTGETSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTENCODE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_OBJOPEN_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Object is already open"))==NULL) +HDassert(H5E_CANTDECODE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decode value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OBJOPEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTDECODE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* I/O pipeline errors */ -HDassert(H5E_NOFILTER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Requested filter is not available"))==NULL) +HDassert(H5E_CANTSPLIT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to split node"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTSPLIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CALLBACK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Callback failed"))==NULL) +HDassert(H5E_CANTREDISTRIBUTE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to redistribute records"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CALLBACK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTREDISTRIBUTE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANAPPLY_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'can apply' callback"))==NULL) +HDassert(H5E_CANTSWAP_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to swap records"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANAPPLY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTSWAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_SETLOCAL_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'set local' callback"))==NULL) +HDassert(H5E_CANTINSERT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to insert object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SETLOCAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTINSERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_NOENCODER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter present but encoding disabled"))==NULL) +HDassert(H5E_CANTLIST_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to list node"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOENCODER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTFILTER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter operation failed"))==NULL) +HDassert(H5E_CANTMODIFY_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to modify record"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTMODIFY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* No error */ -HDassert(H5E_NONE_MINOR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "No error"))==NULL) +HDassert(H5E_CANTREMOVE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to remove object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTREMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Property list errors */ -HDassert(H5E_CANTGET_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't get value"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTGET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTSET_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't set value"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_DUPCLASS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Duplicate class name in parent class"))==NULL) +/* Datatype conversion errors */ +HDassert(H5E_CANTCONVERT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't convert datatypes"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DUPCLASS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCONVERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_SETDISALLOWED_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Disallowed operation"))==NULL) +HDassert(H5E_BADSIZE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad size for object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SETDISALLOWED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") #endif /* H5Einit_H */ diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h index 3ca7755..0a72245 100644 --- a/src/H5Epubgen.h +++ b/src/H5Epubgen.h @@ -26,86 +26,108 @@ extern "C" { /* Major error codes */ /*********************/ -#define H5E_LINK (H5OPEN H5E_LINK_g) -#define H5E_INTERNAL (H5OPEN H5E_INTERNAL_g) -#define H5E_PLUGIN (H5OPEN H5E_PLUGIN_g) -#define H5E_SLIST (H5OPEN H5E_SLIST_g) -#define H5E_SYM (H5OPEN H5E_SYM_g) -#define H5E_TST (H5OPEN H5E_TST_g) -#define H5E_SOHM (H5OPEN H5E_SOHM_g) +#define H5E_DATASET (H5OPEN H5E_DATASET_g) +#define H5E_FUNC (H5OPEN H5E_FUNC_g) #define H5E_STORAGE (H5OPEN H5E_STORAGE_g) +#define H5E_FILE (H5OPEN H5E_FILE_g) +#define H5E_SOHM (H5OPEN H5E_SOHM_g) +#define H5E_SYM (H5OPEN H5E_SYM_g) +#define H5E_PLUGIN (H5OPEN H5E_PLUGIN_g) +#define H5E_VFL (H5OPEN H5E_VFL_g) +#define H5E_INTERNAL (H5OPEN H5E_INTERNAL_g) +#define H5E_BTREE (H5OPEN H5E_BTREE_g) +#define H5E_REFERENCE (H5OPEN H5E_REFERENCE_g) +#define H5E_DATASPACE (H5OPEN H5E_DATASPACE_g) +#define H5E_RESOURCE (H5OPEN H5E_RESOURCE_g) +#define H5E_PLIST (H5OPEN H5E_PLIST_g) +#define H5E_LINK (H5OPEN H5E_LINK_g) +#define H5E_DATATYPE (H5OPEN H5E_DATATYPE_g) #define H5E_RS (H5OPEN H5E_RS_g) -#define H5E_ATOM (H5OPEN H5E_ATOM_g) #define H5E_HEAP (H5OPEN H5E_HEAP_g) -#define H5E_DATASET (H5OPEN H5E_DATASET_g) -#define H5E_DATASPACE (H5OPEN H5E_DATASPACE_g) +#define H5E_OHDR (H5OPEN H5E_OHDR_g) +#define H5E_ATOM (H5OPEN H5E_ATOM_g) +#define H5E_ATTR (H5OPEN H5E_ATTR_g) +#define H5E_NONE_MAJOR (H5OPEN H5E_NONE_MAJOR_g) +#define H5E_IO (H5OPEN H5E_IO_g) +#define H5E_SLIST (H5OPEN H5E_SLIST_g) +#define H5E_EFL (H5OPEN H5E_EFL_g) +#define H5E_TST (H5OPEN H5E_TST_g) #define H5E_ARGS (H5OPEN H5E_ARGS_g) #define H5E_ERROR (H5OPEN H5E_ERROR_g) -#define H5E_RESOURCE (H5OPEN H5E_RESOURCE_g) -#define H5E_FUNC (H5OPEN H5E_FUNC_g) #define H5E_PLINE (H5OPEN H5E_PLINE_g) #define H5E_FSPACE (H5OPEN H5E_FSPACE_g) -#define H5E_ATTR (H5OPEN H5E_ATTR_g) -#define H5E_PLIST (H5OPEN H5E_PLIST_g) #define H5E_CACHE (H5OPEN H5E_CACHE_g) -#define H5E_FILE (H5OPEN H5E_FILE_g) -#define H5E_REFERENCE (H5OPEN H5E_REFERENCE_g) -#define H5E_NONE_MAJOR (H5OPEN H5E_NONE_MAJOR_g) -#define H5E_IO (H5OPEN H5E_IO_g) -#define H5E_EFL (H5OPEN H5E_EFL_g) -#define H5E_DATATYPE (H5OPEN H5E_DATATYPE_g) -#define H5E_VFL (H5OPEN H5E_VFL_g) -#define H5E_BTREE (H5OPEN H5E_BTREE_g) -#define H5E_OHDR (H5OPEN H5E_OHDR_g) -H5_DLLVAR hid_t H5E_LINK_g; /* Links */ -H5_DLLVAR hid_t H5E_INTERNAL_g; /* Internal error (too specific to document in detail) */ -H5_DLLVAR hid_t H5E_PLUGIN_g; /* Plugin for dynamically loaded library */ -H5_DLLVAR hid_t H5E_SLIST_g; /* Skip Lists */ -H5_DLLVAR hid_t H5E_SYM_g; /* Symbol table */ -H5_DLLVAR hid_t H5E_TST_g; /* Ternary Search Trees */ -H5_DLLVAR hid_t H5E_SOHM_g; /* Shared Object Header Messages */ +H5_DLLVAR hid_t H5E_DATASET_g; /* Dataset */ +H5_DLLVAR hid_t H5E_FUNC_g; /* Function entry/exit */ H5_DLLVAR hid_t H5E_STORAGE_g; /* Data storage */ +H5_DLLVAR hid_t H5E_FILE_g; /* File accessibilty */ +H5_DLLVAR hid_t H5E_SOHM_g; /* Shared Object Header Messages */ +H5_DLLVAR hid_t H5E_SYM_g; /* Symbol table */ +H5_DLLVAR hid_t H5E_PLUGIN_g; /* Plugin for dynamically loaded library */ +H5_DLLVAR hid_t H5E_VFL_g; /* Virtual File Layer */ +H5_DLLVAR hid_t H5E_INTERNAL_g; /* Internal error (too specific to document in detail) */ +H5_DLLVAR hid_t H5E_BTREE_g; /* B-Tree node */ +H5_DLLVAR hid_t H5E_REFERENCE_g; /* References */ +H5_DLLVAR hid_t H5E_DATASPACE_g; /* Dataspace */ +H5_DLLVAR hid_t H5E_RESOURCE_g; /* Resource unavailable */ +H5_DLLVAR hid_t H5E_PLIST_g; /* Property lists */ +H5_DLLVAR hid_t H5E_LINK_g; /* Links */ +H5_DLLVAR hid_t H5E_DATATYPE_g; /* Datatype */ H5_DLLVAR hid_t H5E_RS_g; /* Reference Counted Strings */ -H5_DLLVAR hid_t H5E_ATOM_g; /* Object atom */ H5_DLLVAR hid_t H5E_HEAP_g; /* Heap */ -H5_DLLVAR hid_t H5E_DATASET_g; /* Dataset */ -H5_DLLVAR hid_t H5E_DATASPACE_g; /* Dataspace */ +H5_DLLVAR hid_t H5E_OHDR_g; /* Object header */ +H5_DLLVAR hid_t H5E_ATOM_g; /* Object atom */ +H5_DLLVAR hid_t H5E_ATTR_g; /* Attribute */ +H5_DLLVAR hid_t H5E_NONE_MAJOR_g; /* No error */ +H5_DLLVAR hid_t H5E_IO_g; /* Low-level I/O */ +H5_DLLVAR hid_t H5E_SLIST_g; /* Skip Lists */ +H5_DLLVAR hid_t H5E_EFL_g; /* External file list */ +H5_DLLVAR hid_t H5E_TST_g; /* Ternary Search Trees */ H5_DLLVAR hid_t H5E_ARGS_g; /* Invalid arguments to routine */ H5_DLLVAR hid_t H5E_ERROR_g; /* Error API */ -H5_DLLVAR hid_t H5E_RESOURCE_g; /* Resource unavailable */ -H5_DLLVAR hid_t H5E_FUNC_g; /* Function entry/exit */ H5_DLLVAR hid_t H5E_PLINE_g; /* Data filters */ H5_DLLVAR hid_t H5E_FSPACE_g; /* Free Space Manager */ -H5_DLLVAR hid_t H5E_ATTR_g; /* Attribute */ -H5_DLLVAR hid_t H5E_PLIST_g; /* Property lists */ H5_DLLVAR hid_t H5E_CACHE_g; /* Object cache */ -H5_DLLVAR hid_t H5E_FILE_g; /* File accessibilty */ -H5_DLLVAR hid_t H5E_REFERENCE_g; /* References */ -H5_DLLVAR hid_t H5E_NONE_MAJOR_g; /* No error */ -H5_DLLVAR hid_t H5E_IO_g; /* Low-level I/O */ -H5_DLLVAR hid_t H5E_EFL_g; /* External file list */ -H5_DLLVAR hid_t H5E_DATATYPE_g; /* Datatype */ -H5_DLLVAR hid_t H5E_VFL_g; /* Virtual File Layer */ -H5_DLLVAR hid_t H5E_BTREE_g; /* B-Tree node */ -H5_DLLVAR hid_t H5E_OHDR_g; /* Object header */ /*********************/ /* Minor error codes */ /*********************/ -/* System level errors */ -#define H5E_SYSERRSTR (H5OPEN H5E_SYSERRSTR_g) -H5_DLLVAR hid_t H5E_SYSERRSTR_g; /* System error message */ +/* Generic low-level file I/O errors */ +#define H5E_SEEKERROR (H5OPEN H5E_SEEKERROR_g) +#define H5E_READERROR (H5OPEN H5E_READERROR_g) +#define H5E_WRITEERROR (H5OPEN H5E_WRITEERROR_g) +#define H5E_CLOSEERROR (H5OPEN H5E_CLOSEERROR_g) +#define H5E_OVERFLOW (H5OPEN H5E_OVERFLOW_g) +#define H5E_FCNTL (H5OPEN H5E_FCNTL_g) +H5_DLLVAR hid_t H5E_SEEKERROR_g; /* Seek failed */ +H5_DLLVAR hid_t H5E_READERROR_g; /* Read failed */ +H5_DLLVAR hid_t H5E_WRITEERROR_g; /* Write failed */ +H5_DLLVAR hid_t H5E_CLOSEERROR_g; /* Close failed */ +H5_DLLVAR hid_t H5E_OVERFLOW_g; /* Address overflowed */ +H5_DLLVAR hid_t H5E_FCNTL_g; /* File control (fcntl) failed */ -/* Group related errors */ -#define H5E_CANTOPENOBJ (H5OPEN H5E_CANTOPENOBJ_g) -#define H5E_CANTCLOSEOBJ (H5OPEN H5E_CANTCLOSEOBJ_g) -#define H5E_COMPLEN (H5OPEN H5E_COMPLEN_g) -#define H5E_PATH (H5OPEN H5E_PATH_g) -H5_DLLVAR hid_t H5E_CANTOPENOBJ_g; /* Can't open object */ -H5_DLLVAR hid_t H5E_CANTCLOSEOBJ_g; /* Can't close object */ -H5_DLLVAR hid_t H5E_COMPLEN_g; /* Name component is too long */ -H5_DLLVAR hid_t H5E_PATH_g; /* Problem with path to object */ +/* Resource errors */ +#define H5E_NOSPACE (H5OPEN H5E_NOSPACE_g) +#define H5E_CANTALLOC (H5OPEN H5E_CANTALLOC_g) +#define H5E_CANTCOPY (H5OPEN H5E_CANTCOPY_g) +#define H5E_CANTFREE (H5OPEN H5E_CANTFREE_g) +#define H5E_ALREADYEXISTS (H5OPEN H5E_ALREADYEXISTS_g) +#define H5E_CANTLOCK (H5OPEN H5E_CANTLOCK_g) +#define H5E_CANTUNLOCK (H5OPEN H5E_CANTUNLOCK_g) +#define H5E_CANTGC (H5OPEN H5E_CANTGC_g) +#define H5E_CANTGETSIZE (H5OPEN H5E_CANTGETSIZE_g) +#define H5E_OBJOPEN (H5OPEN H5E_OBJOPEN_g) +H5_DLLVAR hid_t H5E_NOSPACE_g; /* No space available for allocation */ +H5_DLLVAR hid_t H5E_CANTALLOC_g; /* Can't allocate space */ +H5_DLLVAR hid_t H5E_CANTCOPY_g; /* Unable to copy object */ +H5_DLLVAR hid_t H5E_CANTFREE_g; /* Unable to free object */ +H5_DLLVAR hid_t H5E_ALREADYEXISTS_g; /* Object already exists */ +H5_DLLVAR hid_t H5E_CANTLOCK_g; /* Unable to lock object */ +H5_DLLVAR hid_t H5E_CANTUNLOCK_g; /* Unable to unlock object */ +H5_DLLVAR hid_t H5E_CANTGC_g; /* Unable to garbage collect */ +H5_DLLVAR hid_t H5E_CANTGETSIZE_g; /* Unable to compute size */ +H5_DLLVAR hid_t H5E_OBJOPEN_g; /* Object is already open */ /* Heap errors */ #define H5E_CANTRESTORE (H5OPEN H5E_CANTRESTORE_g) @@ -129,41 +151,15 @@ H5_DLLVAR hid_t H5E_CANTINIT_g; /* Unable to initialize object */ H5_DLLVAR hid_t H5E_ALREADYINIT_g; /* Object already initialized */ H5_DLLVAR hid_t H5E_CANTRELEASE_g; /* Unable to release object */ -/* B-tree related errors */ -#define H5E_NOTFOUND (H5OPEN H5E_NOTFOUND_g) -#define H5E_EXISTS (H5OPEN H5E_EXISTS_g) -#define H5E_CANTENCODE (H5OPEN H5E_CANTENCODE_g) -#define H5E_CANTDECODE (H5OPEN H5E_CANTDECODE_g) -#define H5E_CANTSPLIT (H5OPEN H5E_CANTSPLIT_g) -#define H5E_CANTREDISTRIBUTE (H5OPEN H5E_CANTREDISTRIBUTE_g) -#define H5E_CANTSWAP (H5OPEN H5E_CANTSWAP_g) -#define H5E_CANTINSERT (H5OPEN H5E_CANTINSERT_g) -#define H5E_CANTLIST (H5OPEN H5E_CANTLIST_g) -#define H5E_CANTMODIFY (H5OPEN H5E_CANTMODIFY_g) -#define H5E_CANTREMOVE (H5OPEN H5E_CANTREMOVE_g) -H5_DLLVAR hid_t H5E_NOTFOUND_g; /* Object not found */ -H5_DLLVAR hid_t H5E_EXISTS_g; /* Object already exists */ -H5_DLLVAR hid_t H5E_CANTENCODE_g; /* Unable to encode value */ -H5_DLLVAR hid_t H5E_CANTDECODE_g; /* Unable to decode value */ -H5_DLLVAR hid_t H5E_CANTSPLIT_g; /* Unable to split node */ -H5_DLLVAR hid_t H5E_CANTREDISTRIBUTE_g; /* Unable to redistribute records */ -H5_DLLVAR hid_t H5E_CANTSWAP_g; /* Unable to swap records */ -H5_DLLVAR hid_t H5E_CANTINSERT_g; /* Unable to insert object */ -H5_DLLVAR hid_t H5E_CANTLIST_g; /* Unable to list node */ -H5_DLLVAR hid_t H5E_CANTMODIFY_g; /* Unable to modify record */ -H5_DLLVAR hid_t H5E_CANTREMOVE_g; /* Unable to remove object */ - -/* Argument errors */ -#define H5E_UNINITIALIZED (H5OPEN H5E_UNINITIALIZED_g) -#define H5E_UNSUPPORTED (H5OPEN H5E_UNSUPPORTED_g) -#define H5E_BADTYPE (H5OPEN H5E_BADTYPE_g) -#define H5E_BADRANGE (H5OPEN H5E_BADRANGE_g) -#define H5E_BADVALUE (H5OPEN H5E_BADVALUE_g) -H5_DLLVAR hid_t H5E_UNINITIALIZED_g; /* Information is uinitialized */ -H5_DLLVAR hid_t H5E_UNSUPPORTED_g; /* Feature is unsupported */ -H5_DLLVAR hid_t H5E_BADTYPE_g; /* Inappropriate type */ -H5_DLLVAR hid_t H5E_BADRANGE_g; /* Out of range */ -H5_DLLVAR hid_t H5E_BADVALUE_g; /* Bad value */ +/* Property list errors */ +#define H5E_CANTGET (H5OPEN H5E_CANTGET_g) +#define H5E_CANTSET (H5OPEN H5E_CANTSET_g) +#define H5E_DUPCLASS (H5OPEN H5E_DUPCLASS_g) +#define H5E_SETDISALLOWED (H5OPEN H5E_SETDISALLOWED_g) +H5_DLLVAR hid_t H5E_CANTGET_g; /* Can't get value */ +H5_DLLVAR hid_t H5E_CANTSET_g; /* Can't set value */ +H5_DLLVAR hid_t H5E_DUPCLASS_g; /* Duplicate class name in parent class */ +H5_DLLVAR hid_t H5E_SETDISALLOWED_g; /* Disallowed operation */ /* Free space errors */ #define H5E_CANTMERGE (H5OPEN H5E_CANTMERGE_g) @@ -193,25 +189,75 @@ H5_DLLVAR hid_t H5E_CANTPACK_g; /* Can't pack messages */ H5_DLLVAR hid_t H5E_CANTRESET_g; /* Can't reset object */ H5_DLLVAR hid_t H5E_CANTRENAME_g; /* Unable to rename object */ -/* Datatype conversion errors */ -#define H5E_CANTCONVERT (H5OPEN H5E_CANTCONVERT_g) -#define H5E_BADSIZE (H5OPEN H5E_BADSIZE_g) -H5_DLLVAR hid_t H5E_CANTCONVERT_g; /* Can't convert datatypes */ -H5_DLLVAR hid_t H5E_BADSIZE_g; /* Bad size for object */ +/* System level errors */ +#define H5E_SYSERRSTR (H5OPEN H5E_SYSERRSTR_g) +H5_DLLVAR hid_t H5E_SYSERRSTR_g; /* System error message */ -/* Dataspace errors */ -#define H5E_CANTCLIP (H5OPEN H5E_CANTCLIP_g) -#define H5E_CANTCOUNT (H5OPEN H5E_CANTCOUNT_g) -#define H5E_CANTSELECT (H5OPEN H5E_CANTSELECT_g) -#define H5E_CANTNEXT (H5OPEN H5E_CANTNEXT_g) -#define H5E_BADSELECT (H5OPEN H5E_BADSELECT_g) -#define H5E_CANTCOMPARE (H5OPEN H5E_CANTCOMPARE_g) -H5_DLLVAR hid_t H5E_CANTCLIP_g; /* Can't clip hyperslab region */ -H5_DLLVAR hid_t H5E_CANTCOUNT_g; /* Can't count elements */ -H5_DLLVAR hid_t H5E_CANTSELECT_g; /* Can't select hyperslab */ -H5_DLLVAR hid_t H5E_CANTNEXT_g; /* Can't move to next iterator location */ -H5_DLLVAR hid_t H5E_BADSELECT_g; /* Invalid selection */ -H5_DLLVAR hid_t H5E_CANTCOMPARE_g; /* Can't compare objects */ +/* I/O pipeline errors */ +#define H5E_NOFILTER (H5OPEN H5E_NOFILTER_g) +#define H5E_CALLBACK (H5OPEN H5E_CALLBACK_g) +#define H5E_CANAPPLY (H5OPEN H5E_CANAPPLY_g) +#define H5E_SETLOCAL (H5OPEN H5E_SETLOCAL_g) +#define H5E_NOENCODER (H5OPEN H5E_NOENCODER_g) +#define H5E_CANTFILTER (H5OPEN H5E_CANTFILTER_g) +H5_DLLVAR hid_t H5E_NOFILTER_g; /* Requested filter is not available */ +H5_DLLVAR hid_t H5E_CALLBACK_g; /* Callback failed */ +H5_DLLVAR hid_t H5E_CANAPPLY_g; /* Error from filter 'can apply' callback */ +H5_DLLVAR hid_t H5E_SETLOCAL_g; /* Error from filter 'set local' callback */ +H5_DLLVAR hid_t H5E_NOENCODER_g; /* Filter present but encoding disabled */ +H5_DLLVAR hid_t H5E_CANTFILTER_g; /* Filter operation failed */ + +/* Group related errors */ +#define H5E_CANTOPENOBJ (H5OPEN H5E_CANTOPENOBJ_g) +#define H5E_CANTCLOSEOBJ (H5OPEN H5E_CANTCLOSEOBJ_g) +#define H5E_COMPLEN (H5OPEN H5E_COMPLEN_g) +#define H5E_PATH (H5OPEN H5E_PATH_g) +H5_DLLVAR hid_t H5E_CANTOPENOBJ_g; /* Can't open object */ +H5_DLLVAR hid_t H5E_CANTCLOSEOBJ_g; /* Can't close object */ +H5_DLLVAR hid_t H5E_COMPLEN_g; /* Name component is too long */ +H5_DLLVAR hid_t H5E_PATH_g; /* Problem with path to object */ + +/* No error */ +#define H5E_NONE_MINOR (H5OPEN H5E_NONE_MINOR_g) +H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error */ + +/* Plugin errors */ +#define H5E_OPENERROR (H5OPEN H5E_OPENERROR_g) +H5_DLLVAR hid_t H5E_OPENERROR_g; /* Can't open directory or file */ + +/* File accessibilty errors */ +#define H5E_FILEEXISTS (H5OPEN H5E_FILEEXISTS_g) +#define H5E_FILEOPEN (H5OPEN H5E_FILEOPEN_g) +#define H5E_CANTCREATE (H5OPEN H5E_CANTCREATE_g) +#define H5E_CANTOPENFILE (H5OPEN H5E_CANTOPENFILE_g) +#define H5E_CANTCLOSEFILE (H5OPEN H5E_CANTCLOSEFILE_g) +#define H5E_NOTHDF5 (H5OPEN H5E_NOTHDF5_g) +#define H5E_BADFILE (H5OPEN H5E_BADFILE_g) +#define H5E_TRUNCATED (H5OPEN H5E_TRUNCATED_g) +#define H5E_MOUNT (H5OPEN H5E_MOUNT_g) +H5_DLLVAR hid_t H5E_FILEEXISTS_g; /* File already exists */ +H5_DLLVAR hid_t H5E_FILEOPEN_g; /* File already open */ +H5_DLLVAR hid_t H5E_CANTCREATE_g; /* Unable to create file */ +H5_DLLVAR hid_t H5E_CANTOPENFILE_g; /* Unable to open file */ +H5_DLLVAR hid_t H5E_CANTCLOSEFILE_g; /* Unable to close file */ +H5_DLLVAR hid_t H5E_NOTHDF5_g; /* Not an HDF5 file */ +H5_DLLVAR hid_t H5E_BADFILE_g; /* Bad file ID accessed */ +H5_DLLVAR hid_t H5E_TRUNCATED_g; /* File has been truncated */ +H5_DLLVAR hid_t H5E_MOUNT_g; /* File mount error */ + +/* Object atom related errors */ +#define H5E_BADATOM (H5OPEN H5E_BADATOM_g) +#define H5E_BADGROUP (H5OPEN H5E_BADGROUP_g) +#define H5E_CANTREGISTER (H5OPEN H5E_CANTREGISTER_g) +#define H5E_CANTINC (H5OPEN H5E_CANTINC_g) +#define H5E_CANTDEC (H5OPEN H5E_CANTDEC_g) +#define H5E_NOIDS (H5OPEN H5E_NOIDS_g) +H5_DLLVAR hid_t H5E_BADATOM_g; /* Unable to find atom information (already closed?) */ +H5_DLLVAR hid_t H5E_BADGROUP_g; /* Unable to find ID group information */ +H5_DLLVAR hid_t H5E_CANTREGISTER_g; /* Unable to register new atom */ +H5_DLLVAR hid_t H5E_CANTINC_g; /* Unable to increment reference count */ +H5_DLLVAR hid_t H5E_CANTDEC_g; /* Unable to decrement reference count */ +H5_DLLVAR hid_t H5E_NOIDS_g; /* Out of IDs for group */ /* Cache related errors */ #define H5E_CANTFLUSH (H5OPEN H5E_CANTFLUSH_g) @@ -245,10 +291,6 @@ H5_DLLVAR hid_t H5E_CANTDIRTY_g; /* Unable to mark metadata as dirty */ H5_DLLVAR hid_t H5E_CANTEXPUNGE_g; /* Unable to expunge a metadata cache entry */ H5_DLLVAR hid_t H5E_CANTRESIZE_g; /* Unable to resize a metadata cache entry */ -/* Plugin errors */ -#define H5E_OPENERROR (H5OPEN H5E_OPENERROR_g) -H5_DLLVAR hid_t H5E_OPENERROR_g; /* Can't open directory or file */ - /* Link related errors */ #define H5E_TRAVERSE (H5OPEN H5E_TRAVERSE_g) #define H5E_NLINKS (H5OPEN H5E_NLINKS_g) @@ -261,34 +303,6 @@ H5_DLLVAR hid_t H5E_NOTREGISTERED_g; /* Link class not registered */ H5_DLLVAR hid_t H5E_CANTMOVE_g; /* Can't move object */ H5_DLLVAR hid_t H5E_CANTSORT_g; /* Can't sort objects */ -/* Object atom related errors */ -#define H5E_BADATOM (H5OPEN H5E_BADATOM_g) -#define H5E_BADGROUP (H5OPEN H5E_BADGROUP_g) -#define H5E_CANTREGISTER (H5OPEN H5E_CANTREGISTER_g) -#define H5E_CANTINC (H5OPEN H5E_CANTINC_g) -#define H5E_CANTDEC (H5OPEN H5E_CANTDEC_g) -#define H5E_NOIDS (H5OPEN H5E_NOIDS_g) -H5_DLLVAR hid_t H5E_BADATOM_g; /* Unable to find atom information (already closed?) */ -H5_DLLVAR hid_t H5E_BADGROUP_g; /* Unable to find ID group information */ -H5_DLLVAR hid_t H5E_CANTREGISTER_g; /* Unable to register new atom */ -H5_DLLVAR hid_t H5E_CANTINC_g; /* Unable to increment reference count */ -H5_DLLVAR hid_t H5E_CANTDEC_g; /* Unable to decrement reference count */ -H5_DLLVAR hid_t H5E_NOIDS_g; /* Out of IDs for group */ - -/* Generic low-level file I/O errors */ -#define H5E_SEEKERROR (H5OPEN H5E_SEEKERROR_g) -#define H5E_READERROR (H5OPEN H5E_READERROR_g) -#define H5E_WRITEERROR (H5OPEN H5E_WRITEERROR_g) -#define H5E_CLOSEERROR (H5OPEN H5E_CLOSEERROR_g) -#define H5E_OVERFLOW (H5OPEN H5E_OVERFLOW_g) -#define H5E_FCNTL (H5OPEN H5E_FCNTL_g) -H5_DLLVAR hid_t H5E_SEEKERROR_g; /* Seek failed */ -H5_DLLVAR hid_t H5E_READERROR_g; /* Read failed */ -H5_DLLVAR hid_t H5E_WRITEERROR_g; /* Write failed */ -H5_DLLVAR hid_t H5E_CLOSEERROR_g; /* Close failed */ -H5_DLLVAR hid_t H5E_OVERFLOW_g; /* Address overflowed */ -H5_DLLVAR hid_t H5E_FCNTL_g; /* File control (fcntl) failed */ - /* Parallel MPI errors */ #define H5E_MPI (H5OPEN H5E_MPI_g) #define H5E_MPIERRSTR (H5OPEN H5E_MPIERRSTR_g) @@ -297,75 +311,61 @@ H5_DLLVAR hid_t H5E_MPI_g; /* Some MPI function failed */ H5_DLLVAR hid_t H5E_MPIERRSTR_g; /* MPI Error String */ H5_DLLVAR hid_t H5E_CANTRECV_g; /* Can't receive data */ -/* File accessibilty errors */ -#define H5E_FILEEXISTS (H5OPEN H5E_FILEEXISTS_g) -#define H5E_FILEOPEN (H5OPEN H5E_FILEOPEN_g) -#define H5E_CANTCREATE (H5OPEN H5E_CANTCREATE_g) -#define H5E_CANTOPENFILE (H5OPEN H5E_CANTOPENFILE_g) -#define H5E_CANTCLOSEFILE (H5OPEN H5E_CANTCLOSEFILE_g) -#define H5E_NOTHDF5 (H5OPEN H5E_NOTHDF5_g) -#define H5E_BADFILE (H5OPEN H5E_BADFILE_g) -#define H5E_TRUNCATED (H5OPEN H5E_TRUNCATED_g) -#define H5E_MOUNT (H5OPEN H5E_MOUNT_g) -H5_DLLVAR hid_t H5E_FILEEXISTS_g; /* File already exists */ -H5_DLLVAR hid_t H5E_FILEOPEN_g; /* File already open */ -H5_DLLVAR hid_t H5E_CANTCREATE_g; /* Unable to create file */ -H5_DLLVAR hid_t H5E_CANTOPENFILE_g; /* Unable to open file */ -H5_DLLVAR hid_t H5E_CANTCLOSEFILE_g; /* Unable to close file */ -H5_DLLVAR hid_t H5E_NOTHDF5_g; /* Not an HDF5 file */ -H5_DLLVAR hid_t H5E_BADFILE_g; /* Bad file ID accessed */ -H5_DLLVAR hid_t H5E_TRUNCATED_g; /* File has been truncated */ -H5_DLLVAR hid_t H5E_MOUNT_g; /* File mount error */ - -/* Resource errors */ -#define H5E_NOSPACE (H5OPEN H5E_NOSPACE_g) -#define H5E_CANTALLOC (H5OPEN H5E_CANTALLOC_g) -#define H5E_CANTCOPY (H5OPEN H5E_CANTCOPY_g) -#define H5E_CANTFREE (H5OPEN H5E_CANTFREE_g) -#define H5E_ALREADYEXISTS (H5OPEN H5E_ALREADYEXISTS_g) -#define H5E_CANTLOCK (H5OPEN H5E_CANTLOCK_g) -#define H5E_CANTUNLOCK (H5OPEN H5E_CANTUNLOCK_g) -#define H5E_CANTGC (H5OPEN H5E_CANTGC_g) -#define H5E_CANTGETSIZE (H5OPEN H5E_CANTGETSIZE_g) -#define H5E_OBJOPEN (H5OPEN H5E_OBJOPEN_g) -H5_DLLVAR hid_t H5E_NOSPACE_g; /* No space available for allocation */ -H5_DLLVAR hid_t H5E_CANTALLOC_g; /* Can't allocate space */ -H5_DLLVAR hid_t H5E_CANTCOPY_g; /* Unable to copy object */ -H5_DLLVAR hid_t H5E_CANTFREE_g; /* Unable to free object */ -H5_DLLVAR hid_t H5E_ALREADYEXISTS_g; /* Object already exists */ -H5_DLLVAR hid_t H5E_CANTLOCK_g; /* Unable to lock object */ -H5_DLLVAR hid_t H5E_CANTUNLOCK_g; /* Unable to unlock object */ -H5_DLLVAR hid_t H5E_CANTGC_g; /* Unable to garbage collect */ -H5_DLLVAR hid_t H5E_CANTGETSIZE_g; /* Unable to compute size */ -H5_DLLVAR hid_t H5E_OBJOPEN_g; /* Object is already open */ +/* Dataspace errors */ +#define H5E_CANTCLIP (H5OPEN H5E_CANTCLIP_g) +#define H5E_CANTCOUNT (H5OPEN H5E_CANTCOUNT_g) +#define H5E_CANTSELECT (H5OPEN H5E_CANTSELECT_g) +#define H5E_CANTNEXT (H5OPEN H5E_CANTNEXT_g) +#define H5E_BADSELECT (H5OPEN H5E_BADSELECT_g) +#define H5E_CANTCOMPARE (H5OPEN H5E_CANTCOMPARE_g) +H5_DLLVAR hid_t H5E_CANTCLIP_g; /* Can't clip hyperslab region */ +H5_DLLVAR hid_t H5E_CANTCOUNT_g; /* Can't count elements */ +H5_DLLVAR hid_t H5E_CANTSELECT_g; /* Can't select hyperslab */ +H5_DLLVAR hid_t H5E_CANTNEXT_g; /* Can't move to next iterator location */ +H5_DLLVAR hid_t H5E_BADSELECT_g; /* Invalid selection */ +H5_DLLVAR hid_t H5E_CANTCOMPARE_g; /* Can't compare objects */ -/* I/O pipeline errors */ -#define H5E_NOFILTER (H5OPEN H5E_NOFILTER_g) -#define H5E_CALLBACK (H5OPEN H5E_CALLBACK_g) -#define H5E_CANAPPLY (H5OPEN H5E_CANAPPLY_g) -#define H5E_SETLOCAL (H5OPEN H5E_SETLOCAL_g) -#define H5E_NOENCODER (H5OPEN H5E_NOENCODER_g) -#define H5E_CANTFILTER (H5OPEN H5E_CANTFILTER_g) -H5_DLLVAR hid_t H5E_NOFILTER_g; /* Requested filter is not available */ -H5_DLLVAR hid_t H5E_CALLBACK_g; /* Callback failed */ -H5_DLLVAR hid_t H5E_CANAPPLY_g; /* Error from filter 'can apply' callback */ -H5_DLLVAR hid_t H5E_SETLOCAL_g; /* Error from filter 'set local' callback */ -H5_DLLVAR hid_t H5E_NOENCODER_g; /* Filter present but encoding disabled */ -H5_DLLVAR hid_t H5E_CANTFILTER_g; /* Filter operation failed */ +/* Argument errors */ +#define H5E_UNINITIALIZED (H5OPEN H5E_UNINITIALIZED_g) +#define H5E_UNSUPPORTED (H5OPEN H5E_UNSUPPORTED_g) +#define H5E_BADTYPE (H5OPEN H5E_BADTYPE_g) +#define H5E_BADRANGE (H5OPEN H5E_BADRANGE_g) +#define H5E_BADVALUE (H5OPEN H5E_BADVALUE_g) +H5_DLLVAR hid_t H5E_UNINITIALIZED_g; /* Information is uinitialized */ +H5_DLLVAR hid_t H5E_UNSUPPORTED_g; /* Feature is unsupported */ +H5_DLLVAR hid_t H5E_BADTYPE_g; /* Inappropriate type */ +H5_DLLVAR hid_t H5E_BADRANGE_g; /* Out of range */ +H5_DLLVAR hid_t H5E_BADVALUE_g; /* Bad value */ -/* No error */ -#define H5E_NONE_MINOR (H5OPEN H5E_NONE_MINOR_g) -H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error */ +/* B-tree related errors */ +#define H5E_NOTFOUND (H5OPEN H5E_NOTFOUND_g) +#define H5E_EXISTS (H5OPEN H5E_EXISTS_g) +#define H5E_CANTENCODE (H5OPEN H5E_CANTENCODE_g) +#define H5E_CANTDECODE (H5OPEN H5E_CANTDECODE_g) +#define H5E_CANTSPLIT (H5OPEN H5E_CANTSPLIT_g) +#define H5E_CANTREDISTRIBUTE (H5OPEN H5E_CANTREDISTRIBUTE_g) +#define H5E_CANTSWAP (H5OPEN H5E_CANTSWAP_g) +#define H5E_CANTINSERT (H5OPEN H5E_CANTINSERT_g) +#define H5E_CANTLIST (H5OPEN H5E_CANTLIST_g) +#define H5E_CANTMODIFY (H5OPEN H5E_CANTMODIFY_g) +#define H5E_CANTREMOVE (H5OPEN H5E_CANTREMOVE_g) +H5_DLLVAR hid_t H5E_NOTFOUND_g; /* Object not found */ +H5_DLLVAR hid_t H5E_EXISTS_g; /* Object already exists */ +H5_DLLVAR hid_t H5E_CANTENCODE_g; /* Unable to encode value */ +H5_DLLVAR hid_t H5E_CANTDECODE_g; /* Unable to decode value */ +H5_DLLVAR hid_t H5E_CANTSPLIT_g; /* Unable to split node */ +H5_DLLVAR hid_t H5E_CANTREDISTRIBUTE_g; /* Unable to redistribute records */ +H5_DLLVAR hid_t H5E_CANTSWAP_g; /* Unable to swap records */ +H5_DLLVAR hid_t H5E_CANTINSERT_g; /* Unable to insert object */ +H5_DLLVAR hid_t H5E_CANTLIST_g; /* Unable to list node */ +H5_DLLVAR hid_t H5E_CANTMODIFY_g; /* Unable to modify record */ +H5_DLLVAR hid_t H5E_CANTREMOVE_g; /* Unable to remove object */ -/* Property list errors */ -#define H5E_CANTGET (H5OPEN H5E_CANTGET_g) -#define H5E_CANTSET (H5OPEN H5E_CANTSET_g) -#define H5E_DUPCLASS (H5OPEN H5E_DUPCLASS_g) -#define H5E_SETDISALLOWED (H5OPEN H5E_SETDISALLOWED_g) -H5_DLLVAR hid_t H5E_CANTGET_g; /* Can't get value */ -H5_DLLVAR hid_t H5E_CANTSET_g; /* Can't set value */ -H5_DLLVAR hid_t H5E_DUPCLASS_g; /* Duplicate class name in parent class */ -H5_DLLVAR hid_t H5E_SETDISALLOWED_g; /* Disallowed operation */ +/* Datatype conversion errors */ +#define H5E_CANTCONVERT (H5OPEN H5E_CANTCONVERT_g) +#define H5E_BADSIZE (H5OPEN H5E_BADSIZE_g) +H5_DLLVAR hid_t H5E_CANTCONVERT_g; /* Can't convert datatypes */ +H5_DLLVAR hid_t H5E_BADSIZE_g; /* Bad size for object */ #ifdef __cplusplus } diff --git a/src/H5Eterm.h b/src/H5Eterm.h index 8a3a9a5..2a8e11e 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -20,49 +20,60 @@ /* Reset major error IDs */ -H5E_LINK_g= -H5E_INTERNAL_g= -H5E_PLUGIN_g= -H5E_SLIST_g= -H5E_SYM_g= -H5E_TST_g= -H5E_SOHM_g= -H5E_STORAGE_g= -H5E_RS_g= -H5E_ATOM_g= -H5E_HEAP_g= H5E_DATASET_g= -H5E_DATASPACE_g= -H5E_ARGS_g= -H5E_ERROR_g= -H5E_RESOURCE_g= H5E_FUNC_g= -H5E_PLINE_g= -H5E_FSPACE_g= -H5E_ATTR_g= -H5E_PLIST_g= -H5E_CACHE_g= +H5E_STORAGE_g= H5E_FILE_g= +H5E_SOHM_g= +H5E_SYM_g= +H5E_PLUGIN_g= +H5E_VFL_g= +H5E_INTERNAL_g= +H5E_BTREE_g= H5E_REFERENCE_g= +H5E_DATASPACE_g= +H5E_RESOURCE_g= +H5E_PLIST_g= +H5E_LINK_g= +H5E_DATATYPE_g= +H5E_RS_g= +H5E_HEAP_g= +H5E_OHDR_g= +H5E_ATOM_g= +H5E_ATTR_g= H5E_NONE_MAJOR_g= H5E_IO_g= +H5E_SLIST_g= H5E_EFL_g= -H5E_DATATYPE_g= -H5E_VFL_g= -H5E_BTREE_g= -H5E_OHDR_g= (-1); +H5E_TST_g= +H5E_ARGS_g= +H5E_ERROR_g= +H5E_PLINE_g= +H5E_FSPACE_g= +H5E_CACHE_g= (-1); /* Reset minor error IDs */ -/* System level errors */ -H5E_SYSERRSTR_g= +/* Generic low-level file I/O errors */ +H5E_SEEKERROR_g= +H5E_READERROR_g= +H5E_WRITEERROR_g= +H5E_CLOSEERROR_g= +H5E_OVERFLOW_g= +H5E_FCNTL_g= -/* Group related errors */ -H5E_CANTOPENOBJ_g= -H5E_CANTCLOSEOBJ_g= -H5E_COMPLEN_g= -H5E_PATH_g= +/* Resource errors */ +H5E_NOSPACE_g= +H5E_CANTALLOC_g= +H5E_CANTCOPY_g= +H5E_CANTFREE_g= +H5E_ALREADYEXISTS_g= +H5E_CANTLOCK_g= +H5E_CANTUNLOCK_g= +H5E_CANTGC_g= +H5E_CANTGETSIZE_g= +H5E_OBJOPEN_g= /* Heap errors */ H5E_CANTRESTORE_g= @@ -77,25 +88,11 @@ H5E_CANTINIT_g= H5E_ALREADYINIT_g= H5E_CANTRELEASE_g= -/* B-tree related errors */ -H5E_NOTFOUND_g= -H5E_EXISTS_g= -H5E_CANTENCODE_g= -H5E_CANTDECODE_g= -H5E_CANTSPLIT_g= -H5E_CANTREDISTRIBUTE_g= -H5E_CANTSWAP_g= -H5E_CANTINSERT_g= -H5E_CANTLIST_g= -H5E_CANTMODIFY_g= -H5E_CANTREMOVE_g= - -/* Argument errors */ -H5E_UNINITIALIZED_g= -H5E_UNSUPPORTED_g= -H5E_BADTYPE_g= -H5E_BADRANGE_g= -H5E_BADVALUE_g= +/* Property list errors */ +H5E_CANTGET_g= +H5E_CANTSET_g= +H5E_DUPCLASS_g= +H5E_SETDISALLOWED_g= /* Free space errors */ H5E_CANTMERGE_g= @@ -113,17 +110,47 @@ H5E_CANTPACK_g= H5E_CANTRESET_g= H5E_CANTRENAME_g= -/* Datatype conversion errors */ -H5E_CANTCONVERT_g= -H5E_BADSIZE_g= +/* System level errors */ +H5E_SYSERRSTR_g= -/* Dataspace errors */ -H5E_CANTCLIP_g= -H5E_CANTCOUNT_g= -H5E_CANTSELECT_g= -H5E_CANTNEXT_g= -H5E_BADSELECT_g= -H5E_CANTCOMPARE_g= +/* I/O pipeline errors */ +H5E_NOFILTER_g= +H5E_CALLBACK_g= +H5E_CANAPPLY_g= +H5E_SETLOCAL_g= +H5E_NOENCODER_g= +H5E_CANTFILTER_g= + +/* Group related errors */ +H5E_CANTOPENOBJ_g= +H5E_CANTCLOSEOBJ_g= +H5E_COMPLEN_g= +H5E_PATH_g= + +/* No error */ +H5E_NONE_MINOR_g= + +/* Plugin errors */ +H5E_OPENERROR_g= + +/* File accessibilty errors */ +H5E_FILEEXISTS_g= +H5E_FILEOPEN_g= +H5E_CANTCREATE_g= +H5E_CANTOPENFILE_g= +H5E_CANTCLOSEFILE_g= +H5E_NOTHDF5_g= +H5E_BADFILE_g= +H5E_TRUNCATED_g= +H5E_MOUNT_g= + +/* Object atom related errors */ +H5E_BADATOM_g= +H5E_BADGROUP_g= +H5E_CANTREGISTER_g= +H5E_CANTINC_g= +H5E_CANTDEC_g= +H5E_NOIDS_g= /* Cache related errors */ H5E_CANTFLUSH_g= @@ -142,9 +169,6 @@ H5E_CANTDIRTY_g= H5E_CANTEXPUNGE_g= H5E_CANTRESIZE_g= -/* Plugin errors */ -H5E_OPENERROR_g= - /* Link related errors */ H5E_TRAVERSE_g= H5E_NLINKS_g= @@ -152,65 +176,41 @@ H5E_NOTREGISTERED_g= H5E_CANTMOVE_g= H5E_CANTSORT_g= -/* Object atom related errors */ -H5E_BADATOM_g= -H5E_BADGROUP_g= -H5E_CANTREGISTER_g= -H5E_CANTINC_g= -H5E_CANTDEC_g= -H5E_NOIDS_g= - -/* Generic low-level file I/O errors */ -H5E_SEEKERROR_g= -H5E_READERROR_g= -H5E_WRITEERROR_g= -H5E_CLOSEERROR_g= -H5E_OVERFLOW_g= -H5E_FCNTL_g= - /* Parallel MPI errors */ H5E_MPI_g= H5E_MPIERRSTR_g= H5E_CANTRECV_g= -/* File accessibilty errors */ -H5E_FILEEXISTS_g= -H5E_FILEOPEN_g= -H5E_CANTCREATE_g= -H5E_CANTOPENFILE_g= -H5E_CANTCLOSEFILE_g= -H5E_NOTHDF5_g= -H5E_BADFILE_g= -H5E_TRUNCATED_g= -H5E_MOUNT_g= - -/* Resource errors */ -H5E_NOSPACE_g= -H5E_CANTALLOC_g= -H5E_CANTCOPY_g= -H5E_CANTFREE_g= -H5E_ALREADYEXISTS_g= -H5E_CANTLOCK_g= -H5E_CANTUNLOCK_g= -H5E_CANTGC_g= -H5E_CANTGETSIZE_g= -H5E_OBJOPEN_g= +/* Dataspace errors */ +H5E_CANTCLIP_g= +H5E_CANTCOUNT_g= +H5E_CANTSELECT_g= +H5E_CANTNEXT_g= +H5E_BADSELECT_g= +H5E_CANTCOMPARE_g= -/* I/O pipeline errors */ -H5E_NOFILTER_g= -H5E_CALLBACK_g= -H5E_CANAPPLY_g= -H5E_SETLOCAL_g= -H5E_NOENCODER_g= -H5E_CANTFILTER_g= +/* Argument errors */ +H5E_UNINITIALIZED_g= +H5E_UNSUPPORTED_g= +H5E_BADTYPE_g= +H5E_BADRANGE_g= +H5E_BADVALUE_g= -/* No error */ -H5E_NONE_MINOR_g= +/* B-tree related errors */ +H5E_NOTFOUND_g= +H5E_EXISTS_g= +H5E_CANTENCODE_g= +H5E_CANTDECODE_g= +H5E_CANTSPLIT_g= +H5E_CANTREDISTRIBUTE_g= +H5E_CANTSWAP_g= +H5E_CANTINSERT_g= +H5E_CANTLIST_g= +H5E_CANTMODIFY_g= +H5E_CANTREMOVE_g= -/* Property list errors */ -H5E_CANTGET_g= -H5E_CANTSET_g= -H5E_DUPCLASS_g= -H5E_SETDISALLOWED_g= (-1); +/* Datatype conversion errors */ +H5E_CANTCONVERT_g= +H5E_BADSIZE_g= (-1); #endif /* H5Eterm_H */ diff --git a/src/H5config.h.in b/src/H5config.h.in index 22a2289..f57b5e1 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -13,9 +13,12 @@ /* Define the default plugins path to compile */ #undef DEFAULT_PLUGINDIR -/* Define if `dev_t' is a scalar */ +/* Define if dev_t is a scalar */ #undef DEV_T_IS_SCALAR +/* Define the examples directory */ +#undef EXAMPLESDIR + /* Define to dummy `main' function (if any) required to link to the Fortran libraries. */ #undef FC_DUMMY_MAIN @@ -188,10 +191,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MPE_H -/* Define if `MPI_Comm_c2f' and `MPI_Comm_f2c' exists */ +/* Define if MPI_Comm_c2f and MPI_Comm_f2c exist */ #undef 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 */ #undef HAVE_MPI_MULTI_LANG_Info /* Define to 1 if you have the header file. */ @@ -246,7 +249,7 @@ /* Define to 1 if you have the `srandom' function. */ #undef HAVE_SRANDOM -/* Define if `struct stat' has the `st_blocks' field */ +/* Define if struct stat has the st_blocks field */ #undef HAVE_STAT_ST_BLOCKS /* Define to 1 if you have the header file. */ @@ -273,10 +276,10 @@ /* Define to 1 if you have the `strtoull' function. */ #undef HAVE_STRTOULL -/* Define if `struct text_info' is defined */ +/* Define if struct text_info is defined */ #undef HAVE_STRUCT_TEXT_INFO -/* Define if `struct videoconfig' is defined */ +/* Define if struct videoconfig is defined */ #undef HAVE_STRUCT_VIDEOCONFIG /* Define to 1 if you have the `symlink' function. */ @@ -312,7 +315,7 @@ /* Define if we have thread safe support */ #undef HAVE_THREADSAFE -/* Define if `timezone' is a global variable */ +/* Define if timezone is a global variable */ #undef HAVE_TIMEZONE /* Define if the ioctl TIOCGETD is defined */ @@ -324,7 +327,7 @@ /* Define to 1 if you have the `tmpfile' function. */ #undef HAVE_TMPFILE -/* Define if `tm_gmtoff' is a member of `struct tm' */ +/* Define if tm_gmtoff is a member of struct tm */ #undef HAVE_TM_GMTOFF /* Define to 1 if you have the header file. */ diff --git a/src/Makefile.in b/src/Makefile.in index 7b15785..ad20965 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -515,7 +515,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -577,6 +577,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -696,6 +697,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/test/Makefile.in b/test/Makefile.in index 9948f78..0314689 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -807,7 +807,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_builddir)/src AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @@ -870,6 +870,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -989,6 +990,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/testpar/Makefile.in b/testpar/Makefile.in index e9546fe..f712bc4 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -438,7 +438,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/test AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @@ -501,6 +501,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -620,6 +621,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/Makefile.in b/tools/Makefile.in index 4722302..5bd2229 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -408,7 +408,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -470,6 +470,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -589,6 +590,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index 8682850..7b25554 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -404,7 +404,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -469,6 +469,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -588,6 +589,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 8886dc5..b82b3aa 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -433,7 +433,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -498,6 +498,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -617,6 +618,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 702dc2d..7142edd 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -436,7 +436,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include files in /src directory and /tools/lib directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -501,6 +501,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -620,6 +621,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 6fc85ae..651d37a 100644 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -405,7 +405,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -470,6 +470,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -589,6 +590,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 06d2f7c..5135855 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -423,7 +423,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -488,6 +488,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -607,6 +608,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 2ab6804..798062b 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -418,7 +418,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -483,6 +483,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -602,6 +603,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 812afbd..f3ccf63 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -477,7 +477,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src, test, and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -543,6 +543,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -662,6 +663,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 60bb4bc..5af6efe 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -406,7 +406,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -471,6 +471,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -590,6 +591,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 1d5863c..87f0fc5 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -402,7 +402,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include files in /src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src @@ -466,6 +466,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -585,6 +586,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/libtest/Makefile.in b/tools/libtest/Makefile.in index 2f934bf..6b3f601 100644 --- a/tools/libtest/Makefile.in +++ b/tools/libtest/Makefile.in @@ -401,7 +401,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -466,6 +466,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -585,6 +586,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index ead8476..b6bc699 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -423,7 +423,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -488,6 +488,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -607,6 +608,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/tools/perform/Makefile.in b/tools/perform/Makefile.in index 19fad43..6d87698 100644 --- a/tools/perform/Makefile.in +++ b/tools/perform/Makefile.in @@ -444,7 +444,7 @@ AMTAR = @AMTAR@ # 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. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @@ -507,6 +507,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -626,6 +627,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ -- cgit v0.12 From 3f30fad64c9544e805caa3d886d80a7ee87fcd4b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 31 Mar 2020 13:25:39 -0500 Subject: Restore page ejects. --- src/H5Dio.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/H5Dio.c b/src/H5Dio.c index b359117..7807000 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -90,7 +90,7 @@ static herr_t H5D__typeinfo_term(const H5D_type_info_t *type_info); H5FL_BLK_DEFINE(type_conv); - + /*------------------------------------------------------------------------- * Function: H5Dread * @@ -228,7 +228,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Dread() */ - + /*------------------------------------------------------------------------- * Function: H5Dwrite * @@ -326,7 +326,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Dwrite() */ - + /*------------------------------------------------------------------------- * Function: H5D__pre_write * @@ -408,7 +408,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__pre_write() */ - + /*------------------------------------------------------------------------- * Function: H5D__read * @@ -629,7 +629,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__read() */ - + /*------------------------------------------------------------------------- * Function: H5D__write * @@ -887,7 +887,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__write() */ - + /*------------------------------------------------------------------------- * Function: H5D__ioinfo_init * @@ -956,7 +956,7 @@ const FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__ioinfo_init() */ - + /*------------------------------------------------------------------------- * Function: H5D__typeinfo_init * @@ -1113,7 +1113,7 @@ done: } /* end H5D__typeinfo_init() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- * Function: H5D__ioinfo_adjust * @@ -1205,7 +1205,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__ioinfo_adjust() */ - + /*------------------------------------------------------------------------- * Function: H5D__ioinfo_term * @@ -1261,7 +1261,7 @@ done: #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- * Function: H5D__typeinfo_term * -- cgit v0.12 From c198e16895da5eaf1d1defd7aefbf99dffb68900 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 31 Mar 2020 15:09:16 -0500 Subject: Restore page eject chars --- src/H5FDhdfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index b1bd4a7..e833057 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -549,7 +549,7 @@ H5FD_hdfs_init_interface(void) FUNC_LEAVE_NOAPI(H5FD_hdfs_init()) } /* H5FD_hdfs_init_interface() */ - + /*------------------------------------------------------------------------- * Function: H5FD_hdfs_init * @@ -767,7 +767,7 @@ done: } /* H5FD_hdfs_open() */ #endif /* H5_HAVE_LIBHDFS */ - + /*------------------------------------------------------------------------- * Function: H5FD_hdfs_close * @@ -945,7 +945,7 @@ H5FD_hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) /* out FUNC_LEAVE_NOAPI(SUCCEED) } /* H5FD_hdfs_query() */ - + /*------------------------------------------------------------------------- * Function: H5FD_hdfs_get_eoa() * @@ -1282,7 +1282,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FD_hdfs_write() */ - + /*------------------------------------------------------------------------- * Function: H5FD_hdfs_truncate * -- cgit v0.12 From e629c5c6168ff4959baf0fd8b730aa0d8d9c97b5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 31 Mar 2020 22:32:20 -0500 Subject: Fix orphaned token --- config/gnu-flags | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/config/gnu-flags b/config/gnu-flags index 9f9deb1..2b11d8f 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -28,11 +28,11 @@ PROMOTE_ERRORS_DFLT=no # demote_errors() { - if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then - sed 's,-Werror=,-W,g' - else - cat - fi + if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then + sed 's,-Werror=,-W,g' + else + cat + fi } # @@ -367,7 +367,7 @@ case "$cc_vendor-$cc_version" in # GCC 4.2 through 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 $(load_gcc_arguments 4.2-4.3)" - fi + fi # GCC 4.5 through 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 @@ -391,7 +391,7 @@ case "$cc_vendor-$cc_version" in # 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 $(load_gcc_arguments 4.3)" - fi + fi # gcc >= 4.4 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then @@ -401,29 +401,29 @@ case "$cc_vendor-$cc_version" in # 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 $(load_gcc_arguments 4.5)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.5)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.5)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.5)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.5)" 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 $(load_gcc_arguments 4.6)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.6)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.6)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.6)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.6)" 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 $(load_gcc_arguments 4.7)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.7)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.7)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.7)" fi # gcc >= 4.8 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.8)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.8)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.8)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.8)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.8)" fi # gcc >= 4.9 @@ -445,15 +445,15 @@ case "$cc_vendor-$cc_version" in # gcc >= 7 if test $cc_vers_major -ge 7; then H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 7)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-7)" fi # gcc 8 if test $cc_vers_major -ge 8; then H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 8)" H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-8)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-8)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-8)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-8)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-8)" fi # gcc 9 @@ -467,7 +467,6 @@ esac # Flags are set # ################# cc_flags_set=yes -fi # Clear cc info if no flags set if test "X$cc_flags_set" = "X"; then -- cgit v0.12 From 43ad413390820e78c0240cd5c1a61fae11336618 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Apr 2020 08:50:15 -0500 Subject: Update LT files --- hl/src/H5LTanalyze.c | 154 +++++++++++++++++++++++-------------------- hl/src/H5LTanalyze.l | 11 ++++ hl/src/H5LTparse.c | 181 +++++++++++++++++++++++++++------------------------ hl/src/H5LTparse.h | 2 +- hl/src/H5LTparse.y | 19 +++++- 5 files changed, 206 insertions(+), 161 deletions(-) diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index e49795a..85f499b 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -876,12 +876,22 @@ char *H5LTyytext; * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#line 15 "H5LTanalyze.l" +/* NOTE! + * + * If you make any changes to H5LTanalyze.l, please run bin/genparser to + * recreate the output files. + */ +#line 21 "H5LTanalyze.l" #include #include #include #include "H5LTparse.h" +/* Turn off suggest const attribute warning in gcc */ +#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 +#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#endif + int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) @@ -930,7 +940,7 @@ extern hbool_t is_opq_tag; hbool_t first_quote = 1; -#line 915 "H5LTanalyze.c" +#line 925 "H5LTanalyze.c" #define INITIAL 0 #define TAG_STRING 1 @@ -1105,10 +1115,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 71 "H5LTanalyze.l" +#line 82 "H5LTanalyze.l" -#line 1093 "H5LTanalyze.c" +#line 1103 "H5LTanalyze.c" if ( !(yy_init) ) { @@ -1202,277 +1212,277 @@ do_action: /* This label is used only to access EOF actions. */ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 73 "H5LTanalyze.l" +#line 84 "H5LTanalyze.l" {return hid(H5T_STD_I8BE_TOKEN);} YY_BREAK case 2: YY_RULE_SETUP -#line 74 "H5LTanalyze.l" +#line 85 "H5LTanalyze.l" {return hid(H5T_STD_I8LE_TOKEN);} YY_BREAK case 3: YY_RULE_SETUP -#line 75 "H5LTanalyze.l" +#line 86 "H5LTanalyze.l" {return hid(H5T_STD_I16BE_TOKEN);} YY_BREAK case 4: YY_RULE_SETUP -#line 76 "H5LTanalyze.l" +#line 87 "H5LTanalyze.l" {return hid(H5T_STD_I16LE_TOKEN);} YY_BREAK case 5: YY_RULE_SETUP -#line 77 "H5LTanalyze.l" +#line 88 "H5LTanalyze.l" {return hid(H5T_STD_I32BE_TOKEN);} YY_BREAK case 6: YY_RULE_SETUP -#line 78 "H5LTanalyze.l" +#line 89 "H5LTanalyze.l" {return hid(H5T_STD_I32LE_TOKEN);} YY_BREAK case 7: YY_RULE_SETUP -#line 79 "H5LTanalyze.l" +#line 90 "H5LTanalyze.l" {return hid(H5T_STD_I64BE_TOKEN);} YY_BREAK case 8: YY_RULE_SETUP -#line 80 "H5LTanalyze.l" +#line 91 "H5LTanalyze.l" {return hid(H5T_STD_I64LE_TOKEN);} YY_BREAK case 9: YY_RULE_SETUP -#line 82 "H5LTanalyze.l" +#line 93 "H5LTanalyze.l" {return hid(H5T_STD_U8BE_TOKEN);} YY_BREAK case 10: YY_RULE_SETUP -#line 83 "H5LTanalyze.l" +#line 94 "H5LTanalyze.l" {return hid(H5T_STD_U8LE_TOKEN);} YY_BREAK case 11: YY_RULE_SETUP -#line 84 "H5LTanalyze.l" +#line 95 "H5LTanalyze.l" {return hid(H5T_STD_U16BE_TOKEN);} YY_BREAK case 12: YY_RULE_SETUP -#line 85 "H5LTanalyze.l" +#line 96 "H5LTanalyze.l" {return hid(H5T_STD_U16LE_TOKEN);} YY_BREAK case 13: YY_RULE_SETUP -#line 86 "H5LTanalyze.l" +#line 97 "H5LTanalyze.l" {return hid(H5T_STD_U32BE_TOKEN);} YY_BREAK case 14: YY_RULE_SETUP -#line 87 "H5LTanalyze.l" +#line 98 "H5LTanalyze.l" {return hid(H5T_STD_U32LE_TOKEN);} YY_BREAK case 15: YY_RULE_SETUP -#line 88 "H5LTanalyze.l" +#line 99 "H5LTanalyze.l" {return hid(H5T_STD_U64BE_TOKEN);} YY_BREAK case 16: YY_RULE_SETUP -#line 89 "H5LTanalyze.l" +#line 100 "H5LTanalyze.l" {return hid(H5T_STD_U64LE_TOKEN);} YY_BREAK case 17: YY_RULE_SETUP -#line 91 "H5LTanalyze.l" +#line 102 "H5LTanalyze.l" {return hid(H5T_NATIVE_CHAR_TOKEN);} YY_BREAK case 18: YY_RULE_SETUP -#line 92 "H5LTanalyze.l" +#line 103 "H5LTanalyze.l" {return hid(H5T_NATIVE_SCHAR_TOKEN);} YY_BREAK case 19: YY_RULE_SETUP -#line 93 "H5LTanalyze.l" +#line 104 "H5LTanalyze.l" {return hid(H5T_NATIVE_UCHAR_TOKEN);} YY_BREAK case 20: YY_RULE_SETUP -#line 94 "H5LTanalyze.l" +#line 105 "H5LTanalyze.l" {return hid(H5T_NATIVE_SHORT_TOKEN);} YY_BREAK case 21: YY_RULE_SETUP -#line 95 "H5LTanalyze.l" +#line 106 "H5LTanalyze.l" {return hid(H5T_NATIVE_USHORT_TOKEN);} YY_BREAK case 22: YY_RULE_SETUP -#line 96 "H5LTanalyze.l" +#line 107 "H5LTanalyze.l" {return hid(H5T_NATIVE_INT_TOKEN);} YY_BREAK case 23: YY_RULE_SETUP -#line 97 "H5LTanalyze.l" +#line 108 "H5LTanalyze.l" {return hid(H5T_NATIVE_UINT_TOKEN);} YY_BREAK case 24: YY_RULE_SETUP -#line 98 "H5LTanalyze.l" +#line 109 "H5LTanalyze.l" {return hid(H5T_NATIVE_LONG_TOKEN);} YY_BREAK case 25: YY_RULE_SETUP -#line 99 "H5LTanalyze.l" +#line 110 "H5LTanalyze.l" {return hid(H5T_NATIVE_ULONG_TOKEN);} YY_BREAK case 26: YY_RULE_SETUP -#line 100 "H5LTanalyze.l" +#line 111 "H5LTanalyze.l" {return hid(H5T_NATIVE_LLONG_TOKEN);} YY_BREAK case 27: YY_RULE_SETUP -#line 101 "H5LTanalyze.l" +#line 112 "H5LTanalyze.l" {return hid(H5T_NATIVE_ULLONG_TOKEN);} YY_BREAK case 28: YY_RULE_SETUP -#line 103 "H5LTanalyze.l" +#line 114 "H5LTanalyze.l" {return hid(H5T_IEEE_F32BE_TOKEN);} YY_BREAK case 29: YY_RULE_SETUP -#line 104 "H5LTanalyze.l" +#line 115 "H5LTanalyze.l" {return hid(H5T_IEEE_F32LE_TOKEN);} YY_BREAK case 30: YY_RULE_SETUP -#line 105 "H5LTanalyze.l" +#line 116 "H5LTanalyze.l" {return hid(H5T_IEEE_F64BE_TOKEN);} YY_BREAK case 31: YY_RULE_SETUP -#line 106 "H5LTanalyze.l" +#line 117 "H5LTanalyze.l" {return hid(H5T_IEEE_F64LE_TOKEN);} YY_BREAK case 32: YY_RULE_SETUP -#line 107 "H5LTanalyze.l" +#line 118 "H5LTanalyze.l" {return hid(H5T_NATIVE_FLOAT_TOKEN);} YY_BREAK case 33: YY_RULE_SETUP -#line 108 "H5LTanalyze.l" +#line 119 "H5LTanalyze.l" {return hid(H5T_NATIVE_DOUBLE_TOKEN);} YY_BREAK case 34: YY_RULE_SETUP -#line 109 "H5LTanalyze.l" +#line 120 "H5LTanalyze.l" {return hid(H5T_NATIVE_LDOUBLE_TOKEN);} YY_BREAK case 35: YY_RULE_SETUP -#line 111 "H5LTanalyze.l" +#line 122 "H5LTanalyze.l" {return token(H5T_STRING_TOKEN);} YY_BREAK case 36: YY_RULE_SETUP -#line 112 "H5LTanalyze.l" +#line 123 "H5LTanalyze.l" {return token(STRSIZE_TOKEN);} YY_BREAK case 37: YY_RULE_SETUP -#line 113 "H5LTanalyze.l" +#line 124 "H5LTanalyze.l" {return token(STRPAD_TOKEN);} YY_BREAK case 38: YY_RULE_SETUP -#line 114 "H5LTanalyze.l" +#line 125 "H5LTanalyze.l" {return token(CSET_TOKEN);} YY_BREAK case 39: YY_RULE_SETUP -#line 115 "H5LTanalyze.l" +#line 126 "H5LTanalyze.l" {return token(CTYPE_TOKEN);} YY_BREAK case 40: YY_RULE_SETUP -#line 116 "H5LTanalyze.l" +#line 127 "H5LTanalyze.l" {return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP -#line 117 "H5LTanalyze.l" +#line 128 "H5LTanalyze.l" {return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP -#line 118 "H5LTanalyze.l" +#line 129 "H5LTanalyze.l" {return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP -#line 119 "H5LTanalyze.l" +#line 130 "H5LTanalyze.l" {return token(H5T_CSET_ASCII_TOKEN);} YY_BREAK case 44: YY_RULE_SETUP -#line 120 "H5LTanalyze.l" +#line 131 "H5LTanalyze.l" {return token(H5T_CSET_UTF8_TOKEN);} YY_BREAK case 45: YY_RULE_SETUP -#line 121 "H5LTanalyze.l" +#line 132 "H5LTanalyze.l" {return token(H5T_C_S1_TOKEN);} YY_BREAK case 46: YY_RULE_SETUP -#line 122 "H5LTanalyze.l" +#line 133 "H5LTanalyze.l" {return token(H5T_FORTRAN_S1_TOKEN);} YY_BREAK case 47: YY_RULE_SETUP -#line 123 "H5LTanalyze.l" +#line 134 "H5LTanalyze.l" {return token(H5T_VARIABLE_TOKEN);} YY_BREAK case 48: YY_RULE_SETUP -#line 125 "H5LTanalyze.l" +#line 136 "H5LTanalyze.l" {return token(H5T_COMPOUND_TOKEN);} YY_BREAK case 49: YY_RULE_SETUP -#line 126 "H5LTanalyze.l" +#line 137 "H5LTanalyze.l" {return token(H5T_ENUM_TOKEN);} YY_BREAK case 50: YY_RULE_SETUP -#line 127 "H5LTanalyze.l" +#line 138 "H5LTanalyze.l" {return token(H5T_ARRAY_TOKEN);} YY_BREAK case 51: YY_RULE_SETUP -#line 128 "H5LTanalyze.l" +#line 139 "H5LTanalyze.l" {return token(H5T_VLEN_TOKEN);} YY_BREAK case 52: YY_RULE_SETUP -#line 130 "H5LTanalyze.l" +#line 141 "H5LTanalyze.l" {return token(H5T_OPAQUE_TOKEN);} YY_BREAK case 53: YY_RULE_SETUP -#line 131 "H5LTanalyze.l" +#line 142 "H5LTanalyze.l" {return token(OPQ_SIZE_TOKEN);} YY_BREAK case 54: YY_RULE_SETUP -#line 132 "H5LTanalyze.l" +#line 143 "H5LTanalyze.l" {return token(OPQ_TAG_TOKEN);} YY_BREAK case 55: YY_RULE_SETUP -#line 134 "H5LTanalyze.l" +#line 145 "H5LTanalyze.l" { if( is_str_size || (is_enum && is_enum_memb) || is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || @@ -1485,7 +1495,7 @@ YY_RULE_SETUP YY_BREAK case 56: YY_RULE_SETUP -#line 144 "H5LTanalyze.l" +#line 155 "H5LTanalyze.l" { /*if it's first quote, and is a compound field name or an enum symbol*/ if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) @@ -1500,7 +1510,7 @@ YY_RULE_SETUP case 57: /* rule 57 can match eol */ YY_RULE_SETUP -#line 154 "H5LTanalyze.l" +#line 165 "H5LTanalyze.l" { #ifdef H5_HAVE_WIN32_API H5LTyylval.sval = _strdup(H5LTyytext); @@ -1513,52 +1523,52 @@ YY_RULE_SETUP YY_BREAK case 58: YY_RULE_SETUP -#line 164 "H5LTanalyze.l" +#line 175 "H5LTanalyze.l" {return token('{');} YY_BREAK case 59: YY_RULE_SETUP -#line 165 "H5LTanalyze.l" +#line 176 "H5LTanalyze.l" {return token('}');} YY_BREAK case 60: YY_RULE_SETUP -#line 166 "H5LTanalyze.l" +#line 177 "H5LTanalyze.l" {return token('[');} YY_BREAK case 61: YY_RULE_SETUP -#line 167 "H5LTanalyze.l" +#line 178 "H5LTanalyze.l" {return token(']');} YY_BREAK case 62: YY_RULE_SETUP -#line 168 "H5LTanalyze.l" +#line 179 "H5LTanalyze.l" {return token(':');} YY_BREAK case 63: YY_RULE_SETUP -#line 169 "H5LTanalyze.l" +#line 180 "H5LTanalyze.l" {return token(';');} YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 170 "H5LTanalyze.l" +#line 181 "H5LTanalyze.l" ; YY_BREAK case 65: /* rule 65 can match eol */ YY_RULE_SETUP -#line 171 "H5LTanalyze.l" +#line 182 "H5LTanalyze.l" { return 0; } YY_BREAK case 66: YY_RULE_SETUP -#line 173 "H5LTanalyze.l" +#line 184 "H5LTanalyze.l" ECHO; YY_BREAK -#line 1543 "H5LTanalyze.c" +#line 1553 "H5LTanalyze.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TAG_STRING): yyterminate(); @@ -2527,7 +2537,7 @@ void H5LTyyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 173 "H5LTanalyze.l" +#line 184 "H5LTanalyze.l" int my_yyinput(char *buf, int max_size) diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index 0470d9f..b9b492e 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -11,12 +11,23 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* NOTE! + * + * If you make any changes to H5LTanalyze.l, please run bin/genparser to + * recreate the output files. + */ + %{ #include #include #include #include "H5LTparse.h" +/* Turn off suggest const attribute warning in gcc */ +#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 +#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#endif + int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 16a0bcf..b85f9a0 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -89,7 +89,7 @@ /* Copy the first part of user declarations. */ /* Line 371 of yacc.c */ -#line 14 "H5LTparse.y" +#line 20 "H5LTparse.y" #include #include @@ -243,7 +243,7 @@ extern int H5LTyydebug; typedef union YYSTYPE { /* Line 387 of yacc.c */ -#line 66 "H5LTparse.y" +#line 72 "H5LTparse.y" int ival; /*for integer token*/ char *sval; /*for name string*/ @@ -603,16 +603,16 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 99, 99, 100, 102, 103, 104, 105, 107, 108, - 109, 110, 111, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 143, 144, 145, 146, 147, 148, 149, 153, 152, 161, - 162, 164, 164, 198, 204, 205, 208, 210, 210, 219, - 220, 222, 223, 222, 230, 233, 239, 240, 245, 246, - 237, 252, 254, 258, 259, 267, 276, 283, 256, 307, - 308, 310, 311, 312, 314, 315, 317, 318, 322, 321, - 326, 327, 329, 329, 381, 383 + 0, 105, 105, 106, 108, 109, 110, 111, 113, 114, + 115, 116, 117, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 149, 150, 151, 152, 153, 154, 155, 159, 158, 167, + 168, 170, 170, 207, 215, 216, 219, 221, 221, 230, + 231, 233, 234, 233, 241, 244, 250, 251, 256, 257, + 248, 265, 267, 271, 272, 280, 289, 296, 269, 320, + 321, 323, 324, 325, 327, 328, 330, 331, 335, 334, + 339, 340, 342, 342, 396, 398 }; #endif @@ -1642,229 +1642,229 @@ yyreduce: { case 2: /* Line 1792 of yacc.c */ -#line 99 "H5LTparse.y" +#line 105 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: /* Line 1792 of yacc.c */ -#line 100 "H5LTparse.y" +#line 106 "H5LTparse.y" { return (yyval.hid);} break; case 13: /* Line 1792 of yacc.c */ -#line 114 "H5LTparse.y" +#line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: /* Line 1792 of yacc.c */ -#line 115 "H5LTparse.y" +#line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: /* Line 1792 of yacc.c */ -#line 116 "H5LTparse.y" +#line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: /* Line 1792 of yacc.c */ -#line 117 "H5LTparse.y" +#line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: /* Line 1792 of yacc.c */ -#line 118 "H5LTparse.y" +#line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: /* Line 1792 of yacc.c */ -#line 119 "H5LTparse.y" +#line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: /* Line 1792 of yacc.c */ -#line 120 "H5LTparse.y" +#line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: /* Line 1792 of yacc.c */ -#line 121 "H5LTparse.y" +#line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: /* Line 1792 of yacc.c */ -#line 122 "H5LTparse.y" +#line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: /* Line 1792 of yacc.c */ -#line 123 "H5LTparse.y" +#line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: /* Line 1792 of yacc.c */ -#line 124 "H5LTparse.y" +#line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: /* Line 1792 of yacc.c */ -#line 125 "H5LTparse.y" +#line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: /* Line 1792 of yacc.c */ -#line 126 "H5LTparse.y" +#line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: /* Line 1792 of yacc.c */ -#line 127 "H5LTparse.y" +#line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: /* Line 1792 of yacc.c */ -#line 128 "H5LTparse.y" +#line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: /* Line 1792 of yacc.c */ -#line 129 "H5LTparse.y" +#line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: /* Line 1792 of yacc.c */ -#line 130 "H5LTparse.y" +#line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: /* Line 1792 of yacc.c */ -#line 131 "H5LTparse.y" +#line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: /* Line 1792 of yacc.c */ -#line 132 "H5LTparse.y" +#line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: /* Line 1792 of yacc.c */ -#line 133 "H5LTparse.y" +#line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: /* Line 1792 of yacc.c */ -#line 134 "H5LTparse.y" +#line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: /* Line 1792 of yacc.c */ -#line 135 "H5LTparse.y" +#line 141 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: /* Line 1792 of yacc.c */ -#line 136 "H5LTparse.y" +#line 142 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: /* Line 1792 of yacc.c */ -#line 137 "H5LTparse.y" +#line 143 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: /* Line 1792 of yacc.c */ -#line 138 "H5LTparse.y" +#line 144 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: /* Line 1792 of yacc.c */ -#line 139 "H5LTparse.y" +#line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: /* Line 1792 of yacc.c */ -#line 140 "H5LTparse.y" +#line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: /* Line 1792 of yacc.c */ -#line 143 "H5LTparse.y" +#line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: /* Line 1792 of yacc.c */ -#line 144 "H5LTparse.y" +#line 150 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: /* Line 1792 of yacc.c */ -#line 145 "H5LTparse.y" +#line 151 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: /* Line 1792 of yacc.c */ -#line 146 "H5LTparse.y" +#line 152 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: /* Line 1792 of yacc.c */ -#line 147 "H5LTparse.y" +#line 153 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: /* Line 1792 of yacc.c */ -#line 148 "H5LTparse.y" +#line 154 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: /* Line 1792 of yacc.c */ -#line 149 "H5LTparse.y" +#line 155 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: /* Line 1792 of yacc.c */ -#line 153 "H5LTparse.y" +#line 159 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: /* Line 1792 of yacc.c */ -#line 155 "H5LTparse.y" +#line 161 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; cmpd_stack[csindex].first_memb = 1; @@ -1874,13 +1874,13 @@ yyreduce: case 51: /* Line 1792 of yacc.c */ -#line 164 "H5LTparse.y" +#line 170 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: /* Line 1792 of yacc.c */ -#line 166 "H5LTparse.y" +#line 172 "H5LTparse.y" { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; @@ -1906,7 +1906,10 @@ yyreduce: H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].hid)); } } - + if((yyvsp[(4) - (7)].sval)) { + free((yyvsp[(4) - (7)].sval)); + (yyvsp[(4) - (7)].sval) = NULL; + } cmpd_stack[csindex].is_field = 0; H5Tclose((yyvsp[(1) - (7)].hid)); @@ -1916,33 +1919,35 @@ yyreduce: case 53: /* Line 1792 of yacc.c */ -#line 199 "H5LTparse.y" +#line 208 "H5LTparse.y" { - (yyval.sval) = yylval.sval; + (yyval.sval) = strdup(yylval.sval); + free(yylval.sval); + yylval.sval = NULL; } break; case 54: /* Line 1792 of yacc.c */ -#line 204 "H5LTparse.y" +#line 215 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: /* Line 1792 of yacc.c */ -#line 206 "H5LTparse.y" +#line 217 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: /* Line 1792 of yacc.c */ -#line 210 "H5LTparse.y" +#line 221 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: /* Line 1792 of yacc.c */ -#line 212 "H5LTparse.y" +#line 223 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; @@ -1953,13 +1958,13 @@ yyreduce: case 61: /* Line 1792 of yacc.c */ -#line 222 "H5LTparse.y" +#line 233 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: /* Line 1792 of yacc.c */ -#line 223 "H5LTparse.y" +#line 234 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; @@ -1969,19 +1974,19 @@ yyreduce: case 65: /* Line 1792 of yacc.c */ -#line 234 "H5LTparse.y" +#line 245 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: /* Line 1792 of yacc.c */ -#line 239 "H5LTparse.y" +#line 250 "H5LTparse.y" { is_opq_size = 1; } break; case 67: /* Line 1792 of yacc.c */ -#line 240 "H5LTparse.y" +#line 251 "H5LTparse.y" { size_t size = (size_t)yylval.ival; (yyval.hid) = H5Tcreate(H5T_OPAQUE, size); @@ -1991,34 +1996,36 @@ yyreduce: case 68: /* Line 1792 of yacc.c */ -#line 245 "H5LTparse.y" +#line 256 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: /* Line 1792 of yacc.c */ -#line 246 "H5LTparse.y" +#line 257 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); + free(yylval.sval); + yylval.sval = NULL; is_opq_tag = 0; } break; case 70: /* Line 1792 of yacc.c */ -#line 250 "H5LTparse.y" +#line 263 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: /* Line 1792 of yacc.c */ -#line 258 "H5LTparse.y" +#line 271 "H5LTparse.y" { is_str_size = 1; } break; case 74: /* Line 1792 of yacc.c */ -#line 259 "H5LTparse.y" +#line 272 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) is_variable = 1; @@ -2030,7 +2037,7 @@ yyreduce: case 75: /* Line 1792 of yacc.c */ -#line 267 "H5LTparse.y" +#line 280 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; @@ -2043,7 +2050,7 @@ yyreduce: case 76: /* Line 1792 of yacc.c */ -#line 276 "H5LTparse.y" +#line 289 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; @@ -2054,7 +2061,7 @@ yyreduce: case 77: /* Line 1792 of yacc.c */ -#line 283 "H5LTparse.y" +#line 296 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_C_S1); @@ -2065,7 +2072,7 @@ yyreduce: case 78: /* Line 1792 of yacc.c */ -#line 290 "H5LTparse.y" +#line 303 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2086,67 +2093,67 @@ yyreduce: case 79: /* Line 1792 of yacc.c */ -#line 307 "H5LTparse.y" +#line 320 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: /* Line 1792 of yacc.c */ -#line 310 "H5LTparse.y" +#line 323 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: /* Line 1792 of yacc.c */ -#line 311 "H5LTparse.y" +#line 324 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: /* Line 1792 of yacc.c */ -#line 312 "H5LTparse.y" +#line 325 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: /* Line 1792 of yacc.c */ -#line 314 "H5LTparse.y" +#line 327 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: /* Line 1792 of yacc.c */ -#line 315 "H5LTparse.y" +#line 328 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: /* Line 1792 of yacc.c */ -#line 317 "H5LTparse.y" +#line 330 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: /* Line 1792 of yacc.c */ -#line 318 "H5LTparse.y" +#line 331 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: /* Line 1792 of yacc.c */ -#line 322 "H5LTparse.y" +#line 335 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: /* Line 1792 of yacc.c */ -#line 324 "H5LTparse.y" +#line 337 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: /* Line 1792 of yacc.c */ -#line 329 "H5LTparse.y" +#line 342 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ #ifdef H5_HAVE_WIN32_API @@ -2154,12 +2161,14 @@ yyreduce: #else /* H5_HAVE_WIN32_API */ enum_memb_symbol = strdup(yylval.sval); #endif /* H5_HAVE_WIN32_API */ + free(yylval.sval); + yylval.sval = NULL; } break; case 93: /* Line 1792 of yacc.c */ -#line 338 "H5LTparse.y" +#line 353 "H5LTparse.y" { char char_val=(char)yylval.ival; short short_val=(short)yylval.ival; @@ -2206,7 +2215,7 @@ yyreduce: /* Line 1792 of yacc.c */ -#line 2191 "H5LTparse.c" +#line 2200 "H5LTparse.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 7481a45..71e520d 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -110,7 +110,7 @@ extern int H5LTyydebug; typedef union YYSTYPE { /* Line 2058 of yacc.c */ -#line 66 "H5LTparse.y" +#line 72 "H5LTparse.y" int ival; /*for integer token*/ char *sval; /*for name string*/ diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y index 0022174..66a8556 100644 --- a/hl/src/H5LTparse.y +++ b/hl/src/H5LTparse.y @@ -11,6 +11,12 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* NOTE! + * + * If you make any changes to H5LTparse.y, please run bin/genparser to + * recreate the output files. + */ + %{ #include #include @@ -188,7 +194,10 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le H5Tinsert(dtype_id, $4, $6, $1); } } - + if($4) { + free($4); + $4 = NULL; + } cmpd_stack[csindex].is_field = 0; H5Tclose($1); @@ -197,7 +206,9 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le ; field_name : STRING { - $$ = yylval.sval; + $$ = strdup(yylval.sval); + free(yylval.sval); + yylval.sval = NULL; } ; field_offset : /*empty*/ @@ -245,6 +256,8 @@ opaque_type : H5T_OPAQUE_TOKEN OPQ_TAG_TOKEN { is_opq_tag = 1; } '"' opaque_tag '"' ';' { H5Tset_tag($7, yylval.sval); + free(yylval.sval); + yylval.sval = NULL; is_opq_tag = 0; } '}' { $$ = $7; } @@ -333,6 +346,8 @@ enum_def : '"' enum_symbol '"' { #else /* H5_HAVE_WIN32_API */ enum_memb_symbol = strdup(yylval.sval); #endif /* H5_HAVE_WIN32_API */ + free(yylval.sval); + yylval.sval = NULL; } enum_val ';' { -- cgit v0.12 From 8353ff7d3db7bd9108d1582a2a6fa22b910518d4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 1 Apr 2020 11:51:25 -0500 Subject: Correct extra flags and merge TRILAB-24 --- config/cmake_ext_mod/ConfigureChecks.cmake | 26 +++++----- config/cmake_ext_mod/HDFTests.c | 79 ------------------------------ release_docs/RELEASE.txt | 7 +++ 3 files changed, 22 insertions(+), 90 deletions(-) diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 52cb7dd..93b977e 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -20,6 +20,7 @@ include (CheckSymbolExists) include (CheckTypeSize) include (CheckVariableExists) include (TestBigEndian) +include (CheckStructHasMember) #----------------------------------------------------------------------------- # APPLE/Darwin setup @@ -273,11 +274,11 @@ if (MINGW OR NOT WINDOWS) # systems. # POSIX feature information can be found in the gcc manual at: # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200112L) + set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200809L) # Need to add this so that O_DIRECT is visible for the direct # VFD on Linux systems. - set (HDF_EXTRA_C_FLAGS -D_GNU_SOURCE) + set (HDF_EXTRA_C_FLAGS ${HDF_EXTRA_C_FLAGS} -D_GNU_SOURCE) option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) if (HDF_ENABLE_LARGE_FILE AND NOT DEFINED TEST_LFS_WORKS_RUN) @@ -328,7 +329,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 () @@ -438,14 +439,18 @@ if (MINGW OR NOT WINDOWS) #----------------------------------------------------------------------------- # Check a bunch of time functions #----------------------------------------------------------------------------- + CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff "time.h" ${HDF_PREFIX}_HAVE_TM_GMTOFF) + CHECK_STRUCT_HAS_MEMBER("struct tm" __tm_gmtoff "time.h" ${HDF_PREFIX}_HAVE___TM_GMTOFF) + CHECK_STRUCT_HAS_MEMBER("struct tm" tm_sec "sys/types.h;sys/time.h;time.h" ${HDF_PREFIX}_TIME_WITH_SYS_TIME) + if (${HDF_PREFIX}_HAVE_SYS_TIME_H) + CHECK_STRUCT_HAS_MEMBER("struct tm" tz_minuteswest "sys/types.h;sys/time.h;time.h" ${HDF_PREFIX}_HAVE_STRUCT_TIMEZONE) + else () + CHECK_STRUCT_HAS_MEMBER("struct tm" tz_minuteswest "sys/types.h;time.h" ${HDF_PREFIX}_HAVE_STRUCT_TIMEZONE) + endif () CHECK_FUNCTION_EXISTS (gettimeofday ${HDF_PREFIX}_HAVE_GETTIMEOFDAY) foreach (time_test - HAVE_TM_GMTOFF - HAVE___TM_GMTOFF # HAVE_TIMEZONE - HAVE_STRUCT_TIMEZONE GETTIMEOFDAY_GIVES_TZ - TIME_WITH_SYS_TIME HAVE_TM_ZONE HAVE_STRUCT_TM_TM_ZONE ) @@ -453,20 +458,19 @@ if (MINGW OR NOT WINDOWS) endforeach () if (NOT CYGWIN AND NOT MINGW) HDF_FUNCTION_TEST (HAVE_TIMEZONE) -# HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) endif () # ---------------------------------------------------------------------- # Does the struct stat have the st_blocks field? This field is not Posix. # - HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) + CHECK_STRUCT_HAS_MEMBER("struct stat" st_blocks "sys/types.h;sys/stat.h" ${HDF_PREFIX}_HAVE_STAT_ST_BLOCKS) # ---------------------------------------------------------------------- # How do we figure out the width of a tty in characters? # CHECK_FUNCTION_EXISTS (ioctl ${HDF_PREFIX}_HAVE_IOCTL) - HDF_FUNCTION_TEST (HAVE_STRUCT_VIDEOCONFIG) - HDF_FUNCTION_TEST (HAVE_STRUCT_TEXT_INFO) + CHECK_STRUCT_HAS_MEMBER ("struct videoconfig" numtextcols "" ${HDF_PREFIX}_HAVE_STRUCT_VIDEOCONFIG) + CHECK_STRUCT_HAS_MEMBER ("struct text_info" screenwidth "" ${HDF_PREFIX}_HAVE_STRUCT_TEXT_INFO) CHECK_FUNCTION_EXISTS (_getvideoconfig ${HDF_PREFIX}_HAVE__GETVIDEOCONFIG) CHECK_FUNCTION_EXISTS (gettextinfo ${HDF_PREFIX}_HAVE_GETTEXTINFO) CHECK_FUNCTION_EXISTS (_scrsize ${HDF_PREFIX}_HAVE__SCRSIZE) diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 0b9b530..31a568a 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -88,25 +88,6 @@ int main(void) } #endif - -#ifdef TIME_WITH_SYS_TIME -/* Time with sys/time test */ - -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} - -#endif - #ifdef STDC_HEADERS #include #include @@ -162,26 +143,6 @@ main () #endif /* HAVE_FUNCTION */ -#ifdef HAVE_TM_GMTOFF - -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include -SIMPLE_TEST(struct tm tm; tm.tm_gmtoff=0); - -#endif /* HAVE_TM_GMTOFF */ - -#ifdef HAVE___TM_GMTOFF - -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include -SIMPLE_TEST(struct tm tm; tm.__tm_gmtoff=0); - -#endif /* HAVE_TM___GMTOFF */ - #ifdef HAVE_TIMEZONE #ifdef HAVE_SYS_TIME_H @@ -192,24 +153,6 @@ SIMPLE_TEST(timezone=0); #endif /* HAVE_TIMEZONE */ -#ifdef HAVE_STRUCT_TIMEZONE - -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include -SIMPLE_TEST(struct timezone tz; tz.tz_minuteswest=0); - -#endif /* HAVE_STRUCT_TIMEZONE */ - -#ifdef HAVE_STAT_ST_BLOCKS - -#include -SIMPLE_TEST(struct stat sb; sb.st_blocks=0); - -#endif /* HAVE_STAT_ST_BLOCKS */ - #ifdef PRINTF_LL_WIDTH #ifdef HAVE_LONG_LONG @@ -319,16 +262,6 @@ int main() } #endif -#ifdef HAVE_STAT64_STRUCT -#include -#include ], -struct stat64 sb; -int main() -{ - return 0; -} -#endif - #ifdef TEST_DIRECT_VFD_WORKS #include #include @@ -432,18 +365,6 @@ int main () #endif /* HAVE_IOEO */ -#ifdef HAVE_STRUCT_VIDEOCONFIG - -SIMPLE_TEST(struct videoconfig w; w.numtextcols=0); - -#endif /* HAVE_STRUCT_VIDEOCONFIG */ - -#ifdef HAVE_STRUCT_TEXT_INFO - -SIMPLE_TEST(struct text_info w; w.screenwidth=0); - -#endif /* HAVE_STRUCT_TEXT_INFO */ - #if defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE ) #ifndef __cplusplus #if defined( HAVE_INLINE ) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 23449dc..6d90b1b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -56,6 +56,13 @@ New Features Configuration ------------- + - CMake ConfigureChecks.cmake file now uses CHECK_STRUCT_HAS_MEMBER + + Some handcrafted tests in HDFTests.c has been removed and the CMake + CHECK_STRUCT_HAS_MEMBER module has been used. + + (ADB - 2020/03/24, TRILAB-24) + - Both build systems use same set of warnings flags GNU C warnings flags were moved to files in a config sub-folder -- cgit v0.12 From b232e44df543a513103b28d4c80af2089ff2b413 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 3 Apr 2020 13:03:01 -0500 Subject: Update release note for CMake warnings --- release_docs/RELEASE.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6d90b1b..fbf136f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -78,6 +78,8 @@ New Features that are chosen by the CMake option:HDF5_ENABLE_DEV_WARNINGS or the configure option:--enable-developer-warnings. + In addition, CMake no longer applies these warnings for tests and examples. + (ADB - 2020/03/24, TRILAB-192) - Update CMake minimum version to 3.12 -- cgit v0.12 From 3b6e958adf83a7e205e769e4f393ef2b6cee20b9 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 3 Apr 2020 17:09:24 -0500 Subject: H5repack bug fixes from develop --- tools/h5repack/h5repack_copy.c | 18 +++++++++++------ tools/h5repack/h5repack_main.c | 44 ++++++++++++++++++++++++++++++++---------- 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 58f65ef..e3a7d75 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -672,11 +672,14 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, break; - /*------------------------------------------------------------------------- - * H5TRAV_TYPE_DATASET - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5TRAV_TYPE_DATASET + *------------------------------------------------------------------------- + */ case H5TRAV_TYPE_DATASET: + { + hbool_t use_h5ocopy; + has_filter = 0; req_filter = 0; @@ -734,9 +737,10 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, * otherwise we do a copy using H5Ocopy *------------------------------------------------------------------------- */ - if (options->op_tbl->nelems || options->all_filter == 1 - || options->all_layout == 1 || is_ref || is_named) { + use_h5ocopy = !(options->op_tbl->nelems || options->all_filter == 1 + || options->all_layout == 1 || is_ref || is_named); + if (!use_h5ocopy) { int j; if ((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) @@ -1105,7 +1109,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, HDprintf(FORMAT_OBJ, "dset", travt->objs[i].name); } /* end whether we have request for filter/chunking */ + break; + } /* H5TRAV_TYPE_DATASET */ /*------------------------------------------------------------------------- * H5TRAV_TYPE_NAMED_DATATYPE diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index f57a128..6223d29 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -228,6 +228,8 @@ int read_info(const char *filename, pack_opt_t *options) /* cycle until end of file reached */ while (1) { + if (EOF == fscanf(fp, "%9s", stype)) + break; /* Info indicator must be for layout or filter */ if (HDstrcmp(stype,"-l") && HDstrcmp(stype, "-f")) { @@ -269,7 +271,7 @@ int read_info(const char *filename, pack_opt_t *options) if (!HDstrcmp(stype, "-l")) { if (h5repack_addlayout(comp_info, options) == -1) { - error_msg("could not add chunck option\n"); + error_msg("could not add chunk option\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; goto done; @@ -369,13 +371,13 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) case 'h': usage(h5tools_getprogname()); h5tools_setstatus(EXIT_SUCCESS); - ret_value = -1; + ret_value = 1; goto done; case 'V': print_version(h5tools_getprogname()); h5tools_setstatus(EXIT_SUCCESS); - ret_value = -1; + ret_value = 1; goto done; case 'v': @@ -413,9 +415,12 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) break; case 'e': - ret_value = read_info(opt_arg, options); - if (ret_value < 0) + if ((ret_value = read_info(opt_arg, options)) < 0) { + error_msg("failed to read from repack options file <%s>\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; goto done; + } break; case 'n': @@ -496,7 +501,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) break; case 'q': - if (H5_INDEX_UNKNOWN == set_sort_by(opt_arg)) { + if (H5_INDEX_UNKNOWN == (sort_by = set_sort_by(opt_arg))) { error_msg(" failed to set sort by form <%s>\n", opt_arg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; @@ -505,7 +510,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) break; case 'z': - if (set_sort_order(opt_arg) == H5_ITER_UNKNOWN) { + if (H5_ITER_UNKNOWN == (sort_order = set_sort_order(opt_arg))) { error_msg(" failed to set sort order form <%s>\n", opt_arg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; @@ -565,11 +570,12 @@ done: */ int main(int argc, const char **argv) { - pack_opt_t options; /*the global options */ + pack_opt_t options; /*the global options */ H5E_auto2_t func; H5E_auto2_t tools_func; void *edata; void *tools_edata; + int parse_ret; HDmemset(&options, 0, sizeof(pack_opt_t)); @@ -589,20 +595,32 @@ int main(int argc, const char **argv) /* update hyperslab buffer size from H5TOOLS_BUFSIZE env if exist */ if (h5tools_getenv_update_hyperslab_bufsize() < 0) { + HDprintf("Error occurred while retrieving H5TOOLS_BUFSIZE value\n"); h5tools_setstatus(EXIT_FAILURE); goto done; } /* initialize options */ if (h5repack_init(&options, 0, FALSE) < 0) { + HDprintf("Error occurred while initializing repack options\n"); h5tools_setstatus(EXIT_FAILURE); goto done; } + /* Initialize default indexing options */ sort_by = H5_INDEX_CRT_ORDER; - if (parse_command_line(argc, argv, &options) < 0) + parse_ret = parse_command_line(argc, argv, &options); + if (parse_ret < 0) { + HDprintf("Error occurred while parsing command-line options\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + else if (parse_ret > 0) { + /* Short-circuit success */ + h5tools_setstatus(EXIT_SUCCESS); goto done; + } if (enable_error_stack > 0) { H5Eset_auto2(H5E_DEFAULT, func, edata); @@ -610,7 +628,13 @@ int main(int argc, const char **argv) } /* pack it */ - h5tools_setstatus(h5repack(infile, outfile, &options)); + if (h5repack(infile, outfile, &options) < 0) { + HDprintf("Error occurred while repacking\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + + h5tools_setstatus(EXIT_SUCCESS); done: /* free tables */ -- cgit v0.12 From 8d2de5906b4257f44c08f22cfecafb8ff3a2a9dd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 7 Apr 2020 09:54:20 -0500 Subject: TRILAB-192 - merge changes from develop Single source, config files, for warnings for both autotools and CMake. Update CMake libraries, tools, tests to use correct flags. --- CMakeLists.txt | 4 + MANIFEST | 14 +- c++/src/CMakeLists.txt | 8 +- c++/test/CMakeLists.txt | 1 + config/cmake/CTestCustom.cmake | 4 +- config/cmake/HDFCXXCompilerFlags.cmake | 326 +++++++++++ config/cmake/HDFCompilerFlags.cmake | 88 +-- config/cmake/HDFFortranCompilerFlags.cmake | 142 +++++ config/cmake/libhdf5.settings.cmake.in | 2 +- config/gnu-cxxflags | 887 ++++++----------------------- config/gnu-fflags | 163 +++++- config/gnu-flags | 291 +++------- config/gnu-warnings/cxx-general | 19 + config/gnu-warnings/gfort-4.4 | 2 + config/gnu-warnings/gfort-4.5 | 1 + config/gnu-warnings/gfort-4.7 | 2 + config/gnu-warnings/gfort-4.8 | 5 + config/gnu-warnings/gfort-5 | 1 + config/gnu-warnings/gfort-6 | 1 + config/gnu-warnings/gfort-8 | 1 + config/gnu-warnings/gfort-general | 12 + config/intel-fflags | 44 +- config/intel-flags | 66 ++- config/intel-warnings-general | 10 - config/intel-warnings/general | 2 + config/intel-warnings/ifort-general | 1 + fortran/examples/CMakeLists.txt | 103 ++-- fortran/src/CMakeLists.txt | 87 +-- fortran/test/CMakeLists.txt | 198 ++----- fortran/test/tH5T_F03.f90 | 2 +- fortran/testpar/CMakeLists.txt | 15 +- hl/c++/src/CMakeLists.txt | 9 +- hl/c++/test/CMakeLists.txt | 1 + hl/fortran/examples/CMakeLists.txt | 28 +- hl/fortran/src/CMakeLists.txt | 63 +- hl/fortran/test/CMakeLists.txt | 29 +- hl/src/CMakeLists.txt | 12 +- hl/test/CMakeLists.txt | 4 + hl/tools/gif2h5/CMakeLists.txt | 4 + release_docs/RELEASE.txt | 8 +- src/CMakeLists.txt | 8 +- test/CMakeLists.txt | 13 +- test/cache_common.h | 3 + test/dsets.c | 14 +- test/th5o.c | 46 +- testpar/CMakeLists.txt | 2 + tools/h5diff/CMakeLists.txt | 2 + tools/lib/CMakeLists.txt | 8 +- tools/libtest/CMakeLists.txt | 1 + 49 files changed, 1266 insertions(+), 1491 deletions(-) create mode 100644 config/cmake/HDFCXXCompilerFlags.cmake create mode 100644 config/cmake/HDFFortranCompilerFlags.cmake create mode 100644 config/gnu-warnings/cxx-general create mode 100644 config/gnu-warnings/gfort-4.4 create mode 100644 config/gnu-warnings/gfort-4.5 create mode 100644 config/gnu-warnings/gfort-4.7 create mode 100644 config/gnu-warnings/gfort-4.8 create mode 100644 config/gnu-warnings/gfort-5 create mode 100644 config/gnu-warnings/gfort-6 create mode 100644 config/gnu-warnings/gfort-8 create mode 100644 config/gnu-warnings/gfort-general delete mode 100644 config/intel-warnings-general create mode 100644 config/intel-warnings/general create mode 100644 config/intel-warnings/ifort-general diff --git a/CMakeLists.txt b/CMakeLists.txt index d3f4b52..1fadc18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -813,6 +813,9 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) + message (STATUS "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}") + include (${HDF_RESOURCES_DIR}/HDFFortranCompilerFlags.cmake) + include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake) set (LINK_Fortran_LIBS ${LINK_LIBS}) if (HDF5_ENABLE_F2003) @@ -856,6 +859,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") endif () include (${HDF_RESOURCES_EXT_DIR}/HDFUseCXX.cmake) + include (${HDF_RESOURCES_DIR}/HDFCXXCompilerFlags.cmake) if (CMAKE_NO_STD_NAMESPACE) set (H5_NO_STD 1) diff --git a/MANIFEST b/MANIFEST index eddbaa4..55a8ea2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -145,6 +145,7 @@ ./config/gnu-warnings/7 ./config/gnu-warnings/8 ./config/gnu-warnings/9 +./config/gnu-warnings/cxx-general ./config/gnu-warnings/developer-4.5 ./config/gnu-warnings/developer-4.6 ./config/gnu-warnings/developer-4.7 @@ -156,13 +157,22 @@ ./config/gnu-warnings/error-8 ./config/gnu-warnings/error-general ./config/gnu-warnings/general +./config/gnu-warnings/gfort-general +./config/gnu-warnings/gfort-4.4 +./config/gnu-warnings/gfort-4.5 +./config/gnu-warnings/gfort-4.7 +./config/gnu-warnings/gfort-4.8 +./config/gnu-warnings/gfort-5 +./config/gnu-warnings/gfort-6 +./config/gnu-warnings/gfort-8 ./config/gnu-warnings/no-developer-4.5 ./config/gnu-warnings/no-developer-4.6 ./config/gnu-warnings/no-developer-4.7 ./config/gnu-warnings/no-developer-4.8 ./config/gnu-warnings/no-developer-8 ./config/gnu-warnings/no-developer-general -./config/intel-warnings-general +./config/intel-warnings/ifort-general +./config/intel-warnings/general ./config/site-specific/BlankForm @@ -2426,6 +2436,8 @@ ./config/cmake/hdf5-config.cmake.in ./config/cmake/hdf5-config-version.cmake.in ./config/cmake/HDFCompilerFlags.cmake +./config/cmake/HDFCXXCompilerFlags.cmake +./config/cmake/HDFFortranCompilerFlags.cmake ./config/cmake/HDF5Macros.cmake ./config/cmake/HDF5UseFortran.cmake ./config/cmake/libh5cc.in diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index f5a52e7..0b2aeed 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -92,9 +92,7 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) - target_compile_options(${HDF5_CPP_LIB_TARGET} - PRIVATE "${HDF5_CMAKE_CXX_FLAGS}" - ) + target_compile_options(${HDF5_CPP_LIB_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") target_compile_definitions(${HDF5_CPP_LIB_TARGET} PRIVATE $<$:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings ) @@ -112,9 +110,7 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) - target_compile_options(${HDF5_CPP_LIBSH_TARGET} - PRIVATE "${HDF5_CMAKE_CXX_FLAGS}" - ) + target_compile_options(${HDF5_CPP_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") target_compile_definitions(${HDF5_CPP_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" PRIVATE $<$:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index c171664..3eb08f4 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -38,6 +38,7 @@ configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @O add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ) target_include_directories (cpp_testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_compile_options(cpp_testhdf5 PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") target_compile_definitions(cpp_testhdf5 PRIVATE $<$:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings ) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index fd901f8..0a1c5bd 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -30,11 +30,11 @@ set (CTEST_CUSTOM_WARNING_EXCEPTION "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 diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake new file mode 100644 index 0000000..bf22886 --- /dev/null +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -0,0 +1,326 @@ +# +# 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. +# +set(CMAKE_CXX_STANDARD 98) +set(CMAKE_CXX_STANDARD_REQUIRED TRUE) +set(CMAKE_CXX_EXTENSIONS OFF) + +macro (ADD_H5_FLAGS h5_flag_var infile) + file (STRINGS ${infile} TEST_FLAG_STREAM) + #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") + list (LENGTH TEST_FLAG_STREAM len_flag) + if (len_flag GREATER 0) + math (EXPR _FP_LEN "${len_flag} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET TEST_FLAG_STREAM ${line} str_flag) + string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") + #message (STATUS "str_flag=${str_flag}") + if (str_flag) + list (APPEND ${h5_flag_var} "${str_flag}") + endif () + endforeach () + endif () + #message (STATUS "h5_flag_var=${${h5_flag_var}}") +endmacro () + +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}") +message (STATUS "Warnings Configuration: CXX default: ${CMAKE_CXX_FLAGS}") +#----------------------------------------------------------------------------- +# Compiler specific flags : Shouldn't there be compiler tests for these +#----------------------------------------------------------------------------- +if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") + if (${HDF_CFG_NAME} MATCHES "Debug") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") + endif () + else () + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") + endif () + 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_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) + endif () + + # Most compilers use -w to suppress warnings. + if (NOT HDF5_WARNINGS_BLOCKED) + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# HDF5 library compile options +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# CDash is configured to only allow 3000 warnings, so +# break into groups (from the config/gnu-flags file) +#----------------------------------------------------------------------------- +if (NOT MSVC) + if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + list (APPEND HDF5_CMAKE_CXX_FLAGS "-erroff=%none -DBSD_COMP") + else () + # General flags + # + # Note that some of the flags listed here really should be developer + # flags (listed in a separate variable, below) but we put them here + # because they are not raised by the current code and we'd like to + # know if they do start showing up. + # + # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) + # warnings that are emitted. If you need it, add it at configure time. + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general") + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) + list (APPEND H5_CXXFLAGS0 "-Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow") + list (APPEND H5_CXXFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings") + endif() + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general") + endif () + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "PGI") + list (APPEND HDF5_CMAKE_CXX_FLAGS "-Minform=inform") + endif () + message (STATUS "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}") + 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") + # list (APPEND H5_CXXFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing") + # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") + # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") + # endif () + #else () + # if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") + # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") + # endif () + #endif () + + + #if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # # Append warning flags that only gcc 4.3+ knows about + # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") + + # # Append more extra warning flags that only gcc 4.4+ know about + # if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) + # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4") + # endif () + #endif () + + # Append more extra warning flags that only gcc 4.5+ know about + #if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5) + # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5") + # if (HDF5_ENABLE_DEV_WARNINGS) + # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5") + # else () + # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5") + # endif () + #endif () +else () + list (APPEND HDF5_CMAKE_CXX_FLAGS "/EHsc") +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_COMPILER_IS_GNUCXX AND 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_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3") + endif () + endif () + else () + if (CMAKE_COMPILER_IS_GNUCC) + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0} ${H5_CXXFLAGS1} ${H5_CXXFLAGS2} ${H5_CXXFLAGS3} ${H5_CXXFLAGS4}) + endif () + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_GROUPZERO_WARNINGS) + message (STATUS "....Group Zero warnings are enabled") + if (MSVC) + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/W1") + endif () + else () + if (CMAKE_COMPILER_IS_GNUCC) + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS0}) + endif () + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_GROUPONE_WARNINGS) + message (STATUS "....Group One warnings are enabled") + if (MSVC) + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/W2") + endif () + else () + if (CMAKE_COMPILER_IS_GNUCC) + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS1}) + endif () + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_GROUPTWO_WARNINGS) + message (STATUS "....Group Two warnings are enabled") + if (MSVC) + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3") + endif () + else () + if (CMAKE_COMPILER_IS_GNUCC) + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS2}) + endif () + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_GROUPTHREE_WARNINGS) + message (STATUS "....Group Three warnings are enabled") + if (MSVC) + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") + list (APPEND HDF5_CMAKE_CXX_FLAGS "/W4") + endif () + else () + if (CMAKE_COMPILER_IS_GNUCC) + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS3}) + endif () + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_GROUPFOUR_WARNINGS) + message (STATUS "....Group Four warnings are enabled") + if (NOT MSVC) + if (CMAKE_COMPILER_IS_GNUCC) + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS4}) + endif () + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# This is in here to help some of the GCC based IDES like Eclipse +# and code blocks parse the compiler errors and warnings better. +#----------------------------------------------------------------------------- +if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") +endif () + +#----------------------------------------------------------------------------- +# Option for --enable-symbols +# This option will force/override the default setting for all configurations +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_SYMBOLS MATCHES "YES") + if(CMAKE_CXX_COMPILER_LOADED) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + endif () + endif () +elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO") + if(CMAKE_CXX_COMPILER_LOADED) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wl,-s") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +# Option for --enable-profiling +# This option will force/override the default setting for all configurations +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_PROFILING) + if(CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS "${PROFILE_CXXFLAGS}") + endif () +endif () + +#----------------------------------------------------------------------------- +# Option for --enable-optimization +# This option will force/override the default setting for all configurations +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_OPTIMIZATION) + if(CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS "${OPTIMIZE_CXXFLAGS}") + endif () +endif () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 03c6936..b255e22 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -49,18 +49,6 @@ if (CMAKE_COMPILER_IS_GNUCC) 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 () - endif () -endif () #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings @@ -74,10 +62,6 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) set (HDF5_WARNINGS_BLOCKED 1) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") - endif () endif () if (WIN32) add_definitions (-D_CRT_SECURE_NO_WARNINGS) @@ -91,9 +75,6 @@ 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 () @@ -119,8 +100,7 @@ if (NOT MSVC) # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) # warnings that are emitted. If you need it, add it at configure time. if (CMAKE_C_COMPILER_ID STREQUAL "Intel") - ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings-general") - message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general") list (APPEND H5_CFLAGS0 "-Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith") list (APPEND H5_CFLAGS0 "-Wreturn-type -Wstrict-prototypes -Wuninitialized") list (APPEND H5_CFLAGS0 "-Wunknown-pragmas -Wunused-function -Wunused-variable") @@ -132,18 +112,17 @@ if (NOT MSVC) endif() elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") - message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") # gcc automatically inlines based on the optimization level # this is just a failsafe list (APPEND H5_CFLAGS0 "-finline-functions") elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") - message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general") elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI") list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform") endif () + message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") endif () #----------------------------------------------------------------------------- @@ -287,17 +266,9 @@ if (HDF5_ENABLE_ALL_WARNINGS) if (HDF5_ENABLE_DEV_WARNINGS) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") list (APPEND HDF5_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}") - list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall /wd4668") - endif () else () string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") list (APPEND HDF5_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}") - list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3") - endif () endif () else () if (CMAKE_COMPILER_IS_GNUCC) @@ -315,10 +286,6 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}") list (APPEND HDF5_CMAKE_C_FLAGS "/W1") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") - list (APPEND HDF5_CMAKE_CXX_FLAGS "/W1") - endif () else () if (CMAKE_COMPILER_IS_GNUCC) list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0}) @@ -335,12 +302,10 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}") list (APPEND HDF5_CMAKE_C_FLAGS "/W2") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") - list (APPEND HDF5_CMAKE_CXX_FLAGS "/W2") - endif () else () - list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1}) + if (CMAKE_COMPILER_IS_GNUCC) + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1}) + endif () endif () endif () @@ -353,12 +318,10 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}") list (APPEND HDF5_CMAKE_C_FLAGS "/W3") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") - list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3") - endif () else () - list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2}) + if (CMAKE_COMPILER_IS_GNUCC) + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2}) + endif () endif () endif () @@ -371,12 +334,10 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}") list (APPEND HDF5_CMAKE_C_FLAGS "/W4") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") - list (APPEND HDF5_CMAKE_CXX_FLAGS "/W4") - endif () else () - list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3}) + if (CMAKE_COMPILER_IS_GNUCC) + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3}) + endif () endif () endif () @@ -387,7 +348,9 @@ 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) - list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4}) + if (CMAKE_COMPILER_IS_GNUCC) + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4}) + endif () endif () endif () @@ -398,9 +361,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 @@ -430,26 +390,12 @@ if (HDF5_ENABLE_SYMBOLS MATCHES "YES") elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fno-omit-frame-pointer") endif () - if(CMAKE_CXX_COMPILER_LOADED) - if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") - elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") - endif () - endif () elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO") if (CMAKE_C_COMPILER_ID STREQUAL "Intel") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-s") elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s") endif () - if(CMAKE_CXX_COMPILER_LOADED) - if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wl,-s") - elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") - endif () - endif () endif () MARK_AS_ADVANCED (HDF5_ENABLE_SYMBOLS) @@ -460,9 +406,6 @@ MARK_AS_ADVANCED (HDF5_ENABLE_SYMBOLS) option (HDF5_ENABLE_PROFILING "Enable profiling flags independently from the build mode." OFF) if (HDF5_ENABLE_PROFILING) list (APPEND HDF5_CMAKE_C_FLAGS "${PROFILE_CFLAGS}") - if(CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS "${PROFILE_CXXFLAGS}") - endif () endif () MARK_AS_ADVANCED (HDF5_ENABLE_PROFILING) @@ -473,8 +416,5 @@ MARK_AS_ADVANCED (HDF5_ENABLE_PROFILING) option (HDF5_ENABLE_OPTIMIZATION "Enable optimization flags/settings independently from the build mode" OFF) if (HDF5_ENABLE_OPTIMIZATION) list (APPEND HDF5_CMAKE_C_FLAGS "${OPTIMIZE_CFLAGS}") - if(CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS "${OPTIMIZE_CXXFLAGS}") - endif () 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..f31eba5 --- /dev/null +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -0,0 +1,142 @@ +# +# 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. +# + +macro (ADD_H5_FFLAGS h5_fflag_var infile) + file (STRINGS ${infile} TEST_FLAG_STREAM) + #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") + list (LENGTH TEST_FLAG_STREAM len_flag) + if (len_flag GREATER 0) + math (EXPR _FP_LEN "${len_flag} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET TEST_FLAG_STREAM ${line} str_flag) + string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") + #message (STATUS "str_flag=${str_flag}") + if (str_flag) + list (APPEND ${h5_fflag_var} "${str_flag}") + endif () + endforeach () + endif () + #message (STATUS "h5_fflag_var=${${h5_fflag_var}}") +endmacro () + +message (STATUS "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") + +#----------------------------------------------------------------------------- +# 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 +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# CDash is configured to only allow 3000 warnings, so +# break into groups (from the config/gnu-flags file) +#----------------------------------------------------------------------------- +if (NOT MSVC) + # 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" "-std=f2008" "-fimplicit-none") + elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-Mfreeform" "-Mdclchk" "-Mstandard" "-Mallocatable=03") + endif () + message (STATUS "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") + + if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") + # Append warning flags that only gcc 4.4+ knows about + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.4") + endif () + + # Append more extra warning flags that only gcc 4.5+ know about + if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.5) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.5") + endif () + + # Append more extra warning flags that only gcc 4.6+ know about + #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6) + # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.6") + #endif () + + # Append more extra warning flags that only gcc 4.7+ know about + if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.7) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.7") + endif () + + # Append more extra warning flags that only gcc 4.8+ know about + if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND 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+ know about + #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND 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.1+ know about + if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5") + endif () + + # Append more extra warning flags that only gcc 6.x+ know about + if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND 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+ know about + #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND 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+ know about + if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND 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+ know about + #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND 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 () +else () + if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") + #ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-ifort-general") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "/warn:all" "/stand:f03" "/free") + endif () +endif () + diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index ddc1e65..4945463 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -47,7 +47,7 @@ Languages: @BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @CMAKE_Fortran_COMPILER@ @CMAKE_Fortran_COMPILER_VERSION@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran 2003 Compiler: @HDF5_ENABLE_F2003@ @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@ diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index e0f2999..9ae38f6 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. @@ -17,33 +17,65 @@ # if the compiler is not GNU; otherwise `cxx_flags_set' is set to `yes' # +# +# For now, do not promote any warnings to errors. +# +PROMOTE_ERRORS_DFLT=no + +# +# This filter rewrites -Werror= as -W, in that way demoting warnings +# promoted to errors back to warnings, if PROMOTE_ERRORS is no. +# +demote_errors() +{ + if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then + sed 's,-Werror=,-W,g' + else + cat + fi +} + +# +# Prepend `$srcdir/config/gnu-warnings/` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_gnu_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | 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 + # 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.` @@ -53,10 +85,12 @@ if test X = "X$cxx_flags_set"; then 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,197 @@ case "$cxx_vendor-$cxx_version" in ;; esac - # Host-specific flags - case "`hostname`" in - sleipnir.ncsa.uiuc.edu) - arch="$arch -pipe" - ;; - esac - - # General (copied from H5_CFLAGS) - H5_CXXFLAGS="$H5_CXXFLAGS $arch -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wredundant-decls -Winline" - # C++-specific - H5_CXXFLAGS="$H5_CXXFLAGS -Wsign-promo -Woverloaded-virtual -Wold-style-cast -Weffc++ -Wreorder -Wnon-virtual-dtor -Wctor-dtor-privacy -Wabi" + H5_CXXFLAGS="$H5_CXXFLAGS $arch + + ############## + # Production # + ############## - # Production # NDEBUG is handled explicitly by the configure script - case "$cxx_vendor-$cxx_version" in - g++-[34].*) + if test $cxx_vers_major -le 4; then PROD_CXXFLAGS= - ;; - g++-[56].*) + else PROD_CXXFLAGS="-fstdarg-opt" - ;; - *) - PROD_CXXFLAGS="-finline-functions" - ;; - esac + fi + + ######### + # Debug # + ######### - # Debug # NDEBUG is handled explicitly by the configure script - # -g is hanled by the symbols flags - case "$cxx_vendor-$cxx_version" in - g++-[56].*) - DEBUG_CXXFLAGS="-ftrapv -fno-common" - ;; - *) + # -g is handled by the symbols flags + if test $cxx_vers_major -le 4; then DEBUG_CXXFLAGS= - ;; - esac + else + DEBUG_CXXFLAGS="-ftrapv -fno-common" + fi + + ########### + # 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]*) + ############ + # Warnings # + ############ - # Append warning flags from gcc-3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute" +# First load the C warnings then add CXX warnings (if needed) - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" + ########### + # General # + ########### - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2" + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments general)" + H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-general)" + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-general)" + #H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-cxx-general)" - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" + ###################### + # Developer warnings # + ###################### - # Append warning flags from gcc-3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" + NO_DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments no-developer-general) + DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments developer-general) - # Append warning flags from gcc-3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" + ####################### + # gcc 4 special cases # + ####################### - # 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" + # GCC 4.2 through 4.6 + 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_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.6)" + fi - # Append more extra warning flags that only gcc 4.9+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wdate-time -Wopenmp-simd" + # GCC 4.2 through 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_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.3)" + fi - # (There was no release of gcc 5.0) + # GCC 4.5 through 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_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5-4.6)" + fi - # Append more extra warning flags that only gcc 5.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Warray-bounds=2" - ;; + # GCC 4.2 through 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_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.4)" + fi - g++-4.9*) - # Append warning flags + # GCC 4.2 through the end of GCC 4 series + if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.last)" + fi - # 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" + ############################# + # Version-specific warnings # + ############################# - # Append warning flags from gcc-3.2* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" + # gcc >= 4.3 + if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.3)" + fi - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2" + # gcc >= 4.4 + if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.4)" + fi - # The "unreachable code" flag generates many spurious C++ warnings. - # We'll disable it for now. - #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code" + # gcc >= 4.5 + if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.5)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.5)" + fi - # Append warning flags from gcc 3.3* case - H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels" + # gcc >= 4.6 + if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 6; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.6)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.6)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.6)" + fi - # Append warning flags from gcc 3.4* case - H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch" + # gcc >= 4.7 + if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 7; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.7)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.7)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.7)" + fi - # Replace old -W flag with new -Wextra flag - H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" + # gcc >= 4.8 + if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.8)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.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 >= 4.9 + if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 9; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.9)" + fi - # Append more extra warning flags that only gcc 4.1+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations" + # gcc >= 5 + if test $cc_vers_major -ge 5; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 5)" + H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-5)" + fi - # Append more extra warning flags that only gcc 4.2+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow" + # gcc >= 6 + if test $cc_vers_major -ge 6; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 6)" + fi - # 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" + # gcc >= 7 + if test $cc_vers_major -ge 7; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 7)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-7)" + fi - # 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" + # gcc 8 + if test $cc_vers_major -ge 8; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 8)" + H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-8)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-8)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-8)" + fi - # Append more extra warning flags that only gcc 4.5+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5" + # gcc 9 + if test $cc_vers_major -ge 9; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 9)" + fi - # Append more extra warning flags that only gcc 4.6+ know about - H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" + ################# + # Flags are set # + ################# + cxx_flags_set=yes +fi - # 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" +# Version-specific g++ flags - # 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" - - # 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" - ;; - - 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'`" - - # 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" - ;; - - g++-4.0*) - # 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 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" - ;; - - g++-3.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" - - # 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 + -Wopenmp-simd" # 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 822b716..2859158 100644 --- a/config/gnu-fflags +++ b/config/gnu-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. @@ -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} | demote_errors + done) + IFS=' ' echo "$*" +} + # Get the compiler version in a way that works for GNU fortran # gfortran unless a compiler version is already known # @@ -25,9 +39,8 @@ # if test X = "X$f9x_flags_set"; then f9x_version="`$FC $FCFLAGS $H5_FCFLAGS -v 2>&1 |grep 'gcc version' |\ - sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`" + sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`" if test X != "X$f9x_version"; then -# is_mpi="`$FC $FCFLAGS $H5_FCFLAGS -help 2>&1 |grep 'link MPI'`" f9x_vendor=`echo $f9x_version |sed 's/\([a-z]*\).*/\1/'` f9x_version=`echo $f9x_version |sed 's/[-a-z]//g'` if test X = "X$f9x_vendor" -a X != "X$f9x_version"; then @@ -37,24 +50,36 @@ if test X = "X$f9x_flags_set"; then echo "compiler '$FC' is GNU $f9x_vendor-$f9x_version" fi - # Some version numbers + # Get the compiler version numbers f9x_vers_major=`echo $f9x_version | cut -f1 -d.` f9x_vers_minor=`echo $f9x_version | cut -f2 -d.` f9x_vers_patch=`echo $f9x_version | cut -f3 -d.` test -n "$f9x_vers_major" || f9x_vers_major=0 test -n "$f9x_vers_minor" || f9x_vers_minor=0 test -n "$f9x_vers_patch" || f9x_vers_patch=0 - f9x_vers_all=`expr $f9x_vers_major '*' 1000000 + $f9x_vers_minor '*' 1000 + $f9x_vers_patch` fi fi -# Common GNU flags for various situations if test "X-gfortran" = "X-$f9x_vendor"; then - # Insert section about version specific problems from gnu-flags here, if - # necessary. + + FC_BASENAME=gfortran + F9XSUFFIXFLAG="" + FSEARCH_DIRS="" + + # Need Fortran 2008 support for storage_size() in gcc 4.6 on + # (2008ts in some versions) + if test $f9x_vers_major -ge 8; then + H5_FCFLAGS="$H5_FCFLAGS -std=f2008" + elif test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 6; then + H5_FCFLAGS="$H5_FCFLAGS -std=f2008ts" + fi + + + ############################### + # Architecture-specific flags # + ############################### arch= - # Architecture-specific flags # Nothing currently. (Uncomment code below and modify to add any) #case "$host_os-$host_cpu" in # *-i686) @@ -62,30 +87,112 @@ if test "X-gfortran" = "X-$f9x_vendor"; then # ;; #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 + H5_FCFLAGS="$H5_FCFLAGS $arch" - # General - FC_BASENAME=gfortran40 - F9XSUFFIXFLAG="" - FSEARCH_DIRS="" - H5_FCFLAGS="$H5_FCFLAGS -pedantic -Wall -Wconversion -Wunderflow -Wimplicit-interface -W" + ############## + # Production # + ############## + + PROD_FCFLAGS= + + ######### + # Debug # + ######### + + if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 5; then + DEBUG_FCFLAGS="-fcheck=all" + else + DEBUG_FCFLAGS="-fbounds-check" + fi + + ########### + # Symbols # + ########### + + NO_SYMBOLS_FCFLAGS="-s" + SYMBOLS_FCFLAGS="-g" + + ############# + # Profiling # + ############# + + PROFILE_FCFLAGS="-pg" - # Production - PROD_FCFLAGS="-O2 -s" + ################ + # Optimization # + ################ - # Debug - DEBUG_FCFLAGS="-g -fbounds-check" + if test $f9x_vers_major -le 4; then + HIGH_OPT_FCFLAGS="-O3" + DEBUG_OPT_FCFLAGS= + else + HIGH_OPT_FCFLAGS="-O3" + DEBUG_OPT_FCFLAGS="-Og" + fi + NO_OPT_FCFLAGS="-O0" + + ############ + # Warnings # + ############ + + ########### + # General # + ########### + + H5_FCFLAGS="$H5_CFLAGS $(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 $(load_gnu_arguments gfort-4.4)" + 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 $(load_gnu_arguments gfort-4.5)" + 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 $(load_gnu_arguments gfort-4.7)" + fi + + # 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 $(load_gnu_arguments gfort-4.8)" + fi + + # gfortran 4.9 (nothing new) + + # gfortran >= 5 + if test $f9x_vers_major -ge 5; then + H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-5)" + fi + + # gfortran >= 6 + if test $f9x_vers_major -ge 6; then + H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-6)" + fi + + # gfortran 7 (nothing new) + + # gfortran >= 8 + if test $f9x_vers_major -ge 8; then + H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-8)" + fi - # Profile - PROFILE_FCFLAGS="-g -pg" + # gfortran 9 (nothing new) - # Flags are set + ################# + # Flags are set # + ################# f9x_flags_set=yes fi diff --git a/config/gnu-flags b/config/gnu-flags index 2b11d8f..c2904fe 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -28,20 +28,20 @@ PROMOTE_ERRORS_DFLT=no # demote_errors() { - if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then - sed 's,-Werror=,-W,g' - else - cat - fi + if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then + sed 's,-Werror=,-W,g' + else + cat + fi } # -# Prepend `$srcdir/config/gnu-` to the filename suffix(es) given as +# Prepend `$srcdir/config/gnu-warnings/` to the filename suffix(es) given as # subroutine argument(s), remove comments starting with # and ending # at EOL, replace spans of whitespace (including newlines) with spaces, # and re-emit the file(s) thus filtered on the standard output stream. # -load_gcc_arguments() +load_gnu_arguments() { set -- $(for arg; do sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | demote_errors @@ -49,7 +49,6 @@ load_gcc_arguments() IFS=' ' echo "$*" } - # Get the compiler version in a way that works for gcc # unless a compiler version is already known # @@ -65,7 +64,7 @@ if test "X-" = "X-$cc_flags_set"; then # 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'` @@ -83,12 +82,9 @@ if test "X-" = "X-$cc_flags_set"; then 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 - cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch` fi -# Common GCC flags for various situations -case "$cc_vendor-$cc_version" in - gcc*) +if test "X-gcc" = "X-$cc_vendor"; then ############################### # Architecture-specific flags # @@ -133,7 +129,6 @@ case "$cc_vendor-$cc_version" in ;; esac - # General H5_CFLAGS="$H5_CFLAGS $arch" ############## @@ -146,7 +141,6 @@ case "$cc_vendor-$cc_version" in else PROD_CFLAGS="-fstdarg-opt" fi - PROD_CPPFLAGS= ######### # Debug # @@ -159,201 +153,50 @@ case "$cc_vendor-$cc_version" in else DEBUG_CFLAGS="-ftrapv -fno-common" fi - DEBUG_CPPFLAGS= + + ########### + # Symbols # + ########### + + NO_SYMBOLS_CFLAGS="-s" + SYMBOLS_CFLAGS="-g -fno-omit-frame-pointer" ############# # Profiling # ############# PROFILE_CFLAGS="-pg" - PROFILE_CPPFLAGS= - ;; -esac + + ################ + # Optimization # + ################ + + if test $cc_vers_major -le 4; then + HIGH_OPT_CFLAGS="-O3" + DEBUG_OPT_CFLAGS= + else + HIGH_OPT_CFLAGS="-O3" + DEBUG_OPT_CFLAGS="-Og" + fi + NO_OPT_CFLAGS="-O0" ############ # Warnings # ############ -# Version specific GCC flags -# -case "$cc_vendor-$cc_version" in - # older compiler versions - gcc-4.1.*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var" - ;; - - gcc-4.0*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - ;; - - gcc-3.4*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append more extra warning flags that only gcc3.4+ know about - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - ;; - - gcc-3.3*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - - # Append more extra warning flags that only gcc3.3+ know about - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - ;; - - gcc-3.2*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append more extra warning flags that only gcc3.2+ know about - H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - ;; - - gcc-3*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -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_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - ;; - - gcc-*) - ########### # General # ########### - H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments general)" - H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-general)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)" + H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)" ###################### # Developer warnings # ###################### - NO_DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments no-developer-general) - DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments developer-general) + NO_DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments no-developer-general) + DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments developer-general) ####################### # gcc 4 special cases # @@ -361,27 +204,27 @@ case "$cc_vendor-$cc_version" in # GCC 4.2 through 4.6 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 $(load_gcc_arguments 4.2-4.6)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.6)" fi # GCC 4.2 through 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 $(load_gcc_arguments 4.2-4.3)" - fi + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.3)" + fi # GCC 4.5 through 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 $(load_gcc_arguments 4.5-4.6)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.5-4.6)" fi # GCC 4.2 through 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 $(load_gcc_arguments 4.2-4.4)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.4)" fi # GCC 4.2 through the end of GCC 4 series if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then - H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.last)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.last)" fi ############################# @@ -390,86 +233,86 @@ case "$cc_vendor-$cc_version" in # 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 $(load_gcc_arguments 4.3)" - fi + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.3)" + 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 $(load_gcc_arguments 4.4)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.4)" 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 $(load_gcc_arguments 4.5)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.5)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.5)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.5)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.5)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.5)" 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 $(load_gcc_arguments 4.6)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.6)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.6)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.6)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.6)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.6)" 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 $(load_gcc_arguments 4.7)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.7)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.7)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.7)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.7)" fi # gcc >= 4.8 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then - H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.8)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.8)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.8)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.8)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.8)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.8)" fi # 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 $(load_gcc_arguments 4.9)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.9)" fi # gcc >= 5 if test $cc_vers_major -ge 5; then - H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 5)" - H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-5)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 5)" + H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-5)" fi # gcc >= 6 if test $cc_vers_major -ge 6; then - H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 6)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 6)" fi # gcc >= 7 if test $cc_vers_major -ge 7; then - H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 7)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-7)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-7)" fi # gcc 8 if test $cc_vers_major -ge 8; then - H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 8)" - H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-8)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-8)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-8)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 8)" + H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-8)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-8)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-8)" fi # gcc 9 if test $cc_vers_major -ge 9; then - H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 9)" + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 9)" fi - ;; -esac ################# # 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/gnu-warnings/cxx-general b/config/gnu-warnings/cxx-general new file mode 100644 index 0000000..ee7ee22 --- /dev/null +++ b/config/gnu-warnings/cxx-general @@ -0,0 +1,19 @@ +# 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. +-Wabi +-Wctor-dtor-privacy +-Weffc++ +##-Wendif-labels +-Wnon-virtual-dtor +-Wold-style-cast +-Woverloaded-virtual +-Wreorder +-Wsign-promo +##-Wunreachable-code +##-Wvariadic-macros diff --git a/config/gnu-warnings/gfort-4.4 b/config/gnu-warnings/gfort-4.4 new file mode 100644 index 0000000..59fe9a2 --- /dev/null +++ b/config/gnu-warnings/gfort-4.4 @@ -0,0 +1,2 @@ +-Warray-temporaries +-Wintrinsics-std \ No newline at end of file diff --git a/config/gnu-warnings/gfort-4.5 b/config/gnu-warnings/gfort-4.5 new file mode 100644 index 0000000..4490d4e --- /dev/null +++ b/config/gnu-warnings/gfort-4.5 @@ -0,0 +1 @@ +-Wimplicit-procedure diff --git a/config/gnu-warnings/gfort-4.7 b/config/gnu-warnings/gfort-4.7 new file mode 100644 index 0000000..a7532bb --- /dev/null +++ b/config/gnu-warnings/gfort-4.7 @@ -0,0 +1,2 @@ +-Wreal-q-constant +-Wfunction-elimination diff --git a/config/gnu-warnings/gfort-4.8 b/config/gnu-warnings/gfort-4.8 new file mode 100644 index 0000000..1b96a51 --- /dev/null +++ b/config/gnu-warnings/gfort-4.8 @@ -0,0 +1,5 @@ +-Wrealloc-lhs +-Wrealloc-lhs-all +# Turn off warnings for passing non-ANSI types to BIND(). +# We pass a lot of hid_t, etc. types so this generates a LOT of spurious warnings. +-Wno-c-binding-type diff --git a/config/gnu-warnings/gfort-5 b/config/gnu-warnings/gfort-5 new file mode 100644 index 0000000..c5d3850 --- /dev/null +++ b/config/gnu-warnings/gfort-5 @@ -0,0 +1 @@ +-Wuse-without-only diff --git a/config/gnu-warnings/gfort-6 b/config/gnu-warnings/gfort-6 new file mode 100644 index 0000000..f70466c --- /dev/null +++ b/config/gnu-warnings/gfort-6 @@ -0,0 +1 @@ +-Winteger-division diff --git a/config/gnu-warnings/gfort-8 b/config/gnu-warnings/gfort-8 new file mode 100644 index 0000000..5097365 --- /dev/null +++ b/config/gnu-warnings/gfort-8 @@ -0,0 +1 @@ +-Wfrontend-loop-interchange diff --git a/config/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/intel-fflags b/config/intel-fflags index 5fbdcc1..ed7ee52 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. @@ -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 # @@ -44,8 +58,8 @@ 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. + # Insert section about version specific problems from compiler flags here, + # if necessary. arch= # Architecture-specific flags @@ -68,19 +82,31 @@ if test "X-ifort" = "X-$f9x_vendor"; then FC_BASENAME=ifort F9XSUFFIXFLAG="" FSEARCH_DIRS="" - H5_FCFLAGS="$H5_FCFLAGS" + H5_FCFLAGS="$H5_FCFLAGS -stand:f03 -free" + H5_FCFLAGS="$H5_FCFLAGS $(load_intel_arguments ifort-general)" # Production - PROD_FCFLAGS="-O3" + PROD_FCFLAGS= # Debug - DEBUG_FCFLAGS="-g -check all" + DEBUG_FCFLAGS="-check all" - # Profile + # Symbols + SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS= + + # Profiling # Use this for profiling with gprof - PROFILE_FCFLAGS="-g -p" + PROFILE_FCFLAGS="-p" + + # Optimization + HIGH_OPT_FCFLAGS="-O3" + DEBUG_OPT_FCFLAGS= + NO_OPT_FCFLAGS= - # Flags are set + ################# + # Flags are set # + ################# f9x_flags_set=yes fi diff --git a/config/intel-flags b/config/intel-flags index 139ea49..100e68a 100644 --- a/config/intel-flags +++ b/config/intel-flags @@ -18,7 +18,7 @@ # # -# Prepend `$srcdir/config/intel-` to the filename suffix(es) given as +# Prepend `$srcdir/config/intel-warnings/` to the filename suffix(es) given as # subroutine argument(s), remove comments starting with # and ending # at EOL, replace spans of whitespace (including newlines) with spaces, # and re-emit the file(s) thus filtered on the standard output stream. @@ -26,7 +26,7 @@ load_intel_arguments() { set -- $(for arg; do - sed 's,#.*$,,' $srcdir/config/intel-${arg} + sed 's,#.*$,,' $srcdir/config/intel-warnings/${arg} done) IFS=' ' echo "$*" } @@ -81,49 +81,63 @@ if test "X-icc" = "X-$cc_vendor"; then # General # Default to C99 standard. H5_CFLAGS="$H5_CFLAGS $arch -std=c99" - H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments warnings-general)" - # Production is set to default; see settings for specific version further down - PROD_CFLAGS="-O" - PROD_CPPFLAGS= + # Production + PROD_CFLAGS= # Debug - DEBUG_CFLAGS="-Wcheck -Wall -g -O0" - DEBUG_CPPFLAGS= + # NDEBUG is handled explicitly in configure + DEBUG_CFLAGS= - # Profile + # Symbols + SYMBOLS_CFLAGS="-g" + NO_SYMBOLS_CFLAGS="-Wl,-s" + + # Profiling # Use this for profiling with gprof - PROFILE_CFLAGS="-g -p" - PROFILE_CPPFLAGS= + PROFILE_CFLAGS="-p" - # Flags are set - cc_flags_set=yes + # Optimization + HIGH_OPT_CFLAGS="-O3" + DEBUG_OPT_CFLAGS="-O0" + NO_OPT_CFLAGS="-O0" -fi + ############ + # Warnings # + ############ + + ########### + # General # + ########### + + H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments general)" + + ############################# + # Version-specific warnings # + ############################# -# 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*) - PROD_CFLAGS="-O1 -Wl,-s" + HIGH_OPT_CFLAGS="-O1" ;; icc-8.0*) - # v8.0 -O3 infinite loops when compiling test/tselect.c. Use -O2. - PROD_CFLAGS="-O2 -Wl,-s" - ;; + # v8.0 -O3 infinite loops when compiling test/tselect.c. Use -O2. + HIGH_OPT_CFLAGS="-O2" + ;; icc-*) - # -s became obsolete; we also fixed bugs that allow us to enable higher level - # of optimization starting with 1.8.7 - PROD_CFLAGS="-O3" ;; esac + ################# + # 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= diff --git a/config/intel-warnings-general b/config/intel-warnings-general deleted file mode 100644 index f4ed24c..0000000 --- a/config/intel-warnings-general +++ /dev/null @@ -1,10 +0,0 @@ -# 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 --Wcheck \ No newline at end of file diff --git a/config/intel-warnings/general b/config/intel-warnings/general new file mode 100644 index 0000000..d0b2e25 --- /dev/null +++ b/config/intel-warnings/general @@ -0,0 +1,2 @@ +-Wall +-Wcheck \ No newline at end of file diff --git a/config/intel-warnings/ifort-general b/config/intel-warnings/ifort-general new file mode 100644 index 0000000..a9da0e5 --- /dev/null +++ b/config/intel-warnings/ifort-general @@ -0,0 +1 @@ +-warn:all diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index aa702ff..02a71c3 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -35,28 +35,22 @@ set (F2003_examples foreach (example ${examples}) add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - target_compile_options(f90_ex_${example} - PRIVATE - $<$:${WIN_COMPILE_FLAGS}> - ) -# set_property(TARGET f90_ex_${example} APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET f90_ex_${example} APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -# ) + target_compile_options(f90_ex_${example} PRIVATE $<$:${WIN_COMPILE_FLAGS}>) +# set_property(TARGET f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET f90_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() if (NOT BUILD_SHARED_LIBS) target_include_directories (f90_ex_${example} PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static" - ) - target_link_libraries (f90_ex_${example} - PRIVATE - ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} + "${CMAKE_Fortran_MODULE_DIRECTORY}/static" + "${HDF5_SRC_DIR}" + "${HDF5_BINARY_DIR}" + "${HDF5_F90_BINARY_DIR}" + "${HDF5_F90_BINARY_DIR}/static" ) + target_link_libraries (f90_ex_${example} PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran @@ -65,12 +59,13 @@ foreach (example ${examples}) else () target_include_directories (f90_ex_${example} PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared" - ) - target_link_libraries (f90_ex_${example} - PRIVATE - ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} + "${CMAKE_Fortran_MODULE_DIRECTORY}/shared" + "${HDF5_SRC_DIR}" + "${HDF5_BINARY_DIR}" + "${HDF5_F90_BINARY_DIR}" + "${HDF5_F90_BINARY_DIR}/shared" ) + target_link_libraries (f90_ex_${example} PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran @@ -81,28 +76,22 @@ endforeach () foreach (example ${F2003_examples}) add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - target_compile_options(f03_ex_${example} - PRIVATE - $<$:${WIN_COMPILE_FLAGS}> - ) -# set_property(TARGET f03_ex_${example} APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET f03_ex_${example} APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -# ) + target_compile_options(f03_ex_${example} PRIVATE $<$:${WIN_COMPILE_FLAGS}>) +# set_property(TARGET f03_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET f03_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET f03_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() if (NOT ONLY_SHARED_LIBS) target_include_directories (f03_ex_${example} PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static" - ) - target_link_libraries (f03_ex_${example} - PRIVATE - ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} + "${CMAKE_Fortran_MODULE_DIRECTORY}/static" + "${HDF5_SRC_DIR}" + "${HDF5_BINARY_DIR}" + "${HDF5_F90_BINARY_DIR}" + "${HDF5_F90_BINARY_DIR}/static" ) + target_link_libraries (f03_ex_${example} PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran03 @@ -111,12 +100,13 @@ foreach (example ${F2003_examples}) else () target_include_directories (f03_ex_${example} PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared" - ) - target_link_libraries (f03_ex_${example} - PRIVATE - ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} + "${CMAKE_Fortran_MODULE_DIRECTORY}/shared" + "${HDF5_SRC_DIR}" + "${HDF5_BINARY_DIR}" + "${HDF5_F90_BINARY_DIR}" + "${HDF5_F90_BINARY_DIR}/shared" ) + target_link_libraries (f03_ex_${example} PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran03 @@ -127,27 +117,26 @@ endforeach () if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) - target_compile_options(f90_ex_ph5example - PRIVATE - $<$:${WIN_COMPILE_FLAGS}> - ) -# set_property(TARGET f90_ex_ph5example APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET f90_ex_ph5example APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -# ) + target_compile_options(f90_ex_ph5example PRIVATE $<$:${WIN_COMPILE_FLAGS}>) +# set_property(TARGET f90_ex_ph5example APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET f90_ex_ph5example APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET f90_ex_ph5example PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() if (NOT ONLY_SHARED_LIBS) target_include_directories (f90_ex_ph5example PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_Fortran_INCLUDE_DIRS}>" + "${CMAKE_Fortran_MODULE_DIRECTORY}/static" + "${HDF5_SRC_DIR}" + "${HDF5_BINARY_DIR}" + "${HDF5_F90_BINARY_DIR}" + "${HDF5_F90_BINARY_DIR}/static" + "$<$:${MPI_Fortran_INCLUDE_DIRS}>" ) target_link_libraries (f90_ex_ph5example PRIVATE - ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} $<$:${MPI_Fortran_LIBRARIES}> ) set_target_properties (f90_ex_ph5example PROPERTIES @@ -158,11 +147,17 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) else () target_include_directories (f90_ex_ph5example PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_Fortran_INCLUDE_DIRS}>" + "${CMAKE_Fortran_MODULE_DIRECTORY}/shared" + "${HDF5_SRC_DIR}" + "${HDF5_BINARY_DIR}" + "${HDF5_F90_BINARY_DIR}" + "${HDF5_F90_BINARY_DIR}/shared" + "$<$:${MPI_Fortran_INCLUDE_DIRS}>" ) target_link_libraries (f90_ex_ph5example PRIVATE - ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} + ${HDF5_F90_LIBSH_TARGET} + ${HDF5_LIBSH_TARGET} $<$:${MPI_Fortran_LIBRARIES}> ) set_target_properties (f90_ex_ph5example PROPERTIES diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index a5baa10..c2b4ed7 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -69,22 +69,14 @@ add_custom_command ( ) #----------------------------------------------------------------------------- add_executable (H5fortran_detect ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90) -target_include_directories(H5fortran_detect - PRIVATE - "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}" -) +target_include_directories(H5fortran_detect PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}") #if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -# target_compile_definitions(H5fortran_detect -# PRIVATE -# $<$:/MT> -# ) +# target_compile_definitions(H5fortran_detect PRIVATE $<$:/MT>) #endif () if(MSVC) set_property(TARGET H5fortran_detect PROPERTY COMPILE_FLAGS "/MT") endif() -#set_property(TARGET H5fortran_detect APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -#) +#set_property(TARGET H5fortran_detect APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) if(MSVC) set_property(TARGET H5fortran_detect PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE") endif() @@ -169,16 +161,22 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ) endif () +set (f90CStub_C_HDRS + # generated files + ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h +) +set (f90CStub_C_SHHDRS + # generated files + ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h +) + if (NOT ONLY_SHARED_LIBS) - set (f90CStub_C_HDRS - # generated files - ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h - ) add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) target_include_directories (${HDF5_F90_C_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_F90_C_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC) target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") @@ -191,18 +189,13 @@ if (NOT ONLY_SHARED_LIBS) endif () if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - set (f90CStub_C_SHHDRS - # generated files - ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h - ) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS}) target_include_directories (${HDF5_F90_C_LIBSH_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) - target_compile_definitions(${HDF5_F90_C_LIBSH_TARGET} - PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" - ) + target_compile_options(${HDF5_F90_C_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") + target_compile_definitions(${HDF5_F90_C_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB") TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIBSH_TARGET}") @@ -310,29 +303,23 @@ endif () if (NOT ONLY_SHARED_LIBS) add_library (${HDF5_F90_LIB_TARGET} STATIC ${f90_F_SRCS}) target_include_directories (${HDF5_F90_LIB_TARGET} - PRIVATE - "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};$<$:${MPI_Fortran_INCLUDE_DIRS}>" - INTERFACE - "$/include/static>" + PRIVATE "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};$<$:${MPI_Fortran_INCLUDE_DIRS}>" + INTERFACE "$/include/static>" ) + target_compile_options(${HDF5_F90_LIB_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}") target_compile_definitions(${HDF5_F90_LIB_TARGET} PRIVATE $<$:HDF5F90_WINDOWS> $<$:${WIN_COMPILE_FLAGS}> ) target_link_libraries (${HDF5_F90_LIB_TARGET} - PUBLIC - ${HDF5_F90_C_LIB_TARGET} + PUBLIC ${HDF5_F90_C_LIB_TARGET} PRIVATE ${LINK_Fortran_LIBS} $<$:${MPI_Fortran_LIBRARIES}> ) -# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -# ) +# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET ${HDF5_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -349,36 +336,24 @@ endif () if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SRCS_SHARED}) target_include_directories (${HDF5_F90_LIBSH_TARGET} - PRIVATE - "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};$<$:${MPI_Fortran_INCLUDE_DIRS}>" - INTERFACE - "$/include/shared>" + PRIVATE "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};$<$:${MPI_Fortran_INCLUDE_DIRS}>" + INTERFACE "$/include/shared>" ) + target_compile_options(${HDF5_F90_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}") target_compile_definitions(${HDF5_F90_LIBSH_TARGET} - PUBLIC - "H5_BUILT_AS_DYNAMIC_LIB" + PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" PRIVATE $<$:BUILD_HDF5_DLL;HDF5F90_WINDOWS> $<$:${WIN_COMPILE_FLAGS}> ) target_link_libraries (${HDF5_F90_LIBSH_TARGET} - PUBLIC - ${HDF5_F90_C_LIBSH_TARGET} - PRIVATE - ${LINK_Fortran_LIBS} $<$:${MPI_Fortran_LIBRARIES}> + PUBLIC ${HDF5_F90_C_LIBSH_TARGET} + PRIVATE ${LINK_Fortran_LIBS} $<$:${MPI_Fortran_LIBRARIES}> ) -# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -# ) -# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:"-DLL"> -# ) -# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:"-DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def"> -# ) +# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-DLL">) +# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def">) if(MSVC) set_property(TARGET ${HDF5_F90_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} /DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") endif() diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 73ddf07..211190f 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -21,9 +21,8 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) - target_compile_definitions(${HDF5_F90_C_TEST_LIBSH_TARGET} - PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" - ) + target_compile_options(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") + target_compile_definitions(${HDF5_F90_C_TEST_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB") TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE ${HDF5_F90_C_LIBSH_TARGET} @@ -41,6 +40,7 @@ else () PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC) target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE ${HDF5_F90_C_LIB_TARGET} @@ -79,31 +79,20 @@ endif () if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) target_include_directories (${HDF5_F90_TEST_LIBSH_TARGET} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared" - INTERFACE - "$/include/shared>" + PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared" + INTERFACE "$/include/shared>" ) + target_compile_options(${HDF5_F90_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}") target_compile_definitions(${HDF5_F90_TEST_LIBSH_TARGET} - PUBLIC - "H5_BUILT_AS_DYNAMIC_LIB" + PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" PRIVATE $<$:BUILD_HDF5_TEST_DLL;HDF5F90_WINDOWS> $<$:${WIN_COMPILE_FLAGS}> ) - target_link_libraries (${HDF5_F90_TEST_LIBSH_TARGET} - PUBLIC - ${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} - ) -# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -# ) -# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:"-DLL"> -# ) + target_link_libraries (${HDF5_F90_TEST_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) +# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-DLL">) if(MSVC) set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} -DLL") endif() @@ -115,26 +104,18 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_TEST_LIB_NAME} SHARED "F") else () target_include_directories (${HDF5_F90_TEST_LIB_TARGET} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static" - INTERFACE - "$/include/static>" + PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static" + INTERFACE "$/include/static>" ) + target_compile_options(${HDF5_F90_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}") target_compile_definitions(${HDF5_F90_TEST_LIB_TARGET} PRIVATE $<$:HDF5F90_WINDOWS> $<$:${WIN_COMPILE_FLAGS}> ) - target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} - PUBLIC - ${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} - ) -# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -# ) + target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} PUBLIC ${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}) +# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -170,26 +151,17 @@ add_executable (testhdf5_fortran ) target_compile_options(testhdf5_fortran PRIVATE + "${HDF5_CMAKE_Fortran_FLAGS}" $<$:${WIN_COMPILE_FLAGS}> ) -#set_property(TARGET testhdf5_fortran APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -#) -#set_property(TARGET testhdf5_fortran APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -#) +#set_property(TARGET testhdf5_fortran APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +#set_property(TARGET testhdf5_fortran APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET testhdf5_fortran PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - target_include_directories (testhdf5_fortran - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared" - ) - target_link_libraries (testhdf5_fortran - PRIVATE - ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib> - ) + target_include_directories (testhdf5_fortran PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") + target_link_libraries (testhdf5_fortran PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib>) set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -197,14 +169,8 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIBSH_TARGET}) else () - target_include_directories (testhdf5_fortran - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static" - ) - target_link_libraries (testhdf5_fortran - PRIVATE - ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib> - ) + target_include_directories (testhdf5_fortran PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") + target_link_libraries (testhdf5_fortran PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib>) set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -224,26 +190,17 @@ add_executable (testhdf5_fortran_1_8 ) target_compile_options(testhdf5_fortran_1_8 PRIVATE + "${HDF5_CMAKE_Fortran_FLAGS}" $<$:${WIN_COMPILE_FLAGS}> ) -#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -#) -#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -#) +#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET testhdf5_fortran_1_8 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - target_include_directories (testhdf5_fortran_1_8 - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared" - ) - target_link_libraries (testhdf5_fortran_1_8 - PRIVATE - ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib> - ) + target_include_directories (testhdf5_fortran_1_8 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") + target_link_libraries (testhdf5_fortran_1_8 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib>) set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -251,14 +208,8 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIBSH_TARGET}) else () - target_include_directories (testhdf5_fortran_1_8 - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static" - ) - target_link_libraries (testhdf5_fortran_1_8 - PRIVATE - ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib> - ) + target_include_directories (testhdf5_fortran_1_8 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") + target_link_libraries (testhdf5_fortran_1_8 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib>) set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -281,26 +232,17 @@ if (HDF5_ENABLE_F2003) ) target_compile_options(fortranlib_test_F03 PRIVATE + "${HDF5_CMAKE_Fortran_FLAGS}" $<$:${WIN_COMPILE_FLAGS}> ) -# set_property(TARGET fortranlib_test_F03 APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET fortranlib_test_F03 APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -# ) +#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET fortranlib_test_F03 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - target_include_directories (fortranlib_test_F03 - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared" - ) - target_link_libraries (fortranlib_test_F03 - PRIVATE - ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib> - ) + target_include_directories (fortranlib_test_F03 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") + target_link_libraries (fortranlib_test_F03 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib>) set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -308,14 +250,8 @@ if (HDF5_ENABLE_F2003) ) add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIBSH_TARGET}) else () - target_include_directories (fortranlib_test_F03 - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static" - ) - target_link_libraries (fortranlib_test_F03 - PRIVATE - ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib> - ) + target_include_directories (fortranlib_test_F03 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") + target_link_libraries (fortranlib_test_F03 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib>) set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -329,26 +265,17 @@ endif () add_executable (fflush1 fflush1.f90) target_compile_options(fflush1 PRIVATE + "${HDF5_CMAKE_Fortran_FLAGS}" $<$:${WIN_COMPILE_FLAGS}> ) -#set_property(TARGET fflush1 APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -#) -#set_property(TARGET fflush1 APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -#) +#set_property(TARGET fflush1 APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +#set_property(TARGET fflush1 APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET fflush1 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - target_include_directories (fflush1 - PRIVATE - ${CMAKE_Fortran_MODULE_DIRECTORY}/shared - ) - target_link_libraries (fflush1 - PRIVATE - ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib> - ) + target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib>) set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -356,14 +283,8 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) add_dependencies (fflush1 ${HDF5_F90_TEST_LIBSH_TARGET}) else () - target_include_directories (fflush1 - PRIVATE - ${CMAKE_Fortran_MODULE_DIRECTORY}/static - ) - target_link_libraries (fflush1 - PRIVATE - ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib> - ) + target_include_directories (fflush1 PRIVATE${CMAKE_Fortran_MODULE_DIRECTORY}/static) + target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib>) set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -376,26 +297,17 @@ endif () add_executable (fflush2 fflush2.f90) target_compile_options (fflush2 PRIVATE + "${HDF5_CMAKE_Fortran_FLAGS}" $<$:${WIN_COMPILE_FLAGS}> ) -#set_property(TARGET fflush2 APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -#) -#set_property(TARGET fflush2 APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -#) +#set_property(TARGET fflush2 APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +#set_property(TARGET fflush2 APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET fflush2 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - target_include_directories (fflush2 - PRIVATE - ${CMAKE_Fortran_MODULE_DIRECTORY}/shared - ) - target_link_libraries (fflush2 - PRIVATE - ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib> - ) + target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + target_link_libraries (fflush2 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib>) set_target_properties (fflush2 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -403,14 +315,8 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) add_dependencies (fflush2 ${HDF5_F90_TEST_LIBSH_TARGET}) else () - target_include_directories (fflush2 - PRIVATE - ${CMAKE_Fortran_MODULE_DIRECTORY}/static - ) - target_link_libraries (fflush2 - PRIVATE - ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib> - ) + target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + target_link_libraries (fflush2 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib>) set_target_properties (fflush2 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran diff --git a/fortran/test/tH5T_F03.f90 b/fortran/test/tH5T_F03.f90 index 99e478f..d3573b4 100644 --- a/fortran/test/tH5T_F03.f90 +++ b/fortran/test/tH5T_F03.f90 @@ -1541,7 +1541,7 @@ SUBROUTINE t_bit(total_error) INTEGER :: A, B, C, D INTEGER :: Aw, Bw, Cw, Dw INTEGER :: i, j - INTEGER, PARAMETER :: hex = Z'00000003' + INTEGER, PARAMETER :: hex = INT(Z'00000003') TYPE(C_PTR) :: f_ptr INTEGER :: error ! Error flag ! diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index dc07d45..12489528 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -4,13 +4,12 @@ project (HDF5_FORTRAN_TESTPAR C Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -set (TESTPAR_INCLUDES ${MPI_Fortran_INCLUDE_DIRS}) +set (TESTPAR_INCLUDES ${MPI_Fortran_INCLUDE_DIRS} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src)) if (NOT BUILD_SHARED_LIBS) set (TESTPAR_INCLUDES ${TESTPAR_INCLUDES} ${CMAKE_Fortran_MODULE_DIRECTORY}/static) else () set (TESTPAR_INCLUDES ${TESTPAR_INCLUDES} ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) endif () -set (TESTPAR_INCLUDES ${TESTPAR_INCLUDES} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Add Tests @@ -23,11 +22,11 @@ add_executable (parallel_test mdset.f90 ) target_include_directories (parallel_test - PRIVATE - ${TESTPAR_INCLUDES} + PRIVATE ${TESTPAR_INCLUDES} ) target_compile_options(parallel_test PRIVATE + "${HDF5_CMAKE_Fortran_FLAGS}" $<$:${WIN_COMPILE_FLAGS}> ) if (NOT BUILD_SHARED_LIBS) @@ -54,12 +53,8 @@ else () ) endif () -#set_property(TARGET parallel_test APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -#) -#set_property(TARGET parallel_test APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -#) +#set_property(TARGET parallel_test APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +#set_property(TARGET parallel_test APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET parallel_test PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 121c0a8..fbabc86 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -14,6 +14,7 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_HL_CPP_LIB_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} STATIC) target_link_libraries (${HDF5_HL_CPP_LIB_TARGET} PUBLIC ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") @@ -28,12 +29,8 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) - target_compile_options(${HDF5_HL_CPP_LIBSH_TARGET} - PRIVATE "${HDF5_CMAKE_CXX_FLAGS}" - ) - target_compile_definitions(${HDF5_HL_CPP_LIBSH_TARGET} - PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" - ) + target_compile_options(${HDF5_HL_CPP_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") + target_compile_definitions(${HDF5_HL_CPP_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB") TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_HL_CPP_LIBSH_TARGET} PUBLIC ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIBSH_TARGET}") diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 9bf32ef..5c224a8 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required (VERSION 3.12) project (HDF5_HL_CPP_TEST CXX) add_executable (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) +target_compile_options(hl_ptableTest PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") target_include_directories (hl_ptableTest PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_ptableTest STATIC) diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index b671baa..75791d3 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -12,38 +12,22 @@ foreach (example ${examples}) PRIVATE $<$:${WIN_COMPILE_FLAGS}> ) -# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -# ) +# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET hl_f90_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - target_include_directories (hl_f90_ex_${example} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" - ) - target_link_libraries (hl_f90_ex_${example} - PRIVATE - ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} - ) + target_include_directories (hl_f90_ex_${example} PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") + target_link_libraries (hl_f90_ex_${example} PRIVATE ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) else () - target_include_directories (hl_f90_ex_${example} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" - ) - target_link_libraries (hl_f90_ex_${example} - PRIVATE - ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} - ) + target_include_directories (hl_f90_ex_${example} PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") + target_link_libraries (hl_f90_ex_${example} PRIVATE ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/hl/fortran diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 792d03f..28cce63 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -30,6 +30,7 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_HL_F90_C_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC) target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") @@ -46,9 +47,8 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) - target_compile_definitions(${HDF5_LIBSH_TARGET} - PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" - ) + target_compile_options(${HDF5_HL_F90_C_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") + target_compile_definitions(${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB") TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}") @@ -74,27 +74,17 @@ set_source_files_properties (${HDF5_HL_F90_F_SRCS} PROPERTIES LANGUAGE Fortran) if (NOT ONLY_SHARED_LIBS) add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SRCS}) target_include_directories (${HDF5_HL_F90_LIB_TARGET} - PRIVATE - "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;$<$:${MPI_Fortran_INCLUDE_DIRS}>" - INTERFACE - "$/include/static>" + PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;$<$:${MPI_Fortran_INCLUDE_DIRS}>" + INTERFACE "$/include/static>" ) + target_compile_options(${HDF5_HL_F90_LIB_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}") target_compile_definitions(${HDF5_HL_F90_LIB_TARGET} - PUBLIC - $<$:HDF5F90_WINDOWS> - PRIVATE - $<$:${WIN_COMPILE_FLAGS}> + PUBLIC $<$:HDF5F90_WINDOWS> + PRIVATE $<$:${WIN_COMPILE_FLAGS}> ) - target_link_libraries (${HDF5_HL_F90_LIB_TARGET} - PUBLIC - ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET} - ) -# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -# ) + target_link_libraries (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -110,33 +100,24 @@ endif () if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SRCS}) target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} - PRIVATE - "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;$<$:${MPI_Fortran_INCLUDE_DIRS}>" - INTERFACE - "$/include/shared>" + PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;$<$:${MPI_Fortran_INCLUDE_DIRS}>" + INTERFACE "$/include/shared>" ) + target_compile_options(${HDF5_HL_F90_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}") target_compile_definitions(${HDF5_HL_F90_LIBSH_TARGET} - PUBLIC - "H5_BUILT_AS_DYNAMIC_LIB" + PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" PRIVATE $<$:BUILD_HDF5_HL_DLL;HDF5F90_WINDOWS> $<$:${WIN_COMPILE_FLAGS}> ) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} - PUBLIC - ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} - PRIVATE - ${LINK_Fortran_LIBS} - ) -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -# ) -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$:"-DLL"> -# ) + PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} + PRIVATE ${LINK_Fortran_LIBS} + ) +# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-DLL">) +# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def">) if(MSVC) set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} -DLL") endif() diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index a9ebe7c..efae5e3 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -15,40 +15,25 @@ macro (ADD_H5_FORTRAN_EXE file) add_executable (hl_f90_${file} ${file}.f90) target_compile_options(hl_f90_${file} PRIVATE + "${HDF5_CMAKE_Fortran_FLAGS}" $<$:${WIN_COMPILE_FLAGS}> ) -# set_property(TARGET hl_f90_${file} APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET hl_f90_${file} APPEND PROPERTY -# LINK_FLAGS $<$:${WIN_LINK_FLAGS}> -# ) +# set_property(TARGET hl_f90_${file} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET hl_f90_${file} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET hl_f90_${file} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - target_include_directories (hl_f90_${file} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" - ) - target_link_libraries (hl_f90_${file} - PRIVATE - ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} - ) + target_include_directories (hl_f90_${file} PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") + target_link_libraries (hl_f90_${file} PRIVATE ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}) set_target_properties (hl_f90_${file} PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) else () - target_include_directories (hl_f90_${file} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" - ) - target_link_libraries (hl_f90_${file} - PRIVATE - ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} - ) + target_include_directories (hl_f90_${file} PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") + target_link_libraries (hl_f90_${file} PRIVATE ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}) set_target_properties (hl_f90_${file} PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index f4eae8e..6a2fc61 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -36,9 +36,7 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) - target_compile_options(${HDF5_HL_LIB_TARGET} - PRIVATE "${HDF5_CMAKE_C_FLAGS}" - ) + target_compile_options(${HDF5_HL_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC) target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC 0) @@ -53,12 +51,8 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) - target_compile_options(${HDF5_HL_LIBSH_TARGET} - PRIVATE "${HDF5_CMAKE_C_FLAGS}" - ) - target_compile_definitions(${HDF5_HL_LIBSH_TARGET} - PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" - ) + target_compile_options(${HDF5_HL_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") + target_compile_definitions(${HDF5_HL_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB") TARGET_C_PROPERTIES (${HDF5_HL_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_HL_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIBSH_TARGET} ${HDF5_HL_LIB_NAME} SHARED "HL") diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index a2a7ad7..e91bba2 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -19,6 +19,7 @@ configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ON # -------------------------------------------------------------------- macro (HL_ADD_EXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) + target_compile_options(hl_${hl_name} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (hl_${hl_name} PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_${hl_name} STATIC) @@ -40,6 +41,7 @@ endmacro () macro (HL_ADD_ZEXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) + target_compile_options(hl_${hl_name} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (hl_${hl_name} PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_${hl_name} STATIC) @@ -69,6 +71,7 @@ HL_ADD_EXE (test_table) # test_packet has two source files add_executable (hl_test_packet test_packet.c test_packet_vlen.c) +target_compile_options(hl_test_packet PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (hl_test_packet PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_test_packet STATIC) @@ -93,6 +96,7 @@ set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (hl_gen_test_ds gen_test_ds.c) + target_compile_options(hl_gen_test_ds PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (hl_gen_test_ds PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (hl_gen_test_ds STATIC) target_link_libraries (hl_gen_test_ds PRIVATE diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index cc2ba68..0b895a3 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -16,6 +16,7 @@ set (GIF2H5_SOURCES #-- Add gif2hdf5 program if (NOT ONLY_SHARED_LIBS) add_executable (gif2h5 ${GIF2H5_SOURCES}) + target_compile_options(gif2h5 PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (gif2h5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (gif2h5 STATIC) target_link_libraries (gif2h5 PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) @@ -28,6 +29,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (gif2h5-shared ${GIF2H5_SOURCES}) + target_compile_options(gif2h5-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (gif2h5-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (gif2h5-shared SHARED) target_link_libraries (gif2h5-shared PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET}) @@ -45,6 +47,7 @@ set (hdf2gif_SOURCES ) if (NOT ONLY_SHARED_LIBS) add_executable (h52gif ${hdf2gif_SOURCES}) + target_compile_options(h52gif PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (h52gif PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h52gif STATIC) target_link_libraries (h52gif PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) @@ -57,6 +60,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h52gif-shared ${hdf2gif_SOURCES}) + target_compile_options(h52gif-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (h52gif-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h52gif-shared SHARED) target_link_libraries (h52gif-shared PRIVATE ${HDF5_HL_LIBSH_TARGET} PRIVATE ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET}) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index fbf136f..9f4c934 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -65,11 +65,13 @@ New Features - Both build systems use same set of warnings flags - GNU C warnings flags were moved to files in a config sub-folder - named gnu-warnings. Flags that only are available for a specific + GNU C, C++ and gfortran warnings flags were moved to files in a config + sub-folder named gnu-warnings. Flags that only are available for a specific version of the compiler are in files named with that version. Clang C warnings flags were moved to files in a config sub-folder named clang-warnings. + Intel C, Fortran warnings flags were moved to files in a config sub-folder + named intel-warnings. There are flags in named "error-xxx" files with warnings that may be promoted to errors. Some source files may still need fixes. @@ -78,7 +80,7 @@ New Features that are chosen by the CMake option:HDF5_ENABLE_DEV_WARNINGS or the configure option:--enable-developer-warnings. - In addition, CMake no longer applies these warnings for tests and examples. + In addition, CMake no longer applies these warnings for examples. (ADB - 2020/03/24, TRILAB-192) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9a22fd5..0989b8a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -965,9 +965,7 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) - target_compile_options(${HDF5_LIB_TARGET} - PRIVATE "${HDF5_CMAKE_C_FLAGS}" - ) + target_compile_options(${HDF5_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(${HDF5_LIB_TARGET} PUBLIC ${HDF_EXTRA_C_FLAGS} @@ -1004,9 +1002,7 @@ if (BUILD_SHARED_LIBS) PUBLIC "$<$:${HDFS_INCLUDE_DIR}>" INTERFACE "$/include>" ) - target_compile_options(${HDF5_LIBSH_TARGET} - PRIVATE "${HDF5_CMAKE_C_FLAGS}" - ) + target_compile_options(${HDF5_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(${HDF5_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 594395c..220bc65 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -26,6 +26,7 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) + target_compile_options(${HDF5_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC) target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET} @@ -44,9 +45,8 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) - target_compile_definitions(${HDF5_TEST_LIBSH_TARGET} - PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" - ) + target_compile_options(${HDF5_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") + target_compile_definitions(${HDF5_TEST_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB") TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET} @@ -226,6 +226,7 @@ set (H5_TESTS macro (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${file} STATIC) target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET}) @@ -257,6 +258,7 @@ endforeach () ######### Special handling for multiple sources ############# #-- Adding test for testhdf5 add_executable (testhdf5 ${testhdf5_SOURCES}) +target_compile_options(testhdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (testhdf5 STATIC) @@ -269,6 +271,7 @@ set_target_properties (testhdf5 PROPERTIES FOLDER test) #-- Adding test for cache add_executable (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +target_compile_options(cache PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories(cache PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (cache STATIC) @@ -281,6 +284,7 @@ set_target_properties (cache PROPERTIES FOLDER test) #-- Adding test for cache_api add_executable (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +target_compile_options(cache_api PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories(cache_api PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (cache_api STATIC) @@ -289,10 +293,11 @@ else () TARGET_C_PROPERTIES (cache_api SHARED) target_link_libraries (cache_api PRIVATE ${HDF5_TEST_LIBSH_TARGET}) endif () - set_target_properties (cache_api PROPERTIES FOLDER test) +set_target_properties (cache_api PROPERTIES FOLDER test) #-- Adding test for ttsafe add_executable (ttsafe ${ttsafe_SOURCES}) +target_compile_options(ttsafe PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (ttsafe STATIC) diff --git a/test/cache_common.h b/test/cache_common.h index c9252fb..a3612b1 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -667,6 +667,9 @@ void verify_unprotected(void); /*** H5AC level utility functions ***/ +hbool_t resize_configs_are_equal(const H5C_auto_size_ctl_t *a, + const H5C_auto_size_ctl_t *b, hbool_t compare_init); + void check_and_validate_cache_hit_rate(hid_t file_id, double * hit_rate_ptr, hbool_t dump_data, diff --git a/test/dsets.c b/test/dsets.c index 5bc4f70..873928e 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -17,12 +17,16 @@ * * Purpose: Tests the dataset interface (H5D) */ +#define H5D_TESTING #include "testhdf5.h" #include "H5srcdir.h" -#ifdef H5_HAVE_SZLIB_H -# include "szlib.h" -#endif + +/* + * This file needs to access private datatypes from the H5D package. + */ +#define H5D_PACKAGE +#include "H5Dpkg.h" /* * This file needs to access private datatypes from the H5Z package. @@ -30,6 +34,10 @@ #define H5Z_PACKAGE #include "H5Zpkg.h" +#ifdef H5_HAVE_SZLIB_H +# include "szlib.h" +#endif + const char *FILENAME[] = { "dataset", diff --git a/test/th5o.c b/test/th5o.c index 2c150c8..2d42734 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: th5o +* Test program: th5o * * Test public H5O functions for accessing * @@ -30,7 +30,7 @@ #define TEST6_DIM1 100 #define TEST6_DIM2 100 - + /**************************************************************** ** ** test_h5o_open(): Test H5Oopen function. @@ -140,7 +140,7 @@ test_h5o_open(void) } /* test_h5o_open() */ - + /**************************************************************** ** ** test_h5o_close(): Test H5Oclose function. @@ -151,6 +151,7 @@ test_h5o_close(void) { hid_t fid; /* HDF5 File ID */ hid_t grp, dset, dtype, dspace; /* Object identifiers */ + H5I_type_t id_type; /* Type of IDs returned from H5Oopen */ hsize_t dims[RANK]; herr_t ret; /* Value returned from API calls */ @@ -162,7 +163,8 @@ test_h5o_close(void) /* Create the group and close it with H5Oclose */ grp = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(grp, FAIL, "H5Gcreate2"); - VERIFY(H5Iget_type(grp), H5I_GROUP, "H5Iget_type"); + id_type = H5Iget_type(grp); + VERIFY(id_type, H5I_GROUP, "H5Iget_type"); ret = H5Oclose(grp); CHECK(ret, FAIL, "H5Oclose"); @@ -230,7 +232,7 @@ test_h5o_close(void) CHECK(ret, FAIL, "H5Fclose"); } - + /**************************************************************** ** ** test_h5o_open_by_addr(): Test H5Oopen_by_addr function. @@ -367,7 +369,7 @@ test_h5o_open_by_addr(void) VERIFY(dtype, FAIL, "H5Oopen_by_addr"); } /* test_h5o_open_by_addr() */ - + /**************************************************************** ** ** test_h5o_refcount(): Test H5O refcounting functions. @@ -378,7 +380,7 @@ test_h5o_refcount(void) { hid_t fid; /* HDF5 File ID */ hid_t grp, dset, dtype, dspace; /* Object identifiers */ - H5O_info_t oinfo; /* Object info struct */ + H5O_info_t oinfo; /* Object info struct */ hsize_t dims[RANK]; herr_t ret; /* Value returned from API calls */ @@ -562,7 +564,7 @@ test_h5o_refcount(void) CHECK(ret, FAIL, "H5Fclose"); } /* test_h5o_refcount() */ - + /**************************************************************** ** ** test_h5o_plist(): Test object creation properties @@ -756,7 +758,7 @@ test_h5o_plist(void) CHECK(ret, FAIL, "H5Pclose"); } /* test_h5o_plist() */ - + /**************************************************************** ** ** test_h5o_link(): Test creating link to object @@ -897,7 +899,7 @@ test_h5o_link(void) CHECK(ret, FAIL, "H5Pclose"); } /* end test_h5o_link() */ - + /**************************************************************** ** ** test_h5o_comment(): Test H5Oset(get)_comment functions. @@ -1069,7 +1071,7 @@ test_h5o_comment(void) } /* test_h5o_comment() */ - + /**************************************************************** ** ** test_h5o_comment_by_name(): Test H5Oset(get)_comment_by_name functions. @@ -1227,7 +1229,7 @@ test_h5o_comment_by_name(void) } /* test_h5o_comment_by_name() */ - + /**************************************************************** ** ** test_h5o_getinfo_same_file(): Test that querying the object info for @@ -1239,7 +1241,7 @@ test_h5o_getinfo_same_file(void) { hid_t fid1, fid2; /* HDF5 File ID */ hid_t gid1, gid2; /* Group IDs */ - H5O_info_t oinfo1, oinfo2; /* Object info structs */ + H5O_info_t oinfo1, oinfo2; /* Object info structs */ herr_t ret; /* Value returned from API calls */ /* Create a new HDF5 file */ @@ -1333,7 +1335,7 @@ test_h5o_getinfo_same_file(void) } /* test_h5o_getinfo_same_file() */ - + /**************************************************************** ** ** test_h5o(): Main H5O (generic object) testing routine. @@ -1345,9 +1347,9 @@ test_h5o(void) /* Output message about test being performed */ MESSAGE(5, ("Testing Objects\n")); - test_h5o_open(); /* Test generic open function */ - test_h5o_open_by_addr(); /* Test opening objects by address */ - test_h5o_close(); /* Test generic close function */ + test_h5o_open(); /* Test generic open function */ + test_h5o_open_by_addr(); /* Test opening objects by address */ + test_h5o_close(); /* Test generic close function */ test_h5o_refcount(); /* Test incrementing and decrementing reference count */ test_h5o_plist(); /* Test object creation properties */ test_h5o_link(); /* Test object link routine */ @@ -1356,15 +1358,15 @@ test_h5o(void) test_h5o_getinfo_same_file(); /* Test info for objects in the same file */ } /* test_h5o() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_h5o + * Function: cleanup_h5o * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: James Laird + * Programmer: James Laird * June 3, 2006 * *------------------------------------------------------------------------- diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index c4e47b7..3e23c0c 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -20,6 +20,7 @@ set (testphdf5_SOURCES #-- Adding test for testhdf5 add_executable (testphdf5 ${testphdf5_SOURCES}) +target_compile_options(testphdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (testphdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" ) @@ -38,6 +39,7 @@ set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) + target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" ) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 7facbe1..ab58ef2 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -42,6 +42,7 @@ if (H5_HAVE_PARALLEL) ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) target_include_directories (ph5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(ph5diff PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (ph5diff STATIC) target_link_libraries (ph5diff PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$:${MPI_C_LIBRARIES}>") set_target_properties (ph5diff PROPERTIES FOLDER tools) @@ -54,6 +55,7 @@ if (H5_HAVE_PARALLEL) ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) target_include_directories (ph5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(ph5diff-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (ph5diff-shared SHARED) target_link_libraries (ph5diff-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$:${MPI_C_LIBRARIES}>") set_target_properties (ph5diff-shared PROPERTIES FOLDER tools) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 306c033..ff9ca43 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -38,9 +38,7 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) - target_compile_options(${HDF5_TOOLS_LIB_TARGET} - PRIVATE "${HDF5_CMAKE_C_FLAGS}" - ) + target_compile_options(${HDF5_TOOLS_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") #target_compile_definitions(${HDF5_TOOLS_LIB_TARGET} PRIVATE H5_TOOLS_DEBUG) #target_compile_definitions(${HDF5_TOOLS_LIB_TARGET} PRIVATE H5DIFF_DEBUG) TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC) @@ -60,9 +58,7 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) - target_compile_options(${HDF5_TOOLS_LIBSH_TARGET} - PRIVATE "${HDF5_CMAKE_C_FLAGS}" - ) + target_compile_options(${HDF5_TOOLS_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(${HDF5_TOOLS_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" #PRIVATE H5_TOOLS_DEBUG diff --git a/tools/libtest/CMakeLists.txt b/tools/libtest/CMakeLists.txt index 7246e66..3e0f671 100644 --- a/tools/libtest/CMakeLists.txt +++ b/tools/libtest/CMakeLists.txt @@ -5,6 +5,7 @@ project (HDF5_TOOLS_LIBTEST C) # Add the h5tools_utils test executables #----------------------------------------------------------------------------- add_executable (h5tools_test_utils ${HDF5_TOOLS_LIBTEST_SOURCE_DIR}/h5tools_test_utils.c) +target_compile_options(h5tools_test_utils PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories(h5tools_test_utils PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (h5tools_test_utils STATIC) -- cgit v0.12 From a72239ecf4858706928b22b220041fbec8f1106d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 7 Apr 2020 12:58:13 -0500 Subject: Add missing m4 file --- MANIFEST | 5 +- m4/aclocal_cxx.m4 | 74 +++-------- m4/aclocal_fc.f90 | 162 +++++++++++++++++++++++++ m4/aclocal_fc.m4 | 357 ++++++++++++++++++++++++++++++++++++++++++------------ 4 files changed, 459 insertions(+), 139 deletions(-) create mode 100644 m4/aclocal_fc.f90 diff --git a/MANIFEST b/MANIFEST index 55a8ea2..1e477ab 100644 --- a/MANIFEST +++ b/MANIFEST @@ -31,8 +31,9 @@ ./m4/ltversion.m4 _DO_NOT_DISTRIBUTE_ ./m4/lt~obsolete.m4 _DO_NOT_DISTRIBUTE_ ./m4/ltoptions.m4 _DO_NOT_DISTRIBUTE_ -./m4/aclocal_cxx.m4 -./m4/aclocal_fc.m4 +./m4/aclocal_cxx.m4 _DO_NOT_DISTRIBUTE_ +./m4/aclocal_fc.m4 _DO_NOT_DISTRIBUTE_ +./m4/aclocal_fc.f90 ./README.txt ./aclocal.m4 ./acsite.m4 diff --git a/m4/aclocal_cxx.m4 b/m4/aclocal_cxx.m4 index 922320c..29a0607 100644 --- a/m4/aclocal_cxx.m4 +++ b/m4/aclocal_cxx.m4 @@ -7,9 +7,9 @@ dnl dnl This file is part of HDF5. The full HDF5 copyright notice, including dnl terms governing use, modification, and redistribution, is contained in dnl the COPYING file, which can be found at the root of the source code -dnl dnl distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -dnl dnl If you do not have access to either file, you may request a copy from -dnl dnl help@hdfgroup.org +dnl distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +dnl If you do not have access to either file, you may request a copy from +dnl help@hdfgroup.org dnl dnl ------------------------------------------------------------------------- dnl ------------------------------------------------------------------------- @@ -24,14 +24,11 @@ dnl we need as part of the C++ support. To distinquish these, they dnl have a [PAC] prefix. dnl Checking if C++ needs old style header files in includes - AC_DEFUN([PAC_PROG_CXX_HEADERS],[ AC_MSG_CHECKING([if $CXX needs old style header files in includes]) - AC_LINK_IFELSE([AC_LANG_SOURCE([ -#include + TEST_SRC="`(echo \"#define OLD_HEADER_FILENAME 1\"; cat $srcdir/config/cmake_ext_mod/HDFCXXTests.cpp)`" -int main(void) { return 0; } - ])], + AC_LINK_IFELSE([AC_LANG_SOURCE([$TEST_SRC])], [AC_MSG_RESULT([no])], [AC_MSG_RESULT([yes]) CXXFLAGS="${CXXFLAGS} -DOLD_HEADER_FILENAME" @@ -39,80 +36,43 @@ int main(void) { return 0; } ]) dnl Checking if ++ can handle namespaces - AC_DEFUN([PAC_PROG_CXX_NAMESPACE],[ AC_MSG_CHECKING([if $CXX can handle namespaces]) - AC_LINK_IFELSE([AC_LANG_SOURCE([ -namespace H5 { -int fnord; -} + TEST_SRC="`(echo \"#define HDF_NO_NAMESPACE 1\"; cat $srcdir/config/cmake_ext_mod/HDFCXXTests.cpp)`" -int main(void) { - using namespace H5; - fnord = 37; - return 0; -} - ])], [AC_MSG_RESULT([yes])], + AC_LINK_IFELSE([AC_LANG_SOURCE([$TEST_SRC])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) - CXXFLAGS="${CXXFLAGS} -DH5_NO_NAMESPACE" - AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_NAMESPACE"]) + CXXFLAGS="${CXXFLAGS} -DHDF_NO_NAMESPACE" + AM_CXXFLAGS="${AM_CXXFLAGS} -DHDF_NO_NAMESPACE"]) ]) dnl Checking if C++ supports std - AC_DEFUN([PAC_PROG_CXX_STD],[ AC_MSG_CHECKING([if $CXX supports std]) - AC_LINK_IFELSE([AC_LANG_SOURCE([ -#include - -using namespace std; + TEST_SRC="`(echo \"#define HDF_NO_STD 1\"; cat $srcdir/config/cmake_ext_mod/HDFCXXTests.cpp)`" -int main(void) { - string myString("testing namespace std"); - return 0; -} - ])], [AC_MSG_RESULT([yes])], + AC_LINK_IFELSE([AC_LANG_SOURCE([$TEST_SRC])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) CXXFLAGS="${CXXFLAGS} -DH5_NO_STD" AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_STD"]) ]) dnl Checking if C++ has offsetof extension - AC_DEFUN([PAC_PROG_CXX_OFFSETOF],[ AC_MSG_CHECKING([if $CXX has offsetof extension]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([ - #include - #include - ],[ - 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) - ])],[AC_MSG_RESULT([yes]) + TEST_SRC="`(echo \"#define CXX_HAVE_OFFSETOF 1\"; cat $srcdir/config/cmake_ext_mod/HDFCXXTests.cpp)`" + + AC_LINK_IFELSE([AC_LANG_SOURCE([$TEST_SRC])],[AC_MSG_RESULT([yes]) AC_DEFINE([CXX_HAVE_OFFSETOF], [1], [Define if C++ compiler recognizes offsetof])], AC_MSG_RESULT([no])) ]) dnl Checking if C++ can handle static cast - AC_DEFUN([PAC_PROG_CXX_STATIC_CAST],[ AC_MSG_CHECKING([if $CXX can handle static cast]) - AC_LINK_IFELSE([AC_LANG_SOURCE([ -int main(void) { - float test_float; - int test_int; - test_float = 37.0; - test_int = static_cast (test_float); - return 0; -} - ])], [AC_MSG_RESULT([yes])], + TEST_SRC="`(echo \"#define NO_STATIC_CAST 1\"; cat $srcdir/config/cmake_ext_mod/HDFCXXTests.cpp)`" + + AC_LINK_IFELSE([AC_LANG_SOURCE([$TEST_SRC])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) CXXFLAGS="${CXXFLAGS} -DNO_STATIC_CAST" AM_CXXFLAGS="${AM_CXXFLAGS} -DNO_STATIC_CAST"]) diff --git a/m4/aclocal_fc.f90 b/m4/aclocal_fc.f90 new file mode 100644 index 0000000..7e81a52 --- /dev/null +++ b/m4/aclocal_fc.f90 @@ -0,0 +1,162 @@ +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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 contains all the configure test programs +! used by autotools and cmake. This avoids having to +! duplicate code for both cmake and autotool tests. +! For autotools, a program below is chosen via a +! sed command in aclocal_fc.m4. For cmake, a program +! below is chosen via the macro READ_SOURCE in +! HDF5UseFortran.cmake +! + +PROGRAM PROG_FC_ISO_FORTRAN_ENV + USE, INTRINSIC :: ISO_FORTRAN_ENV +END PROGRAM PROG_FC_ISO_FORTRAN_ENV + +PROGRAM PROG_FC_SIZEOF + i = sizeof(x) +END PROGRAM PROG_FC_SIZEOF + +PROGRAM PROG_FC_C_SIZEOF + USE ISO_C_BINDING + INTEGER(C_INT) :: a + INTEGER(C_SIZE_T) :: RESULT + RESULT = C_SIZEOF(a) +END PROGRAM PROG_FC_C_SIZEOF + +PROGRAM PROG_FC_STORAGE_SIZE + INTEGER :: a + INTEGER :: RESULT + RESULT = STORAGE_SIZE(a) +END PROGRAM PROG_FC_STORAGE_SIZE + +PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE + USE ISO_C_BINDING + REAL(KIND=C_LONG_DOUBLE) :: d +END PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE + +PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS + USE iso_c_binding + IMPLICIT NONE + TYPE(C_PTR) :: ptr + TYPE(C_FUNPTR) :: funptr + CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr + ptr = C_LOC(ichr(1:1)) +END PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS + +!---- START ----- Check to see C_LONG_DOUBLE is different from C_DOUBLE +MODULE type_mod + USE ISO_C_BINDING + INTERFACE h5t + MODULE PROCEDURE h5t_c_double + MODULE PROCEDURE h5t_c_long_double + END INTERFACE +CONTAINS + SUBROUTINE h5t_c_double(r) + REAL(KIND=C_DOUBLE) :: r + END SUBROUTINE h5t_c_double + SUBROUTINE h5t_c_long_double(d) + REAL(KIND=C_LONG_DOUBLE) :: d + END SUBROUTINE h5t_c_long_double +END MODULE type_mod +PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE + USE ISO_C_BINDING + USE type_mod + REAL(KIND=C_DOUBLE) :: r + REAL(KIND=C_LONG_DOUBLE) :: d + CALL h5t(r) + CALL h5t(d) +END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE +!---- END ------- Check to see C_LONG_DOUBLE is different from C_DOUBLE + +!---- START ----- Determine the available KINDs for REALs and INTEGERs +PROGRAM FC_AVAIL_KINDS + IMPLICIT NONE + INTEGER :: ik, jk, k, kk, max_decimal_prec + INTEGER :: prev_rkind, num_rkinds = 1, num_ikinds = 1 + INTEGER, DIMENSION(1:10) :: list_ikinds = -1 + INTEGER, DIMENSION(1:10) :: list_rkinds = -1 + LOGICAL :: new_kind + + OPEN(8, FILE='pac_fconftest.out', FORM='formatted') + + ! Find integer KINDs + list_ikinds(num_ikinds)=SELECTED_INT_KIND(1) + DO ik = 2, 36 + k = SELECTED_INT_KIND(ik) + IF(k.LT.0) EXIT + IF(k.GT.list_ikinds(num_ikinds))THEN + num_ikinds = num_ikinds + 1 + list_ikinds(num_ikinds) = k + ENDIF + ENDDO + + DO k = 1, num_ikinds + WRITE(8,'(I0)', ADVANCE='NO') list_ikinds(k) + IF(k.NE.num_ikinds)THEN + WRITE(8,'(A)',ADVANCE='NO') ',' + ELSE + WRITE(8,'()') + ENDIF + ENDDO + + ! Find real KINDs + list_rkinds(num_rkinds)=SELECTED_REAL_KIND(1) + max_decimal_prec = 1 + prev_rkind=list_rkinds(num_rkinds) + + prec: DO ik = 2, 36 + exp: DO jk = 1, 700 + k = SELECTED_REAL_KIND(ik,jk) + IF(k.LT.0) EXIT exp + IF(k.NE.prev_rkind)THEN + ! Check if we aleady have that kind + new_kind = .TRUE. + DO kk = 1, num_rkinds + IF(k.EQ.list_rkinds(kk))THEN + new_kind=.FALSE. + EXIT + ENDIF + ENDDO + IF(new_kind)THEN + num_rkinds = num_rkinds + 1 + list_rkinds(num_rkinds) = k + prev_rkind=list_rkinds(num_rkinds) + ENDIF + ENDIF + max_decimal_prec = ik + ENDDO exp + ENDDO prec + + DO k = 1, num_rkinds + WRITE(8,'(I0)', ADVANCE='NO') list_rkinds(k) + IF(k.NE.num_rkinds)THEN + WRITE(8,'(A)',ADVANCE='NO') ',' + ELSE + WRITE(8,'()') + ENDIF + ENDDO + + WRITE(8,'(I0)') max_decimal_prec + WRITE(8,'(I0)') num_ikinds + WRITE(8,'(I0)') num_rkinds +END PROGRAM FC_AVAIL_KINDS +!---- END ----- Determine the available KINDs for REALs and INTEGERs + +PROGRAM FC_MPI_CHECK + INCLUDE 'mpif.h' + INTEGER :: comm, amode, info, fh, ierror + CHARACTER(LEN=1) :: filename + CALL MPI_File_open( comm, filename, amode, info, fh, ierror) +END PROGRAM FC_MPI_CHECK diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index 227e760..ab45bbc 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -7,9 +7,9 @@ dnl dnl This file is part of HDF5. The full HDF5 copyright notice, including dnl terms governing use, modification, and redistribution, is contained in dnl the COPYING file, which can be found at the root of the source code -dnl dnl distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -dnl dnl If you do not have access to either file, you may request a copy from -dnl dnl help@hdfgroup.org +dnl distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +dnl If you do not have access to either file, you may request a copy from +dnl help@hdfgroup.org dnl dnl ------------------------------------------------------------------------- dnl ------------------------------------------------------------------------- @@ -61,16 +61,24 @@ dnl was required" problem when libtool is also used dnl [1] MPICH.org dnl +dnl See if the fortran compiler supports the intrinsic module "ISO_FORTRAN_ENV" + +AC_DEFUN([PAC_PROG_FC_ISO_FORTRAN_ENV],[ + HAVE_ISO_FORTRAN_ENV="no" + AC_MSG_CHECKING([if Fortran compiler supports intrinsic module ISO_FORTRAN_ENV]) + TEST_SRC="`sed -n '/PROGRAM PROG_FC_ISO_FORTRAN_ENV/,/END PROGRAM PROG_FC_ISO_FORTRAN_ENV/p' $srcdir/m4/aclocal_fc.f90`" + AC_LINK_IFELSE([$TEST_SRC],[AC_MSG_RESULT([yes]) + HAVE_ISO_FORTRAN_ENV="yes"], + [AC_MSG_RESULT([no])]) +]) + dnl See if the fortran compiler supports the intrinsic function "SIZEOF" AC_DEFUN([PAC_PROG_FC_SIZEOF],[ HAVE_SIZEOF_FORTRAN="no" AC_MSG_CHECKING([if Fortran compiler supports intrinsic SIZEOF]) - AC_LINK_IFELSE([AC_LANG_SOURCE([ - PROGRAM main - i = sizeof(x) - END PROGRAM - ])],[AC_MSG_RESULT([yes]) + TEST_SRC="`sed -n '/PROGRAM PROG_FC_SIZEOF/,/END PROGRAM PROG_FC_SIZEOF/p' $srcdir/m4/aclocal_fc.f90`" + AC_LINK_IFELSE([$TEST_SRC],[AC_MSG_RESULT([yes]) HAVE_SIZEOF_FORTRAN="yes"], [AC_MSG_RESULT([no])]) ]) @@ -80,14 +88,8 @@ dnl See if the fortran compiler supports the intrinsic function "C_SIZEOF" AC_DEFUN([PAC_PROG_FC_C_SIZEOF],[ HAVE_C_SIZEOF_FORTRAN="no" AC_MSG_CHECKING([if Fortran compiler supports intrinsic C_SIZEOF]) - AC_LINK_IFELSE([AC_LANG_SOURCE([ - PROGRAM main - USE ISO_C_BINDING - INTEGER(C_INT) :: a - INTEGER(C_SIZE_T) :: result - result = C_SIZEOF(a) - END PROGRAM - ])], [AC_MSG_RESULT([yes]) + TEST_SRC="`sed -n '/PROGRAM PROG_FC_C_SIZEOF/,/END PROGRAM PROG_FC_C_SIZEOF/p' $srcdir/m4/aclocal_fc.f90`" + AC_LINK_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) HAVE_C_SIZEOF_FORTRAN="yes"], [AC_MSG_RESULT([no])]) ]) @@ -97,74 +99,48 @@ dnl See if the fortran compiler supports the intrinsic function "STORAGE_SIZE" AC_DEFUN([PAC_PROG_FC_STORAGE_SIZE],[ HAVE_STORAGE_SIZE_FORTRAN="no" AC_MSG_CHECKING([if Fortran compiler supports intrinsic STORAGE_SIZE]) - AC_LINK_IFELSE([AC_LANG_SOURCE([ - PROGRAM main - INTEGER :: a - INTEGER :: result - result = STORAGE_SIZE(a) - END PROGRAM - ])], [AC_MSG_RESULT([yes]) + TEST_SRC="`sed -ne '/PROGRAM PROG_FC_STORAGE_SIZE/,/END PROGRAM PROG_FC_STORAGE_SIZE/p' $srcdir/m4/aclocal_fc.f90`" + AC_LINK_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) HAVE_STORAGE_SIZE_FORTRAN="yes"], [AC_MSG_RESULT([no])]) ]) -dnl Check to see if -r8 was specified to determine if we need to -dnl compile the DOUBLE PRECISION interfaces. - -AC_DEFUN([PAC_PROG_FC_DEFAULT_REALisDBLE],[ - FORTRAN_DEFAULT_REALisDBLE="no" - AC_MSG_CHECKING([if Fortran default REAL is DOUBLE PRECISION]) - - AC_COMPILE_IFELSE([AC_LANG_SOURCE([ - MODULE type_mod - INTERFACE h5t - MODULE PROCEDURE h5t_real - MODULE PROCEDURE h5t_dble - END INTERFACE - CONTAINS - SUBROUTINE h5t_real(r) - REAL :: r - END SUBROUTINE h5t_real - SUBROUTINE h5t_dble(d) - DOUBLE PRECISION :: d - END SUBROUTINE h5t_dble - END MODULE type_mod - PROGRAM main - USE type_mod - REAL :: r - DOUBLE PRECISION :: d - CALL h5t(r) - CALL h5t(d) - END PROGRAM main - ])], [AC_MSG_RESULT([no])], - [AC_MSG_RESULT([yes]) - FORTRAN_DEFAULT_REALisDBLE="yes"]) +dnl Check to see C_LONG_DOUBLE is available + +AC_DEFUN([PAC_PROG_FC_HAVE_C_LONG_DOUBLE],[ + HAVE_C_LONG_DOUBLE_FORTRAN="no" + AC_MSG_CHECKING([if Fortran compiler supports intrinsic C_LONG_DOUBLE]) + TEST_SRC="" + TEST_SRC="`sed -n '/PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE/,/END PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE/p' $srcdir/m4/aclocal_fc.f90`" + AC_LINK_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) + HAVE_C_LONG_DOUBLE_FORTRAN="yes"], + [AC_MSG_RESULT([no])]) ]) +dnl Check if C_LONG_DOUBLE is different from C_DOUBLE + +if test "X$FORTRAN_HAVE_C_LONG_DOUBLE" = "Xyes"; then +AC_DEFUN([PAC_PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE],[ + C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="no" + AC_MSG_CHECKING([if Fortran C_LONG_DOUBLE is different from C_DOUBLE]) + TEST_SRC="`sed -n '/MODULE type_mod/,/END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE/p' $srcdir/m4/aclocal_fc.f90`" + AC_COMPILE_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) + C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="yes"], + [AC_MSG_RESULT([no])]) +]) +fi + dnl Checking if the compiler supports the required Fortran 2003 features and dnl disable Fortran 2003 if it does not. AC_DEFUN([PAC_PROG_FC_HAVE_F2003_REQUIREMENTS],[ + HAVE_F2003_REQUIREMENTS="no" AC_MSG_CHECKING([if Fortran compiler version compatible with Fortran 2003 HDF]) -dnl -------------------------------------------------------------------- -dnl Default for FORTRAN 2003 compliant compilers -dnl - HAVE_FORTRAN_2003="no" - HAVE_F2003_REQUIREMENTS="no" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ - - USE iso_c_binding - IMPLICIT NONE - TYPE(C_PTR) :: ptr - TYPE(C_FUNPTR) :: funptr - CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr - - ptr = C_LOC(ichr(1:1)) - - ])],[AC_MSG_RESULT([yes]) - HAVE_F2003_REQUIREMENTS=[yes]], - [AC_MSG_RESULT([no])]) + TEST_SRC="`sed -n '/PROG_FC_HAVE_F2003_REQUIREMENTS/,/END PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS/p' $srcdir/m4/aclocal_fc.f90`" + AC_COMPILE_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) + HAVE_F2003_REQUIREMENTS="yes"], + [AC_MSG_RESULT([no])]) ]) dnl ------------------------------------------------------------------------- @@ -261,16 +237,10 @@ AC_DEFUN([PAC_PROG_FC_MPI_CHECK],[ dnl Change to the Fortran 90 language AC_LANG_PUSH(Fortran) - + TEST_SRC="`sed -n '/PROGRAM FC_MPI_CHECK/,/END PROGRAM FC_MPI_CHECK/p' $srcdir/m4/aclocal_fc.f90`" dnl Try link a simple MPI program. AC_MSG_CHECKING([whether a simple MPI-IO Fortran program can be linked]) - AC_LINK_IFELSE([ - PROGRAM main - USE mpi - INTEGER :: comm, amode, info, fh, ierror - CHARACTER(LEN=1) :: filename - CALL MPI_File_open( comm, filename, amode, info, fh, ierror) - END], + AC_LINK_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_ERROR([unable to link a simple MPI-IO Fortran program])]) @@ -278,4 +248,231 @@ dnl Try link a simple MPI program. dnl Change to the C language AC_LANG_POP(Fortran) ]) + +dnl ------------------------------------------------------ +dnl Determine the available KINDs for REALs and INTEGERs +dnl ------------------------------------------------------ +dnl +dnl This is a runtime test. +dnl +AC_DEFUN([PAC_FC_AVAIL_KINDS],[ +AC_LANG_PUSH([Fortran]) +rm -f pac_fconftest.out +TEST_SRC="`sed -n '/PROGRAM FC_AVAIL_KINDS/,/END PROGRAM FC_AVAIL_KINDS/p' $srcdir/m4/aclocal_fc.f90`" +AC_RUN_IFELSE([$TEST_SRC], + [ + if test -s pac_fconftest.out ; then + 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 3 -- max decimal precision for reals + dnl -- LINE 4 -- number of valid integer kinds + dnl -- LINE 5 -- number of valid real kinds + + pac_validIntKinds="`sed -n '1p' pac_fconftest.out`" + pac_validRealKinds="`sed -n '2p' pac_fconftest.out`" + PAC_FC_MAX_REAL_PRECISION="`sed -n '3p' pac_fconftest.out`" + AC_DEFINE_UNQUOTED([PAC_FC_MAX_REAL_PRECISION], $PAC_FC_MAX_REAL_PRECISION, [Define Fortran Maximum Real Decimal Precision]) + + PAC_FC_ALL_INTEGER_KINDS="{`echo $pac_validIntKinds`}" + PAC_FC_ALL_REAL_KINDS="{`echo $pac_validRealKinds`}" + + PAC_FORTRAN_NUM_INTEGER_KINDS="`sed -n '4p' pac_fconftest.out`" + H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `echo $PAC_FORTRAN_NUM_INTEGER_KINDS`" + H5CONFIG_F_IKIND="INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/`echo $pac_validIntKinds`/)" + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `sed -n '5p' pac_fconftest.out`" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" + + AC_DEFINE_UNQUOTED([H5CONFIG_F_NUM_RKIND], $H5CONFIG_F_NUM_RKIND, [Define number of valid Fortran REAL KINDs]) + AC_DEFINE_UNQUOTED([H5CONFIG_F_NUM_IKIND], $H5CONFIG_F_NUM_IKIND, [Define number of valid Fortran INTEGER KINDs]) + AC_DEFINE_UNQUOTED([H5CONFIG_F_RKIND], $H5CONFIG_F_RKIND, [Define valid Fortran REAL KINDs]) + AC_DEFINE_UNQUOTED([H5CONFIG_F_IKIND], $H5CONFIG_F_IKIND, [Define valid Fortran INTEGER KINDs]) + + AC_MSG_CHECKING([for Number of Fortran INTEGER KINDs]) + AC_MSG_RESULT([$PAC_FORTRAN_NUM_INTEGER_KINDS]) + AC_MSG_CHECKING([for Fortran INTEGER KINDs]) + AC_MSG_RESULT([$PAC_FC_ALL_INTEGER_KINDS]) + AC_MSG_CHECKING([for Fortran REAL KINDs]) + AC_MSG_RESULT([$PAC_FC_ALL_REAL_KINDS]) + AC_MSG_CHECKING([for Fortran REALs maximum decimal precision]) + AC_MSG_RESULT([$PAC_FC_MAX_REAL_PRECISION]) + else + AC_MSG_RESULT([Error]) + AC_MSG_ERROR([No output from Fortran test program!]) + fi + rm -f pac_fconftest.out +],[ + AC_MSG_RESULT([Error]) + AC_MSG_ERROR([Failed to run Fortran program to determine available KINDs]) +],[]) + +AC_LANG_POP([Fortran]) +]) +AC_DEFUN([PAC_FC_SIZEOF_INT_KINDS],[ +AC_REQUIRE([PAC_FC_AVAIL_KINDS]) +AC_MSG_CHECKING([sizeof of available INTEGER KINDs]) +AC_LANG_PUSH([Fortran]) +pack_int_sizeof="" +rm -f pac_fconftest.out + +for kind in `echo $pac_validIntKinds | sed -e 's/,/ /g'`; do + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([ + PROGRAM main + USE ISO_C_BINDING + IMPLICIT NONE + INTEGER (KIND=$kind) a + OPEN(8, FILE='pac_fconftest.out', FORM='formatted') + WRITE(8,'(I0)') $FC_SIZEOF_A + CLOSE(8) + END + ]) + ]) + AC_RUN_IFELSE([],[ + if test -s pac_fconftest.out ; then + sizes="`cat pac_fconftest.out`" + pack_int_sizeof="$pack_int_sizeof $sizes," + else + AC_MSG_ERROR([No output from Fortran test program!]) + fi + rm -f pac_fconftest.out + ],[ + AC_MSG_ERROR([Fortran program fails to build or run!]) + ],[ + pack_int_sizeof="$2" + ]) +done +PAC_FC_ALL_INTEGER_KINDS_SIZEOF="{`echo $pack_int_sizeof | sed -e 's/,$//' | sed -e 's/ //g'`}" +AC_MSG_RESULT([$PAC_FC_ALL_INTEGER_KINDS_SIZEOF]) +AC_LANG_POP([Fortran]) +]) + +AC_DEFUN([PAC_FC_SIZEOF_REAL_KINDS],[ +AC_REQUIRE([PAC_FC_AVAIL_KINDS]) +AC_MSG_CHECKING([sizeof of available REAL KINDs]) +AC_LANG_PUSH([Fortran]) +pack_real_sizeof="" +rm -f pac_fconftest.out +for kind in `echo $pac_validRealKinds | sed -e 's/,/ /g'`; do + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([ + PROGRAM main + USE ISO_C_BINDING + IMPLICIT NONE + REAL (KIND=$kind) :: a + OPEN(8, FILE='pac_fconftest.out', FORM='formatted') + WRITE(8,'(I0)') $FC_SIZEOF_A + CLOSE(8) + END + ]) + ]) + AC_RUN_IFELSE([],[ + if test -s pac_fconftest.out ; then + sizes="`cat pac_fconftest.out`" + pack_real_sizeof="$pack_real_sizeof $sizes," + else + AC_MSG_ERROR([No output from Fortran test program!]) + fi + rm -f pac_fconftest.out + ],[ + AC_MSG_ERROR([Fortran program fails to build or run!]) + ],[ + pack_real_sizeof="$2" + ]) +done +PAC_FC_ALL_REAL_KINDS_SIZEOF="{`echo $pack_real_sizeof | sed -e 's/,$//' | sed -e 's/ //g'`}" +AC_MSG_RESULT([$PAC_FC_ALL_REAL_KINDS_SIZEOF]) +AC_LANG_POP([Fortran]) +]) + +AC_DEFUN([PAC_FC_NATIVE_INTEGER],[ +AC_REQUIRE([PAC_FC_AVAIL_KINDS]) +AC_MSG_CHECKING([sizeof of native KINDS]) +AC_LANG_PUSH([Fortran]) +pack_int_sizeof="" +rm -f pac_fconftest.out + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([ + PROGRAM main + USE ISO_C_BINDING + IMPLICIT NONE + INTEGER a + REAL b + DOUBLE PRECISION c + OPEN(8, FILE='pac_fconftest.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) + END + ]) + ]) + AC_RUN_IFELSE([],[ + if test -s pac_fconftest.out ; then + PAC_FORTRAN_NATIVE_INTEGER_SIZEOF="`sed -n '1p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_INTEGER_KIND="`sed -n '2p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_REAL_SIZEOF="`sed -n '3p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_REAL_KIND="`sed -n '4p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF="`sed -n '5p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_DOUBLE_KIND="`sed -n '6p' pac_fconftest.out`" + else + AC_MSG_ERROR([No output from Fortran test program!]) + fi + rm -f pac_fconftest.out + ],[ + AC_MSG_ERROR([Fortran program fails to build or run!]) + ],[ + pack_int_sizeof="$2" + ]) +AC_MSG_RESULT([$pack_int_sizeof]) +AC_LANG_POP([Fortran]) +]) + +AC_DEFUN([PAC_FC_LDBL_DIG],[ +AC_MSG_CHECKING([maximum decimal precision for C]) +rm -f pac_Cconftest.out + AC_LANG_CONFTEST([ + AC_LANG_PROGRAM([ + #include + #include + #define CHECK_FLOAT128 $ac_cv_sizeof___float128 + #if CHECK_FLOAT128!=0 + # if $HAVE_QUADMATH!=0 + #include + # 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 + ],[[ + FILE * pFile; + pFile = fopen("pac_Cconftest.out","w"); + fprintf(pFile, "%d\n%d\n", C_LDBL_DIG, C_FLT128_DIG); + ]]) + ]) + AC_RUN_IFELSE([],[ + if test -s pac_Cconftest.out ; then + LDBL_DIG="`sed -n '1p' pac_Cconftest.out`" + FLT128_DIG="`sed -n '2p' pac_Cconftest.out`" + else + AC_MSG_ERROR([No output from C decimal precision program!]) + fi + rm -f pac_Cconftest.out + ],[ + AC_MSG_ERROR([C program fails to build or run!]) + ],[]) +]) + -- cgit v0.12 From a9eb59c820b3fed66e720fd55ef8f5e25e9a99f7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 7 Apr 2020 13:31:06 -0500 Subject: Remove 128bit config check fo 1.8 --- config/cmake/HDF5UseFortran.cmake | 71 +-------------------------------------- 1 file changed, 1 insertion(+), 70 deletions(-) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index c5d8200..12df64a 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -406,22 +406,6 @@ endif () set (${HDF_PREFIX}_FORTRAN_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) -# remove the invalid kind from the list -if (NOT(${${HDF_PREFIX}_SIZEOF___FLOAT128} EQUAL 0)) - if (NOT(${${HDF_PREFIX}_SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) - AND NOT(${${HDF_PREFIX}_FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof}) - # account for the fact that the C compiler can have 16-byte __float128 and the fortran compiler only has 8-byte doubles, - # so we don't want to remove the 8-byte fortran doubles. - AND NOT(${PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF} EQUAL ${max_real_fortran_sizeof})) - message (WARNING " - Fortran REAL(KIND=${max_real_fortran_kind}) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size - !!! Fortran interfaces will not be generated for REAL(KIND=${max_real_fortran_kind}) !!!") - string (REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS ${PAC_FC_ALL_REAL_KINDS}) - string (REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS_SIZEOF ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) - math (EXPR NUM_RKIND "${NUM_RKIND} - 1") - endif () -endif () - set (${HDF_PREFIX}_H5CONFIG_F_NUM_RKIND "INTEGER, PARAMETER :: num_rkinds = ${NUM_RKIND}") string (REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS}) @@ -435,7 +419,7 @@ set (${HDF_PREFIX}_H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: ENABLE_LANGUAGE (C) if (NOT CMAKE_VERSION VERSION_LESS "3.14.0") -include (CheckCSourceRuns) + include (CheckCSourceRuns) else () #----------------------------------------------------------------------------- # The provided CMake C macros don't provide a general compile/run function @@ -489,59 +473,6 @@ macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR) endmacro () endif () -set (PROG_SRC - " -#include -#include -#define CHECK_FLOAT128 ${${HDF_PREFIX}_SIZEOF___FLOAT128} -#if CHECK_FLOAT128!=0 -# if ${${HDF_PREFIX}_HAVE_QUADMATH_H}!=0 -#include -# endif -# ifdef FLT128_DIG -#define C_FLT128_DIG FLT128_DIG -# else -#define C_FLT128_DIG 0 -# endif -#else -#define C_FLT128_DIG 0 -#endif -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#define C_LDBL_DIG DECIMAL_DIG -#else -#define C_LDBL_DIG LDBL_DIG -#endif - int main() { - printf(\"%d\\\\n%d\\\\n\", C_LDBL_DIG, C_FLT128_DIG)\\\; - return 1\\\; - } - " -) - -if (NOT CMAKE_VERSION VERSION_LESS "3.14.0") - check_c_source_runs (${PROG_SRC} PROG_OUTPUT) -else () - C_RUN ("maximum decimal precision for C" ${PROG_SRC} PROG_OUTPUT) -endif () - -# dnl The output from the above program will be: -# dnl -- LINE 1 -- long double decimal precision -# dnl -- LINE 2 -- __float128 decimal precision - -# Convert the string to a list of strings by replacing the carriage return with a semicolon -string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") - -list (GET PROG_OUTPUT 0 LDBL_DIG) -list (GET PROG_OUTPUT 1 FLT128_DIG) - -if (${HDF_PREFIX}_SIZEOF___FLOAT128 EQUAL 0 OR FLT128_DIG EQUAL 0) - set (${HDF_PREFIX}_HAVE_FLOAT128 0) - set (${HDF_PREFIX}_SIZEOF___FLOAT128 0) - set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${LDBL_DIG}) -else () - set(${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${FLT128_DIG}) -endif () - # Setting definition if there is a 16 byte fortran integer string (FIND ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF} "16" pos) -- cgit v0.12 From 72e3282fe8703fd9cf65c5e3af575ef70ff97f3d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 7 Apr 2020 18:02:23 -0500 Subject: TRILAB-192 update LTparse files --- hl/src/H5LTanalyze.c | 147 ++++++++++++++++++++++++++------------------------- hl/src/H5LTanalyze.l | 5 +- 2 files changed, 77 insertions(+), 75 deletions(-) diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 85f499b..92bc43f 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -887,9 +887,10 @@ char *H5LTyytext; #include #include "H5LTparse.h" -/* Turn off suggest const attribute warning in gcc */ -#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 +/* Turn off suggest const & malloc attribute warnings in gcc */ +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc" #endif int my_yyinput(char *, int); @@ -940,7 +941,7 @@ extern hbool_t is_opq_tag; hbool_t first_quote = 1; -#line 925 "H5LTanalyze.c" +#line 926 "H5LTanalyze.c" #define INITIAL 0 #define TAG_STRING 1 @@ -1115,10 +1116,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 82 "H5LTanalyze.l" +#line 83 "H5LTanalyze.l" -#line 1103 "H5LTanalyze.c" +#line 1104 "H5LTanalyze.c" if ( !(yy_init) ) { @@ -1212,277 +1213,277 @@ do_action: /* This label is used only to access EOF actions. */ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 84 "H5LTanalyze.l" +#line 85 "H5LTanalyze.l" {return hid(H5T_STD_I8BE_TOKEN);} YY_BREAK case 2: YY_RULE_SETUP -#line 85 "H5LTanalyze.l" +#line 86 "H5LTanalyze.l" {return hid(H5T_STD_I8LE_TOKEN);} YY_BREAK case 3: YY_RULE_SETUP -#line 86 "H5LTanalyze.l" +#line 87 "H5LTanalyze.l" {return hid(H5T_STD_I16BE_TOKEN);} YY_BREAK case 4: YY_RULE_SETUP -#line 87 "H5LTanalyze.l" +#line 88 "H5LTanalyze.l" {return hid(H5T_STD_I16LE_TOKEN);} YY_BREAK case 5: YY_RULE_SETUP -#line 88 "H5LTanalyze.l" +#line 89 "H5LTanalyze.l" {return hid(H5T_STD_I32BE_TOKEN);} YY_BREAK case 6: YY_RULE_SETUP -#line 89 "H5LTanalyze.l" +#line 90 "H5LTanalyze.l" {return hid(H5T_STD_I32LE_TOKEN);} YY_BREAK case 7: YY_RULE_SETUP -#line 90 "H5LTanalyze.l" +#line 91 "H5LTanalyze.l" {return hid(H5T_STD_I64BE_TOKEN);} YY_BREAK case 8: YY_RULE_SETUP -#line 91 "H5LTanalyze.l" +#line 92 "H5LTanalyze.l" {return hid(H5T_STD_I64LE_TOKEN);} YY_BREAK case 9: YY_RULE_SETUP -#line 93 "H5LTanalyze.l" +#line 94 "H5LTanalyze.l" {return hid(H5T_STD_U8BE_TOKEN);} YY_BREAK case 10: YY_RULE_SETUP -#line 94 "H5LTanalyze.l" +#line 95 "H5LTanalyze.l" {return hid(H5T_STD_U8LE_TOKEN);} YY_BREAK case 11: YY_RULE_SETUP -#line 95 "H5LTanalyze.l" +#line 96 "H5LTanalyze.l" {return hid(H5T_STD_U16BE_TOKEN);} YY_BREAK case 12: YY_RULE_SETUP -#line 96 "H5LTanalyze.l" +#line 97 "H5LTanalyze.l" {return hid(H5T_STD_U16LE_TOKEN);} YY_BREAK case 13: YY_RULE_SETUP -#line 97 "H5LTanalyze.l" +#line 98 "H5LTanalyze.l" {return hid(H5T_STD_U32BE_TOKEN);} YY_BREAK case 14: YY_RULE_SETUP -#line 98 "H5LTanalyze.l" +#line 99 "H5LTanalyze.l" {return hid(H5T_STD_U32LE_TOKEN);} YY_BREAK case 15: YY_RULE_SETUP -#line 99 "H5LTanalyze.l" +#line 100 "H5LTanalyze.l" {return hid(H5T_STD_U64BE_TOKEN);} YY_BREAK case 16: YY_RULE_SETUP -#line 100 "H5LTanalyze.l" +#line 101 "H5LTanalyze.l" {return hid(H5T_STD_U64LE_TOKEN);} YY_BREAK case 17: YY_RULE_SETUP -#line 102 "H5LTanalyze.l" +#line 103 "H5LTanalyze.l" {return hid(H5T_NATIVE_CHAR_TOKEN);} YY_BREAK case 18: YY_RULE_SETUP -#line 103 "H5LTanalyze.l" +#line 104 "H5LTanalyze.l" {return hid(H5T_NATIVE_SCHAR_TOKEN);} YY_BREAK case 19: YY_RULE_SETUP -#line 104 "H5LTanalyze.l" +#line 105 "H5LTanalyze.l" {return hid(H5T_NATIVE_UCHAR_TOKEN);} YY_BREAK case 20: YY_RULE_SETUP -#line 105 "H5LTanalyze.l" +#line 106 "H5LTanalyze.l" {return hid(H5T_NATIVE_SHORT_TOKEN);} YY_BREAK case 21: YY_RULE_SETUP -#line 106 "H5LTanalyze.l" +#line 107 "H5LTanalyze.l" {return hid(H5T_NATIVE_USHORT_TOKEN);} YY_BREAK case 22: YY_RULE_SETUP -#line 107 "H5LTanalyze.l" +#line 108 "H5LTanalyze.l" {return hid(H5T_NATIVE_INT_TOKEN);} YY_BREAK case 23: YY_RULE_SETUP -#line 108 "H5LTanalyze.l" +#line 109 "H5LTanalyze.l" {return hid(H5T_NATIVE_UINT_TOKEN);} YY_BREAK case 24: YY_RULE_SETUP -#line 109 "H5LTanalyze.l" +#line 110 "H5LTanalyze.l" {return hid(H5T_NATIVE_LONG_TOKEN);} YY_BREAK case 25: YY_RULE_SETUP -#line 110 "H5LTanalyze.l" +#line 111 "H5LTanalyze.l" {return hid(H5T_NATIVE_ULONG_TOKEN);} YY_BREAK case 26: YY_RULE_SETUP -#line 111 "H5LTanalyze.l" +#line 112 "H5LTanalyze.l" {return hid(H5T_NATIVE_LLONG_TOKEN);} YY_BREAK case 27: YY_RULE_SETUP -#line 112 "H5LTanalyze.l" +#line 113 "H5LTanalyze.l" {return hid(H5T_NATIVE_ULLONG_TOKEN);} YY_BREAK case 28: YY_RULE_SETUP -#line 114 "H5LTanalyze.l" +#line 115 "H5LTanalyze.l" {return hid(H5T_IEEE_F32BE_TOKEN);} YY_BREAK case 29: YY_RULE_SETUP -#line 115 "H5LTanalyze.l" +#line 116 "H5LTanalyze.l" {return hid(H5T_IEEE_F32LE_TOKEN);} YY_BREAK case 30: YY_RULE_SETUP -#line 116 "H5LTanalyze.l" +#line 117 "H5LTanalyze.l" {return hid(H5T_IEEE_F64BE_TOKEN);} YY_BREAK case 31: YY_RULE_SETUP -#line 117 "H5LTanalyze.l" +#line 118 "H5LTanalyze.l" {return hid(H5T_IEEE_F64LE_TOKEN);} YY_BREAK case 32: YY_RULE_SETUP -#line 118 "H5LTanalyze.l" +#line 119 "H5LTanalyze.l" {return hid(H5T_NATIVE_FLOAT_TOKEN);} YY_BREAK case 33: YY_RULE_SETUP -#line 119 "H5LTanalyze.l" +#line 120 "H5LTanalyze.l" {return hid(H5T_NATIVE_DOUBLE_TOKEN);} YY_BREAK case 34: YY_RULE_SETUP -#line 120 "H5LTanalyze.l" +#line 121 "H5LTanalyze.l" {return hid(H5T_NATIVE_LDOUBLE_TOKEN);} YY_BREAK case 35: YY_RULE_SETUP -#line 122 "H5LTanalyze.l" +#line 123 "H5LTanalyze.l" {return token(H5T_STRING_TOKEN);} YY_BREAK case 36: YY_RULE_SETUP -#line 123 "H5LTanalyze.l" +#line 124 "H5LTanalyze.l" {return token(STRSIZE_TOKEN);} YY_BREAK case 37: YY_RULE_SETUP -#line 124 "H5LTanalyze.l" +#line 125 "H5LTanalyze.l" {return token(STRPAD_TOKEN);} YY_BREAK case 38: YY_RULE_SETUP -#line 125 "H5LTanalyze.l" +#line 126 "H5LTanalyze.l" {return token(CSET_TOKEN);} YY_BREAK case 39: YY_RULE_SETUP -#line 126 "H5LTanalyze.l" +#line 127 "H5LTanalyze.l" {return token(CTYPE_TOKEN);} YY_BREAK case 40: YY_RULE_SETUP -#line 127 "H5LTanalyze.l" +#line 128 "H5LTanalyze.l" {return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP -#line 128 "H5LTanalyze.l" +#line 129 "H5LTanalyze.l" {return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP -#line 129 "H5LTanalyze.l" +#line 130 "H5LTanalyze.l" {return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP -#line 130 "H5LTanalyze.l" +#line 131 "H5LTanalyze.l" {return token(H5T_CSET_ASCII_TOKEN);} YY_BREAK case 44: YY_RULE_SETUP -#line 131 "H5LTanalyze.l" +#line 132 "H5LTanalyze.l" {return token(H5T_CSET_UTF8_TOKEN);} YY_BREAK case 45: YY_RULE_SETUP -#line 132 "H5LTanalyze.l" +#line 133 "H5LTanalyze.l" {return token(H5T_C_S1_TOKEN);} YY_BREAK case 46: YY_RULE_SETUP -#line 133 "H5LTanalyze.l" +#line 134 "H5LTanalyze.l" {return token(H5T_FORTRAN_S1_TOKEN);} YY_BREAK case 47: YY_RULE_SETUP -#line 134 "H5LTanalyze.l" +#line 135 "H5LTanalyze.l" {return token(H5T_VARIABLE_TOKEN);} YY_BREAK case 48: YY_RULE_SETUP -#line 136 "H5LTanalyze.l" +#line 137 "H5LTanalyze.l" {return token(H5T_COMPOUND_TOKEN);} YY_BREAK case 49: YY_RULE_SETUP -#line 137 "H5LTanalyze.l" +#line 138 "H5LTanalyze.l" {return token(H5T_ENUM_TOKEN);} YY_BREAK case 50: YY_RULE_SETUP -#line 138 "H5LTanalyze.l" +#line 139 "H5LTanalyze.l" {return token(H5T_ARRAY_TOKEN);} YY_BREAK case 51: YY_RULE_SETUP -#line 139 "H5LTanalyze.l" +#line 140 "H5LTanalyze.l" {return token(H5T_VLEN_TOKEN);} YY_BREAK case 52: YY_RULE_SETUP -#line 141 "H5LTanalyze.l" +#line 142 "H5LTanalyze.l" {return token(H5T_OPAQUE_TOKEN);} YY_BREAK case 53: YY_RULE_SETUP -#line 142 "H5LTanalyze.l" +#line 143 "H5LTanalyze.l" {return token(OPQ_SIZE_TOKEN);} YY_BREAK case 54: YY_RULE_SETUP -#line 143 "H5LTanalyze.l" +#line 144 "H5LTanalyze.l" {return token(OPQ_TAG_TOKEN);} YY_BREAK case 55: YY_RULE_SETUP -#line 145 "H5LTanalyze.l" +#line 146 "H5LTanalyze.l" { if( is_str_size || (is_enum && is_enum_memb) || is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || @@ -1495,7 +1496,7 @@ YY_RULE_SETUP YY_BREAK case 56: YY_RULE_SETUP -#line 155 "H5LTanalyze.l" +#line 156 "H5LTanalyze.l" { /*if it's first quote, and is a compound field name or an enum symbol*/ if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) @@ -1510,7 +1511,7 @@ YY_RULE_SETUP case 57: /* rule 57 can match eol */ YY_RULE_SETUP -#line 165 "H5LTanalyze.l" +#line 166 "H5LTanalyze.l" { #ifdef H5_HAVE_WIN32_API H5LTyylval.sval = _strdup(H5LTyytext); @@ -1523,52 +1524,52 @@ YY_RULE_SETUP YY_BREAK case 58: YY_RULE_SETUP -#line 175 "H5LTanalyze.l" +#line 176 "H5LTanalyze.l" {return token('{');} YY_BREAK case 59: YY_RULE_SETUP -#line 176 "H5LTanalyze.l" +#line 177 "H5LTanalyze.l" {return token('}');} YY_BREAK case 60: YY_RULE_SETUP -#line 177 "H5LTanalyze.l" +#line 178 "H5LTanalyze.l" {return token('[');} YY_BREAK case 61: YY_RULE_SETUP -#line 178 "H5LTanalyze.l" +#line 179 "H5LTanalyze.l" {return token(']');} YY_BREAK case 62: YY_RULE_SETUP -#line 179 "H5LTanalyze.l" +#line 180 "H5LTanalyze.l" {return token(':');} YY_BREAK case 63: YY_RULE_SETUP -#line 180 "H5LTanalyze.l" +#line 181 "H5LTanalyze.l" {return token(';');} YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 181 "H5LTanalyze.l" +#line 182 "H5LTanalyze.l" ; YY_BREAK case 65: /* rule 65 can match eol */ YY_RULE_SETUP -#line 182 "H5LTanalyze.l" +#line 183 "H5LTanalyze.l" { return 0; } YY_BREAK case 66: YY_RULE_SETUP -#line 184 "H5LTanalyze.l" +#line 185 "H5LTanalyze.l" ECHO; YY_BREAK -#line 1553 "H5LTanalyze.c" +#line 1554 "H5LTanalyze.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TAG_STRING): yyterminate(); @@ -2537,7 +2538,7 @@ void H5LTyyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 184 "H5LTanalyze.l" +#line 185 "H5LTanalyze.l" int my_yyinput(char *buf, int max_size) diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index b9b492e..f16455b 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -23,9 +23,10 @@ #include #include "H5LTparse.h" -/* Turn off suggest const attribute warning in gcc */ -#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 +/* Turn off suggest const & malloc attribute warnings in gcc */ +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc" #endif int my_yyinput(char *, int); -- cgit v0.12 From a1e2133ec01368e4d8b8aed1568b7018d4dcb565 Mon Sep 17 00:00:00 2001 From: vchoi Date: Tue, 7 Apr 2020 22:36:14 -0500 Subject: A fix in the cleaning up code for datatype when datatype initialization via H5D__init_type() fails. The code to fix the problem is the same as what is done in H5D__open_oid(). --- src/H5Dint.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/H5Dint.c b/src/H5Dint.c index b3c2d29..730a71f 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1185,7 +1185,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, ret_value = new_dset; done: - if(!ret_value && new_dset && new_dset->shared) { + if(!ret_value && new_dset) { if(new_dset->shared) { if(new_dset->shared->layout.type == H5D_CHUNKED && layout_init) { if(H5D__chunk_dest(file, dxpl_id, new_dset) < 0) @@ -1193,8 +1193,16 @@ done: } /* end if */ if(new_dset->shared->space && H5S_close(new_dset->shared->space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataspace") - if(new_dset->shared->type && H5I_dec_ref(new_dset->shared->type_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") + if(new_dset->shared->type) { + if(new_dset->shared->type_id > 0) { + if(H5I_dec_ref(new_dset->shared->type_id) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") + } /* end if */ + else { + if(H5T_close(new_dset->shared->type) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") + } /* end else */ + } /* end if */ if(H5F_addr_defined(new_dset->oloc.addr)) { if(H5O_dec_rc_by_loc(&(new_dset->oloc), dxpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") -- cgit v0.12 From 61207a653e1ae563ef8ae7246779556a3946f4dc Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Sun, 12 Apr 2020 19:06:35 -0500 Subject: Add missing " and update function calls incorrectly named load_gcc_arguments. Commit changes to gnu-cxxflags to remove unmatched " and to gnu-fflags to not add C warnings flags to H5_FCFLAGS. --- config/gnu-cxxflags | 24 ++++++++++++------------ config/gnu-fflags | 2 +- config/gnu-flags | 22 +++++++++++----------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index 9ae38f6..deaa82d 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -119,7 +119,7 @@ if test "X-g++" = "X-$cxx_vendor"; then esac # C++-specific - H5_CXXFLAGS="$H5_CXXFLAGS $arch + H5_CXXFLAGS="$H5_CXXFLAGS $arch" ############## # Production # @@ -238,29 +238,29 @@ if test "X-g++" = "X-$cxx_vendor"; then # gcc >= 4.5 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.5)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.5)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.5)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.5)" 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_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.6)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.6)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.6)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.6)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.6)" 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_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.7)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.7)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.7)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.7)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.7)" fi # gcc >= 4.8 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.8)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.8)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.8)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.8)" fi # gcc >= 4.9 @@ -282,15 +282,15 @@ if test "X-g++" = "X-$cxx_vendor"; then # gcc >= 7 if test $cc_vers_major -ge 7; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 7)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-7)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-7)" fi # gcc 8 if test $cc_vers_major -ge 8; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 8)" H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-8)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-8)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-8)" + 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 # gcc 9 diff --git a/config/gnu-fflags b/config/gnu-fflags index 2859158..f58f10c 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -139,7 +139,7 @@ if test "X-gfortran" = "X-$f9x_vendor"; then # General # ########### - H5_FCFLAGS="$H5_CFLAGS $(load_gnu_arguments gfort-general)" + H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-general)" ############################# # Version-specific warnings # diff --git a/config/gnu-flags b/config/gnu-flags index c2904fe..ad07552 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -244,29 +244,29 @@ if test "X-gcc" = "X-$cc_vendor"; then # 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 $(load_gnu_arguments 4.5)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.5)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.5)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.5)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.5)" 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 $(load_gnu_arguments 4.6)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.6)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.6)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.6)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.6)" 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 $(load_gnu_arguments 4.7)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.7)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.7)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.7)" fi # gcc >= 4.8 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.8)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.8)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-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 @@ -288,15 +288,15 @@ if test "X-gcc" = "X-$cc_vendor"; then # gcc >= 7 if test $cc_vers_major -ge 7; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 7)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-7)" fi # gcc 8 if test $cc_vers_major -ge 8; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 8)" H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-8)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-8)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-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 -- cgit v0.12 From 67445108ca5eafe148902f16f5c0debe15b80f66 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 13 Apr 2020 08:46:13 -0500 Subject: TRILAB-192 - cleanup edits and match CMake CXX to autotools --- MANIFEST | 1 + config/cmake/HDFCXXCompilerFlags.cmake | 189 ++++++++++++++++++++++++++------- config/cmake/HDFCompilerFlags.cmake | 90 ++++++++-------- config/gnu-cxxflags | 7 +- config/gnu-warnings/cxx-4.9 | 1 + 5 files changed, 200 insertions(+), 88 deletions(-) create mode 100644 config/gnu-warnings/cxx-4.9 diff --git a/MANIFEST b/MANIFEST index 1e477ab..e98544b 100644 --- a/MANIFEST +++ b/MANIFEST @@ -147,6 +147,7 @@ ./config/gnu-warnings/8 ./config/gnu-warnings/9 ./config/gnu-warnings/cxx-general +./config/gnu-warnings/cxx-4.9 ./config/gnu-warnings/developer-4.5 ./config/gnu-warnings/developer-4.6 ./config/gnu-warnings/developer-4.7 diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index bf22886..6aa8784 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -104,6 +104,8 @@ if (NOT MSVC) endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general") endif () elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") @@ -114,47 +116,160 @@ if (NOT MSVC) message (STATUS "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}") 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") - # list (APPEND H5_CXXFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing") - # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") - # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") - # endif () - #else () - # if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") - # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") - # 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") + # list (APPEND H5_CXXFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing") + # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") + # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") + endif () + else () + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") + # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") + endif () + endif () - #if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # # Append warning flags that only gcc 4.3+ knows about - # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # Append warning flags that only gcc 4.3+ knows about + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") + # + # 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) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last") + endif () - # # Append more extra warning flags that only gcc 4.4+ know about - # if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) - # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4") - # endif () - #endif () + # Append more extra warning flags that only gcc 4.4+ know about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4") + endif () # Append more extra warning flags that only gcc 4.5+ know about - #if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5) - # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5") - # if (HDF5_ENABLE_DEV_WARNINGS) - # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5") - # else () - # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5") - # endif () - #endif () + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5") + if (HDF5_ENABLE_DEV_WARNINGS) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5") + else () + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5") + endif () + endif () + + # Append more extra warning flags that only gcc 4.6 and less know about + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6") + endif () + + # Append more extra warning flags that only gcc 4.5-4.6 know about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5-4.6") + endif () + + # Append more extra warning flags that only gcc 4.6+ know about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.6") + if (HDF5_ENABLE_DEV_WARNINGS) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.6") + else () + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.6") + endif () + endif () + + # Append more extra warning flags that only gcc 4.7+ know about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.7") + if (HDF5_ENABLE_DEV_WARNINGS) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.7") + else () + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.7") + endif () + endif () + + # Append more extra warning flags that only gcc 4.8+ know about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8") + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8") + else () + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8") + endif () + endif () + + # Append more extra warning flags that only gcc 4.9+ know about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9") + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.9") + endif () + + # Append more extra warning flags that only gcc 5.1+ know 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_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/5") + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5") + endif () + + # Append more extra warning flags that only gcc 6.x+ know about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/6") + endif () + + # Append more extra warning flags that only gcc 7.x+ know about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXxFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7") + if (HDF5_ENABLE_DEV_WARNINGS) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7") + #else () + # ADD_H5_FLAGS (H5_CXXFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7") + endif () + endif () + + # Append more extra warning flags that only gcc 8.x+ know about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") + if (HDF5_ENABLE_DEV_WARNINGS) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") + else () + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8") + endif () + endif () + + # Append more extra warning flags that only gcc 9.x+ know about + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) + # autotools always add the C flags with the CXX flags + ADD_H5_FLAGS (H5_CXXFLAGS4 "${HDF5_SOURCE_DIR}/config/gnu-warnings/9") + endif () + endif () else () list (APPEND HDF5_CMAKE_CXX_FLAGS "/EHsc") endif () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index b255e22..72141c0 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -125,47 +125,46 @@ if (NOT MSVC) message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") 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") - list (APPEND H5_CFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing") - elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") - elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") - ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") - endif () - else () - if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") - elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") - ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") - endif () + #----------------------------------------------------------------------------- + # Option to allow the user to enable developer warnings + # Developer warnings (suggestions from gcc, not code problems) + #----------------------------------------------------------------------------- + option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF) + if (HDF5_ENABLE_DEV_WARNINGS) + message (STATUS "....HDF5 developer group warnings are enabled") + if (CMAKE_C_COMPILER_ID STREQUAL "Intel") + list (APPEND H5_CFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing") + elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") + elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") + endif () + else () + if (CMAKE_C_COMPILER_ID STREQUAL "GNU") + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") + elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") endif () + endif () - if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - # Append warning flags that only gcc 4.3+ knows about - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") - # - # 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) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last") - endif () + if (CMAKE_C_COMPILER_ID STREQUAL "GNU") + # Append warning flags that only gcc 4.3+ knows about + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") + # + # 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) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last") + endif () - # Append more extra warning flags that only gcc 4.4+ know about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4") - endif () + # Append more extra warning flags that only gcc 4.4+ know about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4") 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) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5") if (HDF5_ENABLE_DEV_WARNINGS) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5") @@ -175,17 +174,17 @@ if (NOT MSVC) endif () # Append more extra warning flags that only gcc 4.6 and less know about - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6") endif () # Append more extra warning flags that only gcc 4.5-4.6 know about - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5-4.6") 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) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.6") if (HDF5_ENABLE_DEV_WARNINGS) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.6") @@ -195,7 +194,7 @@ if (NOT MSVC) 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) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.7") if (HDF5_ENABLE_DEV_WARNINGS) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.7") @@ -205,7 +204,7 @@ if (NOT MSVC) 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 (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8") if (HDF5_ENABLE_DEV_WARNINGS) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8") @@ -215,23 +214,23 @@ if (NOT MSVC) 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) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9") 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.0) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/5") ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5") 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) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/6") 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) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0) ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7") if (HDF5_ENABLE_DEV_WARNINGS) ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7") @@ -241,7 +240,7 @@ if (NOT MSVC) 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) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0) ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") if (HDF5_ENABLE_DEV_WARNINGS) ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") @@ -251,9 +250,10 @@ if (NOT MSVC) 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) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0) ADD_H5_FLAGS (H5_CFLAGS4 "${HDF5_SOURCE_DIR}/config/gnu-warnings/9") endif () + endif () endif () #----------------------------------------------------------------------------- diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index deaa82d..e177aef 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -266,6 +266,7 @@ if test "X-g++" = "X-$cxx_vendor"; then # gcc >= 4.9 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 9; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.9)" + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-4.9)" fi # gcc >= 5 @@ -304,12 +305,6 @@ if test "X-g++" = "X-$cxx_vendor"; then cxx_flags_set=yes fi -# Version-specific g++ flags - - - # Append more extra warning flags that only gcc 4.9+ know about - -Wopenmp-simd" - # Clear cxx info if no flags set if test "X$cxx_flags_set" = "X"; then cxx_vendor= diff --git a/config/gnu-warnings/cxx-4.9 b/config/gnu-warnings/cxx-4.9 new file mode 100644 index 0000000..046d6db --- /dev/null +++ b/config/gnu-warnings/cxx-4.9 @@ -0,0 +1 @@ +-Wopenmp-simd -- cgit v0.12 From 60f1dc597b6dcd2965c50ad28c321d7c1f896896 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 13 Apr 2020 10:30:36 -0500 Subject: Fix shadowed type --- hl/c++/test/ptableTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index e873503..fd85828 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -142,7 +142,7 @@ int TestCompoundDatatype() HDfflush(stdout); /* Create compound datatype */ - typedef struct compoundType + typedef struct { short a, b, c; int e; @@ -479,7 +479,7 @@ int SystemTest() /* Creating two inter-related datatypes. Create two datasets and put * one datatype in each. */ - typedef struct compoundType + typedef struct { short a, b, c; int e; @@ -492,7 +492,7 @@ int SystemTest() H5Tinsert(dtypeID1, "charlie", HOFFSET( compoundType, c ), H5T_NATIVE_SHORT); H5Tinsert(dtypeID1, "ebert", HOFFSET( compoundType, e ), H5T_NATIVE_INT); - typedef struct cType2 + typedef struct { char f; compoundType g; -- cgit v0.12 From a18c0a882f54da3b61e1d54d16ec8dce0759cac1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 14 Apr 2020 08:10:38 -0500 Subject: TRILAB-192 correct fortran commands --- CMakeLists.txt | 3 -- fortran/src/CMakeLists.txt | 13 ++--- fortran/test/CMakeLists.txt | 2 +- fortran/test/CMakeTests.cmake | 117 +++++++++++++++++++++++++++++++++++++++--- 4 files changed, 113 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fadc18..ca9747e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -716,9 +716,6 @@ if (BUILD_TESTING) option (HDF_TEST_EXPRESS "Control testing framework (0-3)" "0") mark_as_advanced (HDF_TEST_EXPRESS) - option (TEST_SHARED_PROGRAMS "Enable testing of Shared programs" OFF) - mark_as_advanced (TEST_SHARED_PROGRAMS) - enable_testing () include (CTest) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index c2b4ed7..243be63 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -43,22 +43,15 @@ set_target_properties (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -#set_property(TARGET H5test_FortranHavekind APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> -#) -#target_compile_definitions(H5test_FortranHavekind -# PRIVATE $<$:/MT> -#) +#set_property(TARGET H5test_FortranHavekind APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +#target_compile_definitions(H5test_FortranHavekind PRIVATE $<$:/MT>) if (MSVC) set_target_properties (H5test_FortranHavekind PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" COMPILE_FLAGS "/MT" ) endif () -target_include_directories(H5test_FortranHavekind - PRIVATE - "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}" -) +target_include_directories(H5test_FortranHavekind PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}") add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 211190f..40e2906 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -283,7 +283,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) add_dependencies (fflush1 ${HDF5_F90_TEST_LIBSH_TARGET}) else () - target_include_directories (fflush1 PRIVATE${CMAKE_Fortran_MODULE_DIRECTORY}/static) + target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib>) set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index 9917f1a..0748443 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -16,19 +16,120 @@ ############################################################################## ############################################################################## -add_test (NAME FORTRAN_testhdf5_fortran COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) -set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") +set (testhdf5_fortran_CLEANFILES + a.h5 + b.h5 + c.h5 + d.h5 + dsetf_F03.h5 + enum1.h5 + extern_1a.raw + extern_2a.raw + extern_3a.raw + extern_4a.raw + extren_raw.raw + get_info.h5 + nbit.h5 + t_array_F03.h5 + t_bit_F03.h5 + t_controlchar_F03.h5 + t_enum_F03.h5 + t_objref_F03.h5 + t_opaque_F03.h5 + t_regref_F03.h5 + t_string_F03.h5 + t_vlen_F03.h5 + t_vlstring_F03.h5 + t_vlstringrw_F03.h5 + tarray1.h5 + tarray2.h5 + tarray3.h5 + test_create.h5 + tget_file_image.h5 + th5o_ref.h5 + titerate.h5 + visit.h5 +) + +# Remove any output file left over from previous test run +add_test ( + NAME FORTRAN_testhdf5-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${testhdf5_fortran_CLEANFILES} +) +set_tests_properties (FORTRAN_testhdf5-clear-objects PROPERTIES FIXTURES_SETUP clear_testhdf5_fortran) + +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_testhdf5_fortran COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) +else () + add_test (NAME FORTRAN_testhdf5_fortran COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=testhdf5_fortran.txt" + #-D "TEST_REFERENCE=testhdf5_fortran.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +#set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") +set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES + FIXTURES_REQUIRED clear_testhdf5_fortran +) #-- Adding test for testhdf5_fortran_1_8 -add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) -set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") -set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) +else () + add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=testhdf5_fortran_1_8.txt" + #-D "TEST_REFERENCE=testhdf5_fortran_1_8.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +#set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") +#set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran) +set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES + DEPENDS FORTRAN_testhdf5_fortran + FIXTURES_REQUIRED clear_testhdf5_fortran +) #-- Adding test for fortranlib_test_F03 if (HDF5_ENABLE_F2003) - add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) - set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") - set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) + else () + add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=fortranlib_test_F03.txt" + #-D "TEST_REFERENCE=fortranlib_test_F03.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () +# set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") +# set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8) + set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES + DEPENDS FORTRAN_testhdf5_fortran_1_8 + FIXTURES_REQUIRED clear_testhdf5_fortran + ) endif () #-- Adding test for fflush1 -- cgit v0.12 From 42237dc633f75bec0c889e9e9748cd5cd1392028 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 14 Apr 2020 08:32:21 -0500 Subject: TRILAB-192 version of std=f2008 special check --- config/cmake/HDFFortranCompilerFlags.cmake | 89 ++++++++++++++++-------------- 1 file changed, 47 insertions(+), 42 deletions(-) diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index f31eba5..a56ef28 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -73,7 +73,12 @@ if (NOT MSVC) 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" "-std=f2008" "-fimplicit-none") + 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 () @@ -82,57 +87,57 @@ if (NOT MSVC) if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") # Append warning flags that only gcc 4.4+ knows about ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.4") - endif () - # Append more extra warning flags that only gcc 4.5+ know about - if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.5) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.5") - endif () + # Append more extra warning flags that only gcc 4.5+ know about + if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.5) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.5") + endif () - # Append more extra warning flags that only gcc 4.6+ know about - #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6) - # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.6") - #endif () + # Append more extra warning flags that only gcc 4.6+ know about + #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6) + # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.6") + #endif () - # Append more extra warning flags that only gcc 4.7+ know about - if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.7) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.7") - endif () + # Append more extra warning flags that only gcc 4.7+ know about + if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.7) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.7") + endif () - # Append more extra warning flags that only gcc 4.8+ know about - if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND 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.8+ know 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+ know about - #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND 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 4.9+ know 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.1+ know about - if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5") - endif () + # Append more extra warning flags that only gcc 5.1+ know about + if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5") + endif () - # Append more extra warning flags that only gcc 6.x+ know about - if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND 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 6.x+ know 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+ know about - #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND 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 7.x+ know 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+ know about - if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND 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 8.x+ know 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+ know about - #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND 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 () + # Append more extra warning flags that only gcc 9.x+ know 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") -- cgit v0.12 From 0dba296cec0d3e9391e1cbb0f6daa0df9f0a750a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 14 Apr 2020 10:47:24 -0500 Subject: Fix shadow variable --- c++/test/tobject.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index b5e9ff0..095fe6a 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -76,7 +76,7 @@ static void test_get_objname() // Attempted to create a same group to generate a failure, which should // be caught with sub-class exception clause, if available. try { - Group grp1_2 = grp1.createGroup(GROUP1_2, 0); + grp1_2 = grp1.createGroup(GROUP1_2, 0); } catch (GroupIException& E) {} // do nothing, exception expected @@ -301,7 +301,7 @@ static void test_get_objtype() issue_fail_msg("test_get_objtype", __LINE__, __FILE__); } } // test_get_objtype - + /*------------------------------------------------------------------------- * Function: test_open_object_header * @@ -435,7 +435,7 @@ static void test_open_object_header() issue_fail_msg("test_file_name()", __LINE__, __FILE__, E.getCDetailMsg()); } } /* test_open_object_header() */ - + /*------------------------------------------------------------------------- * Function: test_is_valid * -- cgit v0.12 From 193395309a0ec23b00eeb27aa616d7126de98f32 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 15 Apr 2020 13:19:45 -0500 Subject: Add prefix_relto_examplesdir function to set relative path to h5c++. --- c++/examples/run-c++-ex.sh.in | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in index 4667878..d05b120 100644 --- a/c++/examples/run-c++-ex.sh.in +++ b/c++/examples/run-c++-ex.sh.in @@ -30,6 +30,29 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 +# +# Try to derive the path to the installation $prefix established +# by ./configure relative to the examples directory established by +# ./configure. If successful, set `prefix_relto_examplesdir` to the +# relative path. Otherwise, set `prefix_relto_examplesdir` to the +# absolute installation $prefix. +# +# This script uses the value of `prefix` in the user's environment, if +# it is set, below. The content of $() is evaluated in a sub-shell, so +# if `prefix` is set in the user's environment, the shell statements in +# $() won't clobber it. +# +prefix_relto_examplesdir=$( +prefix=@prefix@ +examplesdir=@examplesdir@ +if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then + echo $(echo ${examplesdir##${prefix}/} | \ + sed 's,[^/][^/]*,..,g') +else + echo $prefix +fi +) + # Where the tool is installed. # default is relative path to installed location of the tools prefix="${prefix:-../${prefix_relto_examplesdir}}" -- cgit v0.12 From 6c76addf3d16d681ee9ec1fcd06ad9bee24c2565 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Apr 2020 08:20:44 -0500 Subject: TRILAB-192 - parser files cannot handle this warning --- config/gnu-warnings/error-general | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/gnu-warnings/error-general b/config/gnu-warnings/error-general index f0e61f8..4b822a5 100644 --- a/config/gnu-warnings/error-general +++ b/config/gnu-warnings/error-general @@ -12,12 +12,15 @@ -Werror=packed -Werror=pointer-sign -Werror=pointer-to-int-cast --Werror=redundant-decls -Werror=strict-prototypes -Werror=switch # #-Werror=discarded-qualifiers # +# NOTE: hl/src/H5LTparse.c file is not compatible with these warnings as errors +# -Werror=redundant-decls +# +-Wredundant-decls # # NOTE: File Driver files are not compatible with these warnings as errors # H5FDdirect.c,H5FDmpio.c,H5FDros3.c, -- cgit v0.12 From 04e4ef5c14a121650497d18d8e63968605a912ed Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 19 Jul 2019 02:48:00 -0500 Subject: Parallel Fortran tests now use the MPI module instead of including mpif.h. --- fortran/testpar/hyper.f90 | 3 ++- fortran/testpar/mdset.f90 | 3 ++- fortran/testpar/ptest.f90 | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fortran/testpar/hyper.f90 b/fortran/testpar/hyper.f90 index 844ad56..b739db4 100644 --- a/fortran/testpar/hyper.f90 +++ b/fortran/testpar/hyper.f90 @@ -18,9 +18,10 @@ SUBROUTINE hyper(length,do_collective,do_chunk, mpi_size, mpi_rank, nerrors) USE HDF5 + USE MPI USE TH5_MISC + IMPLICIT NONE - INCLUDE 'mpif.h' INTEGER, INTENT(in) :: length ! array length LOGICAL, INTENT(in) :: do_collective ! use collective I/O diff --git a/fortran/testpar/mdset.f90 b/fortran/testpar/mdset.f90 index 70d2939..3de61c3 100644 --- a/fortran/testpar/mdset.f90 +++ b/fortran/testpar/mdset.f90 @@ -18,9 +18,10 @@ SUBROUTINE multiple_dset_write(length, do_collective, do_chunk, mpi_size, mpi_rank, nerrors) USE HDF5 + USE MPI USE TH5_MISC + IMPLICIT NONE - INCLUDE 'mpif.h' INTEGER, INTENT(in) :: length ! array length LOGICAL, INTENT(in) :: do_collective ! use collective I/O diff --git a/fortran/testpar/ptest.f90 b/fortran/testpar/ptest.f90 index 432b443..a399fe9 100644 --- a/fortran/testpar/ptest.f90 +++ b/fortran/testpar/ptest.f90 @@ -16,10 +16,11 @@ !////////////////////////////////////////////////////////// PROGRAM parallel_test - USE hdf5 + USE HDF5 + USE MPI + USE TH5_MISC IMPLICIT NONE - INCLUDE 'mpif.h' INTEGER :: mpierror ! MPI hdferror flag INTEGER :: hdferror ! HDF hdferror flag -- cgit v0.12