summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2018-10-05 05:20:36 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2018-10-05 05:20:36 (GMT)
commitca19f8412b49c78fde40e2b3814f53a63a9a0c7b (patch)
tree797d6174e2f5aa2a9b46c9a8d7ff7bc49c6d13d5
parent687fdba54482884f5caa3c3ec98c3d4e230cbb0e (diff)
parent1528b884cbbad8efe71ecaa44575a3a06d47214e (diff)
downloadhdf5-ca19f8412b49c78fde40e2b3814f53a63a9a0c7b.zip
hdf5-ca19f8412b49c78fde40e2b3814f53a63a9a0c7b.tar.gz
hdf5-ca19f8412b49c78fde40e2b3814f53a63a9a0c7b.tar.bz2
Merge pull request #1280 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:hdf5_1_10_4 to hdf5_1_10_4
* commit '1528b884cbbad8efe71ecaa44575a3a06d47214e': Merge hdf5_1_10 changes to hdf5_1_10_4. Merge in changes from hdf5_1_10.
-rw-r--r--CMakeLists.txt3
-rw-r--r--MANIFEST2
-rw-r--r--README.txt2
-rw-r--r--config/cmake/HDF518_Examples.cmake.in2
-rw-r--r--config/cmake/HDF5UseFortran.cmake147
-rw-r--r--config/cmake/HDF5_Examples.cmake.in2
-rw-r--r--config/cmake/HDFCompilerFlags.cmake77
-rwxr-xr-xconfig/cmake/scripts/HDF5options.cmake5
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake48
-rw-r--r--config/cmake_ext_mod/HDFLibMacros.cmake9
-rw-r--r--config/cmake_ext_mod/HDFMacros.cmake15
-rw-r--r--config/intel.cmake10
-rw-r--r--fortran/src/H5config_f.inc.cmake36
-rw-r--r--fortran/test/tH5F.F902
-rw-r--r--java/test/TestH5E.java18
-rw-r--r--java/test/TestH5Edefault.java43
-rw-r--r--release_docs/INSTALL_CMake.txt37
-rw-r--r--release_docs/INSTALL_Cygwin.txt12
-rw-r--r--release_docs/RELEASE.txt79
-rw-r--r--src/CMakeLists.txt101
-rw-r--r--src/H5detect.c961
-rw-r--r--src/H5make_libsettings.c252
-rw-r--r--test/CMakeLists.txt2
-rw-r--r--test/CMakeTests.cmake66
-rw-r--r--tools/src/h5dump/h5dump.c2
-rw-r--r--tools/src/h5format_convert/h5format_convert.c164
-rw-r--r--tools/src/h5jam/h5jam.c30
-rw-r--r--tools/src/misc/h5debug.c2
-rw-r--r--tools/test/h5copy/CMakeTests.cmake3
-rw-r--r--tools/test/h5dump/CMakeTests.cmake3
-rw-r--r--tools/test/h5dump/CMakeTestsXML.cmake3
-rw-r--r--tools/test/h5import/CMakeTests.cmake3
-rw-r--r--tools/test/h5repack/CMakeTests.cmake24
33 files changed, 1158 insertions, 1007 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a0a039..24bb83d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,6 +46,9 @@ endif ()
# dependencies of the HDF5 libs may be 'incomplete', add additional
# dependencies to this variable so that external projects pick them up
#
+#option (HDF5_EXTERNAL_LIB_PREFIX "Use prefix for custom library naming." "")
+set (HDF5_EXTERNAL_LIB_PREFIX "" CACHE STRING "Use prefix for custom library naming.")
+mark_as_advanced (HDF5_EXTERNAL_LIB_PREFIX)
# HDF5_EXTERNAL_LIB_PREFIX :
# If the parent project needs to install hdf libraries, but avoid
# name conflicts with system versions, then a prefix may be added
diff --git a/MANIFEST b/MANIFEST
index 3b92b1a..11611d6 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3146,6 +3146,8 @@
./java/lib/ext/slf4j-simple-1.7.25.jar
# CMake-specific Files
+./config/intel.cmake
+
./config/cmake/cacheinit.cmake
./config/cmake/CMakeFindJavaCommon.cmake
./config/cmake/ConversionTests.c
diff --git a/README.txt b/README.txt
index 21fd1a6..f047cb0 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.10.4 released on 2018-09-10
+HDF5 version 1.10.4 currently under development
------------------------------------------------------------------------------
Please refer to the release_docs/INSTALL file for installation instructions.
diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in
index 1f4f479..ba79ef2 100644
--- a/config/cmake/HDF518_Examples.cmake.in
+++ b/config/cmake/HDF518_Examples.cmake.in
@@ -48,7 +48,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${
##################################################################
if(NOT DEFINED INSTALLDIR)
- set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@")
+ set(INSTALLDIR "C:/Program Files/HDF_Group/@HDF5_PACKAGE_NAME@/@HDF5_PACKAGE_VERSION@")
endif()
if(NOT DEFINED CTEST_SOURCE_NAME)
diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake
index 1f66bad..157befd 100644
--- a/config/cmake/HDF5UseFortran.cmake
+++ b/config/cmake/HDF5UseFortran.cmake
@@ -31,69 +31,53 @@ endif ()
# The provided CMake Fortran macros don't provide a general compile/run function
# so this one is used.
#-----------------------------------------------------------------------------
-macro (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN)
-#
-# if (NOT DEFINED ${RUN_RESULT_VAR})
- message (STATUS "Detecting Fortran ${FUNCTION}")
- if (CMAKE_REQUIRED_LIBRARIES)
- set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
- "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- else ()
- set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
- endif ()
+macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 RETURN_VAR)
+ message (STATUS "Detecting Fortran ${FUNCTION_NAME}")
file (WRITE
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90
- "${CODE}"
+ "${SOURCE_CODE}"
)
TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90
- CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
- RUN_OUTPUT_VARIABLE OUTPUT
+ LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}"
)
- set(${RETURN} ${OUTPUT})
-
- #message ( "Test result1 ${RETURN} ")
- #message ( "Test result3 ${RESULT} ")
- #message ( "Test result2 ${CMAKE_MATCH_0} ")
- #message ( "Test result4 ${CMAKE_MATCH_1} ")
- #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
- #message ( "Test result2 ${COMPILE_RESULT_VAR} ")
- #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
- #message ( "Test result1 ${RUN_RESULT_VAR} ")
- #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
-
if (${COMPILE_RESULT_VAR})
+ set(${RETURN_VAR} ${RUN_RESULT_VAR})
if (${RUN_RESULT_VAR} MATCHES 0)
- message (STATUS "Testing Fortran ${FUNCTION} - OK")
+ message (STATUS "Testing Fortran ${FUNCTION_NAME} - OK")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n"
- "${OUTPUT}\n\n"
+ "Determining if the Fortran ${FUNCTION_NAME} exists passed\n"
)
else ()
- message (STATUS "Testing Fortran ${FUNCTION} - Fail")
+ message (STATUS "Testing Fortran ${FUNCTION_NAME} - Fail")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
- "${OUTPUT}\n\n")
+ "Determining if the Fortran ${FUNCTION_NAME} exists failed: ${RUN_RESULT_VAR}\n"
+ )
endif ()
+ else ()
+ message (STATUS "Compiling Fortran ${FUNCTION_NAME} - Fail")
+ file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if the Fortran ${FUNCTION_NAME} compiles failed: ${COMPILE_RESULT_VAR}\n"
+ )
+ set(${RETURN_VAR} ${COMPILE_RESULT_VAR})
endif ()
-# endif ()
endmacro ()
# Read source line beginning at the line matching Input:"START" and ending at the line matching Input:"END"
-macro (READ_SOURCE START END RETURN)
- file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" CODE)
- string (REGEX MATCH "${START}[\\\t\\\n\\\r[].+]*${END}" CODE ${CODE})
- set (RETURN "${CODE}")
+macro (READ_SOURCE SOURCE_START SOURCE_END RETURN_VAR)
+ file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_CODE)
+ string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_CODE})
+ set (RETURN_VAR "${SOURCE_CODE}")
endmacro ()
#-----------------------------------------------------------------------------
# Check to see C_LONG_DOUBLE is available
-READ_SOURCE("PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" "END PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" CODE)
+READ_SOURCE("PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" "END PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" SOURCE_CODE)
CHECK_FORTRAN_FEATURE(c_long_double
- "${CODE}"
+ "${SOURCE_CODE}"
FORTRAN_HAVE_C_LONG_DOUBLE
)
@@ -105,9 +89,9 @@ endif ()
# Check to see C_LONG_DOUBLE is different from C_DOUBLE
-READ_SOURCE("MODULE type_mod" "END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE" CODE)
+READ_SOURCE("MODULE type_mod" "END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE" SOURCE_CODE)
CHECK_FORTRAN_FEATURE(c_long_double
- "${CODE}"
+ "${SOURCE_CODE}"
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE
)
if (${FORTRAN_C_LONG_DOUBLE_IS_UNIQUE})
@@ -133,12 +117,12 @@ endif ()
# Determine the available KINDs for REALs and INTEGERs
#-----------------------------------------------------------------------------
-READ_SOURCE ("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" CODE)
+READ_SOURCE ("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" SOURCE_CODE)
FORTRAN_RUN ("REAL and INTEGER KINDs"
- "${CODE}"
- XX
- YY
- PROG_OUTPUT
+ "${SOURCE_CODE}"
+ XX
+ YY
+ PROG_RESULT
)
# dnl The output from the above program will be:
# dnl -- LINE 1 -- valid integer kinds (comma seperated list)
@@ -197,15 +181,18 @@ foreach (KIND ${VAR} )
USE ISO_C_BINDING
IMPLICIT NONE
INTEGER (KIND=${KIND}) a
- WRITE(*,'(I0)') ${FC_SIZEOF_A}
+ OPEN(8,FILE='pac_validIntKinds.out',FORM='formatted')
+ WRITE(8,'(I0)') ${FC_SIZEOF_A}
+ CLOSE(8)
END
"
)
FORTRAN_RUN("INTEGER KIND SIZEOF" ${PROG_SRC}
- XX
- YY
- PROG_OUTPUT1
+ XX
+ YY
+ PROG_RESULT1
)
+ file (READ "${CMAKE_BINARY_DIR}/pac_validIntKinds.out" PROG_OUTPUT1)
string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}")
set (pack_int_sizeof "${pack_int_sizeof} ${PROG_OUTPUT1},")
endforeach ()
@@ -241,15 +228,18 @@ foreach (KIND ${VAR} )
USE ISO_C_BINDING
IMPLICIT NONE
REAL (KIND=${KIND}) a
- WRITE(*,'(I0)') ${FC_SIZEOF_A}
+ OPEN(8,FILE='pac_validRealKinds.out',FORM='formatted')
+ WRITE(8,'(I0)') ${FC_SIZEOF_A}
+ CLOSE(8)
END
"
)
FORTRAN_RUN ("REAL KIND SIZEOF" ${PROG_SRC}
- XX
- YY
- PROG_OUTPUT1
+ XX
+ YY
+ PROG_RESULT1
)
+ file (READ "${CMAKE_BINARY_DIR}/pac_validRealKinds.out" PROG_OUTPUT1)
string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}")
set (pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},")
endforeach ()
@@ -288,18 +278,21 @@ FORTRAN_RUN ("SIZEOF NATIVE KINDs"
INTEGER a
REAL b
DOUBLE PRECISION c
- WRITE(*,*) ${FC_SIZEOF_A}
- WRITE(*,*) kind(a)
- WRITE(*,*) ${FC_SIZEOF_B}
- WRITE(*,*) kind(b)
- WRITE(*,*) ${FC_SIZEOF_C}
- WRITE(*,*) kind(c)
+ OPEN(8,FILE='pac_sizeof_native_kinds.out',FORM='formatted')
+ WRITE(8,*) ${FC_SIZEOF_A}
+ WRITE(8,*) kind(a)
+ WRITE(8,*) ${FC_SIZEOF_B}
+ WRITE(8,*) kind(b)
+ WRITE(8,*) ${FC_SIZEOF_C}
+ WRITE(8,*) kind(c)
+ CLOSE(8)
END
"
- XX
- YY
- PROG_OUTPUT
-)
+ XX
+ YY
+ PROG_RESULT
+ )
+ file (READ "${CMAKE_BINARY_DIR}/pac_sizeof_native_kinds.out" PROG_OUTPUT)
# dnl The output from the above program will be:
# dnl -- LINE 1 -- sizeof INTEGER
# dnl -- LINE 2 -- kind of INTEGER
@@ -372,8 +365,8 @@ ENABLE_LANGUAGE (C)
# The provided CMake C macros don't provide a general compile/run function
# so this one is used.
#-----------------------------------------------------------------------------
-macro (C_RUN FUNCTION CODE RETURN)
- message (STATUS "Detecting C ${FUNCTION}")
+macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR)
+ message (STATUS "Detecting C ${FUNCTION_NAME}")
if (CMAKE_REQUIRED_LIBRARIES)
set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
@@ -382,16 +375,16 @@ macro (C_RUN FUNCTION CODE RETURN)
endif ()
file (WRITE
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c
- ${CODE}
+ ${SOURCE_CODE}
)
TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c
CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
- RUN_OUTPUT_VARIABLE OUTPUT
+ RUN_OUTPUT_VARIABLE OUTPUT_VAR
)
- set (${RETURN} ${OUTPUT})
+ set (${RETURN_VAR} ${OUTPUT_VAR})
#message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
#message ( "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ")
@@ -401,21 +394,21 @@ macro (C_RUN FUNCTION CODE RETURN)
if (${COMPILE_RESULT_VAR})
if (${RUN_RESULT_VAR} MATCHES 1)
- set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION}")
- message (STATUS "Testing C ${FUNCTION} - OK")
+ set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION_NAME}")
+ message (STATUS "Testing C ${FUNCTION_NAME} - OK")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining if the C ${FUNCTION} exists passed with the following output:\n"
- "${OUTPUT}\n\n"
+ "Determining if the C ${FUNCTION_NAME} exists passed with the following output:\n"
+ "${OUTPUT_VAR}\n\n"
)
else ()
- message (STATUS "Testing C ${FUNCTION} - Fail")
- set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION}")
+ message (STATUS "Testing C ${FUNCTION_NAME} - Fail")
+ set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION_NAME}")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if the C ${FUNCTION} exists failed with the following output:\n"
- "${OUTPUT}\n\n")
+ "Determining if the C ${FUNCTION_NAME} exists failed with the following output:\n"
+ "${OUTPUT_VAR}\n\n")
endif ()
else ()
- message (FATAL_ERROR "Compilation of C ${FUNCTION} - Failed")
+ message (FATAL_ERROR "Compilation of C ${FUNCTION_NAME} - Failed")
endif ()
endmacro ()
diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in
index bbe632c..d30f2ab 100644
--- a/config/cmake/HDF5_Examples.cmake.in
+++ b/config/cmake/HDF5_Examples.cmake.in
@@ -70,7 +70,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDN
#TAR_SOURCE - name of tarfile
#if(NOT DEFINED TAR_SOURCE)
-# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.5-Source")
+# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.10-Source")
#endif()
###############################################################################################################
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index ec13272..93ebc3c 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -24,7 +24,7 @@ if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common")
endif ()
else ()
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt")
endif ()
endif ()
@@ -36,7 +36,7 @@ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common")
endif ()
else ()
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+ 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 ()
@@ -94,16 +94,29 @@ 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.
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wbad-function-cast -Wc++-compat -Wcast-align")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings")
- # gcc automatically inlines based on the optimization level
- # this is just a failsafe
- set (H5_CFLAGS0 "${H5_CFLAGS0} -finline-functions")
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wcheck -Wall")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wreturn-type -Wstrict-prototypes -Wuninitialized")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wunknown-pragmas -Wunused-function -Wunused-variable")
+ # this is just a failsafe
+ set (H5_CFLAGS0 "${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")
+ endif()
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wbad-function-cast -Wc++-compat -Wcast-align")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings")
+ # gcc automatically inlines based on the optimization level
+ # this is just a failsafe
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -finline-functions")
+ endif ()
endif ()
#-----------------------------------------------------------------------------
@@ -113,28 +126,36 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF)
if (HDF5_ENABLE_DEV_WARNINGS)
message (STATUS "....HDF5 developer group warnings are enabled")
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn")
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Winline -Wreorder -Wport -Wstrict-aliasing")
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn")
+ endif ()
else ()
- set (H5_CFLAGS0 "${H5_CFLAGS0} -Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn")
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ set (H5_CFLAGS0 "${H5_CFLAGS0} -Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn")
+ endif ()
endif ()
- # Append warning flags that only gcc 4.3+ knows about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- set (H5_CFLAGS1 "${H5_CFLAGS1} -Wlogical-op -Wlarger-than=2048 -Wvla")
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ # Append warning flags that only gcc 4.3+ knows about
+ #
+ # Technically, variable-length arrays are part of the C99 standard, but
+ # we should approach them a bit cautiously... -QAK
+ set (H5_CFLAGS1 "${H5_CFLAGS1} -Wlogical-op -Wlarger-than=2048 -Wvla")
- # Append more extra warning flags that only gcc 4.4+ know about
- set (H5_CFLAGS1 "${H5_CFLAGS1} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat")
+ # 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")
+ endif ()
# Append more extra warning flags that only gcc 4.5+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
set (H5_CFLAGS1 "${H5_CFLAGS1} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants")
endif ()
# Append more extra warning flags that only gcc 4.6+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdouble-promotion -Wtrampolines")
if (HDF5_ENABLE_DEV_WARNINGS)
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=const")
@@ -144,7 +165,7 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
endif ()
# Append more extra warning flags that only gcc 4.7+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wstack-usage=8192 -Wvector-operation-performance")
if (HDF5_ENABLE_DEV_WARNINGS)
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn")
@@ -154,7 +175,7 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
endif ()
# Append more extra warning flags that only gcc 4.8+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
if (HDF5_ENABLE_DEV_WARNINGS)
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=format")
else ()
@@ -163,17 +184,17 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
endif ()
# Append more extra warning flags that only gcc 4.9+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdate-time")
endif ()
# Append more extra warning flags that only gcc 5.1+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1)
+ 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")
endif ()
# Append more extra warning flags that only gcc 6.x+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
+ 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")
endif ()
diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake
index 3e6aad0..80a28d3 100755
--- a/config/cmake/scripts/HDF5options.cmake
+++ b/config/cmake/scripts/HDF5options.cmake
@@ -96,3 +96,8 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON")
#############################################################################################
+### use a toolchain file
+
+#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/intel.cmake")
+
+#############################################################################################
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 9be30f7..4204511 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -142,10 +142,6 @@ endif ()
macro (HDF_FUNCTION_TEST OTHER_TEST)
if (NOT DEFINED ${HDF_PREFIX}_${OTHER_TEST})
set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}")
- set (OTHER_TEST_ADD_LIBRARIES)
- if (CMAKE_REQUIRED_LIBRARIES)
- set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- endif ()
foreach (def
HAVE_SYS_TIME_H
@@ -168,8 +164,8 @@ macro (HDF_FUNCTION_TEST OTHER_TEST)
TRY_COMPILE (${OTHER_TEST}
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
- "${OTHER_TEST_ADD_LIBRARIES}"
+ COMPILE_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS}"
+ LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT
)
if (${OTHER_TEST})
@@ -282,8 +278,7 @@ if (NOT WINDOWS)
TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS
- OUTPUT_VARIABLE OUTPUT
+ COMPILE_DEFINITIONS "-DTEST_LFS_WORKS"
)
# The LARGEFILE definitions were from the transition period
@@ -300,14 +295,14 @@ if (NOT WINDOWS)
set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
message (STATUS "${msg}... no")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n"
+ "Test TEST_LFS_WORKS Run failed with the following exit code:\n ${TEST_LFS_WORKS_RUN}\n"
)
endif ()
else ()
set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
message (STATUS "${msg}... no")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n"
+ "Test TEST_LFS_WORKS Compile failed\n"
)
endif ()
endif ()
@@ -574,30 +569,21 @@ if (WINDOWS)
"${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
)
endif ()
- set (MACRO_CHECK_FUNCTION_DEFINITIONS
- "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}")
- if (CMAKE_REQUIRED_LIBRARIES)
- set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
- "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- else ()
- set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
- endif ()
+ set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}")
if (CMAKE_REQUIRED_INCLUDES)
- set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
- "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
else ()
set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
endif ()
TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED
- ${CMAKE_BINARY_DIR}
- ${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
- -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
- "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
- "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
- COMPILE_OUTPUT_VARIABLE OUTPUT)
+ ${CMAKE_BINARY_DIR}
+ ${HDF_RESOURCES_EXT_DIR}/HDFTests.c
+ COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${MACRO_CHECK_FUNCTION_DEFINITIONS}"
+ LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}"
+ CMAKE_FLAGS "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES} -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}"
+ COMPILE_OUTPUT_VARIABLE OUTPUT
+ )
# if it did not compile make the return value fail code of 1
if (NOT HAVE_IOEO_COMPILED)
set (HAVE_IOEO_EXITCODE 1)
@@ -648,8 +634,8 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "
TRY_RUN (${HDF_PREFIX}_PRINTF_LL_TEST_RUN ${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS}
- OUTPUT_VARIABLE OUTPUT
+ COMPILE_DEFINITIONS "${CURRENT_TEST_DEFINITIONS}"
+ RUN_OUTPUT_VARIABLE OUTPUT
)
if (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE)
if (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0)
@@ -661,7 +647,7 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "
endif ()
else ()
file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
- "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed with the following output:\n ${OUTPUT}\n"
+ "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed\n"
)
endif ()
diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake
index 54e408b..8a37af3 100644
--- a/config/cmake_ext_mod/HDFLibMacros.cmake
+++ b/config/cmake_ext_mod/HDFLibMacros.cmake
@@ -30,6 +30,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
elseif (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (JPEG
@@ -47,6 +48,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (JPEG
@@ -64,6 +66,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
endif ()
externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR)
@@ -121,6 +124,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
elseif (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (SZIP
@@ -139,6 +143,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (SZIP
@@ -157,6 +162,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
endif ()
externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR)
@@ -213,6 +219,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
elseif (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (ZLIB
@@ -230,6 +237,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (ZLIB
@@ -247,6 +255,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
+ -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
)
endif ()
externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR)
diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake
index aa18022..147ae2f 100644
--- a/config/cmake_ext_mod/HDFMacros.cmake
+++ b/config/cmake_ext_mod/HDFMacros.cmake
@@ -358,6 +358,21 @@ macro (HDF_DIR_PATHS package_prefix)
endif ()
endif ()
+ set (CMAKE_SKIP_BUILD_RPATH FALSE)
+ set (CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
+ set (CMAKE_BUILD_WITH_INSTALL_RPATH ON)
+ if (APPLE)
+ set (CMAKE_INSTALL_NAME_DIR "@rpath")
+ set (CMAKE_INSTALL_RPATH
+ "@executable_path/../${${package_prefix}_INSTALL_LIB_DIR}"
+ "@executable_path/"
+ "@loader_path/../${${package_prefix}_INSTALL_LIB_DIR}"
+ "@loader_path/"
+ )
+ else ()
+ set (CMAKE_INSTALL_RPATH "\$ORIGIN/../${${package_prefix}_INSTALL_LIB_DIR}:\$ORIGIN/")
+ endif ()
+
if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}")
set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH})
endif ()
diff --git a/config/intel.cmake b/config/intel.cmake
new file mode 100644
index 0000000..f1a5734
--- /dev/null
+++ b/config/intel.cmake
@@ -0,0 +1,10 @@
+# Uncomment the following to use cross-compiling
+#set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_COMPILER_VENDOR "intel")
+
+set(CMAKE_C_COMPILER icc)
+set(CMAKE_CXX_COMPILER icpc)
+set(CMAKE_Fortran_COMPILER ifort)
+
+# the following is used if cross-compiling
+set(CMAKE_CROSSCOMPILING_EMULATOR "")
diff --git a/fortran/src/H5config_f.inc.cmake b/fortran/src/H5config_f.inc.cmake
index b8d5355..aa3d135 100644
--- a/fortran/src/H5config_f.inc.cmake
+++ b/fortran/src/H5config_f.inc.cmake
@@ -12,16 +12,19 @@
! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure
! Define if we have parallel support
-#cmakedefine H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@
+#cmakedefine01 H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@
+#if H5_HAVE_PARALLEL == 0
+#undef H5_HAVE_PARALLEL
+#endif
! Define if the intrinsic function STORAGE_SIZE exists
-#cmakedefine H5_FORTRAN_HAVE_STORAGE_SIZE @H5_FORTRAN_HAVE_STORAGE_SIZE@
+#define H5_FORTRAN_HAVE_STORAGE_SIZE @H5_FORTRAN_HAVE_STORAGE_SIZE@
! Define if the intrinsic function SIZEOF exists
-#cmakedefine H5_FORTRAN_HAVE_SIZEOF @H5_FORTRAN_HAVE_SIZEOF@
+#define H5_FORTRAN_HAVE_SIZEOF @H5_FORTRAN_HAVE_SIZEOF@
! Define if the intrinsic function C_SIZEOF exists
-#cmakedefine H5_FORTRAN_HAVE_C_SIZEOF @H5_FORTRAN_HAVE_C_SIZEOF@
+#define H5_FORTRAN_HAVE_C_SIZEOF @H5_FORTRAN_HAVE_C_SIZEOF@
! Define if the intrinsic C_LONG_DOUBLE exists
#define H5_FORTRAN_HAVE_C_LONG_DOUBLE @H5_FORTRAN_HAVE_C_LONG_DOUBLE@
@@ -30,41 +33,40 @@
#define H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE @H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
! Define if the intrinsic module ISO_FORTRAN_ENV exists
-#cmakedefine H5_HAVE_ISO_FORTRAN_ENV @H5_HAVE_ISO_FORTRAN_ENV@
-
+#define H5_HAVE_ISO_FORTRAN_ENV @H5_HAVE_ISO_FORTRAN_ENV@
! should this be ${HDF_PREFIX} instead of H5 MSB
-#cmakedefine H5_SIZEOF_DOUBLE @H5_SIZEOF_DOUBLE@
+#define H5_SIZEOF_DOUBLE @H5_SIZEOF_DOUBLE@
! should this be ${HDF_PREFIX} instead of H5 MSB
-#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@
+#define H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@
! Define the maximum decimal precision for reals
-#cmakedefine H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@
+#define H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@
! If C has quad precision
-#cmakedefine H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@
+#define H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@
! Define if INTEGER*16 is available
#define H5_HAVE_Fortran_INTEGER_SIZEOF_16 @H5_HAVE_Fortran_INTEGER_SIZEOF_16@
! Maximum decimal precision for C
-#cmakedefine H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@
+#define H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@
! number of valid REAL KINDs
-#cmakedefine H5_H5CONFIG_F_NUM_RKIND @H5_H5CONFIG_F_NUM_RKIND@
+#define H5_H5CONFIG_F_NUM_RKIND @H5_H5CONFIG_F_NUM_RKIND@
! valid REAL KINDs (need to have a matching C counter-part)
-#cmakedefine H5_H5CONFIG_F_RKIND @H5_H5CONFIG_F_RKIND@
+#define H5_H5CONFIG_F_RKIND @H5_H5CONFIG_F_RKIND@
! valid REAL KINDs (need to have a matching C counter-part)
-#cmakedefine H5_H5CONFIG_F_RKIND_SIZEOF @H5_H5CONFIG_F_RKIND_SIZEOF@
+#define H5_H5CONFIG_F_RKIND_SIZEOF @H5_H5CONFIG_F_RKIND_SIZEOF@
! number of valid INTEGER KINDs
-#cmakedefine H5_H5CONFIG_F_NUM_IKIND @H5_H5CONFIG_F_NUM_IKIND@
+#define H5_H5CONFIG_F_NUM_IKIND @H5_H5CONFIG_F_NUM_IKIND@
! valid INTEGER KINDs (need to have a matching C counter-part)
-#cmakedefine H5_H5CONFIG_F_IKIND @H5_H5CONFIG_F_IKIND@
+#define H5_H5CONFIG_F_IKIND @H5_H5CONFIG_F_IKIND@
! Fortran compiler id
-#cmakedefine H5_Fortran_COMPILER_ID @Fortran_COMPILER_ID@
+#define H5_Fortran_COMPILER_ID @CMAKE_Fortran_COMPILER_ID@
diff --git a/fortran/test/tH5F.F90 b/fortran/test/tH5F.F90
index 72920f2..ee386dd 100644
--- a/fortran/test/tH5F.F90
+++ b/fortran/test/tH5F.F90
@@ -30,8 +30,6 @@
! access the dataset from the second file as a member of a group
! in the first file.
-
-
MODULE TH5F
CONTAINS
diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java
index 656069a..59ff50e 100644
--- a/java/test/TestH5E.java
+++ b/java/test/TestH5E.java
@@ -37,6 +37,10 @@ import org.junit.rules.TestName;
public class TestH5E {
@Rule public TestName testname = new TestName();
+
+ public static final int ERRSTACK_CNT = 4;
+ public static final int ERRSTACK_MTY_CNT = 0;
+
long hdf_java_classid = -1;
long current_stackid = -1;
@@ -158,7 +162,7 @@ public class TestH5E {
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop #:" + num_msg, num_msg == 0);
+ assertTrue("H5.H5Epop #:" + num_msg, num_msg == TestH5E.ERRSTACK_MTY_CNT);
try {
num_msg = H5.H5Eget_num(current_stackid);
@@ -168,7 +172,7 @@ public class TestH5E {
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Epop #:" + num_msg, num_msg == TestH5E.ERRSTACK_CNT);
try {
H5.H5Epop(current_stackid, 1);
@@ -186,7 +190,7 @@ public class TestH5E {
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop", num_msg == 3);
+ assertTrue("H5.H5Epop", num_msg == TestH5E.ERRSTACK_CNT - 1);
}
@Test
@@ -227,7 +231,7 @@ public class TestH5E {
try {
num_msg = H5.H5Eget_num(estack_id);
- assertTrue("testH5Epush #:" + num_msg, num_msg == 0);
+ assertTrue("testH5Epush #:" + num_msg, num_msg == TestH5E.ERRSTACK_MTY_CNT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -238,7 +242,7 @@ public class TestH5E {
try {
num_msg = H5.H5Eget_num(estack_id);
- assertTrue("testH5Epush #:" + num_msg, num_msg == 1);
+ assertTrue("testH5Epush #:" + num_msg, num_msg == TestH5E.ERRSTACK_MTY_CNT + 1);
}
catch (Throwable err) {
err.printStackTrace();
@@ -314,7 +318,7 @@ public class TestH5E {
err.printStackTrace();
fail("testH5Ewalk:H5Eget_num " + err);
}
- assertTrue("testH5Ewalk #:" + num_msg, num_msg == 4);
+ assertTrue("testH5Ewalk #:" + num_msg, num_msg == TestH5E.ERRSTACK_CNT);
try {
H5.H5Ewalk2(current_stackid, HDF5Constants.H5E_WALK_UPWARD, walk_cb, walk_data);
@@ -324,7 +328,7 @@ public class TestH5E {
fail("testH5Ewalk:H5Ewalk2 " + err);
}
assertFalse("testH5Ewalk:H5Ewalk2 ",((H5E_walk_data)walk_data).walkdata.isEmpty());
- assertTrue("testH5Ewalk:H5Ewalk2 "+((H5E_walk_data)walk_data).walkdata.size(),((H5E_walk_data)walk_data).walkdata.size()==4);
+ assertTrue("testH5Ewalk:H5Ewalk2 "+((H5E_walk_data)walk_data).walkdata.size(),((H5E_walk_data)walk_data).walkdata.size()==TestH5E.ERRSTACK_CNT);
}
}
diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java
index 5324d3a..a3057c6 100644
--- a/java/test/TestH5Edefault.java
+++ b/java/test/TestH5Edefault.java
@@ -29,6 +29,9 @@ import org.junit.rules.TestName;
public class TestH5Edefault {
@Rule public TestName testname = new TestName();
+ public static final int ERRSTACK_CNT = 4;
+ public static final int ERRSTACK_MTY_CNT = 0;
+
@Before
public void H5Eset_default_stack() {
assertTrue("H5 open ids is 0",H5.getOpenIDCount()==0);
@@ -91,7 +94,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 4);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == TestH5Edefault.ERRSTACK_CNT);
//Save a copy of the current stack and clears the current stack
try {
@@ -122,7 +125,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
try {
H5.H5Eclose_stack(stack_id);
@@ -153,7 +156,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 4);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == TestH5Edefault.ERRSTACK_CNT);
//Save a copy of the current stack and clears the current stack
try {
@@ -174,7 +177,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 0);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == TestH5Edefault.ERRSTACK_MTY_CNT);
//Verify the copy has the correct number of messages
try {
@@ -184,7 +187,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
//Generate errors on default stack
try {
@@ -202,7 +205,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 4);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == TestH5Edefault.ERRSTACK_CNT);
//Remove one message from the current stack
try {
@@ -213,7 +216,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: pop #:" + num_msg_default, num_msg_default == 3);
+ assertTrue("H5.H5Eget_current_stack: pop #:" + num_msg_default, num_msg_default == TestH5Edefault.ERRSTACK_CNT - 1);
//Verify the copy still has the correct number of messages
try {
@@ -223,7 +226,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
}
@Test(expected = IllegalArgumentException.class)
@@ -293,7 +296,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eset_current_stack: " + err);
}
- assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
//Save a copy of the current stack
try {
@@ -314,7 +317,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eset_current_stack: " + err);
}
- assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
//Generate errors on default stack
try {
@@ -332,7 +335,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_current_stack: " + err);
}
- assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
//Remove one message from the current stack
try {
@@ -343,7 +346,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eset_current_stack: " + err);
}
- assertTrue("H5.H5Eset_current_stack: pop #:" + num_msg, num_msg == 3);
+ assertTrue("H5.H5Eset_current_stack: pop #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT - 1);
//Verify the copy still has the correct number of messages
try {
@@ -353,7 +356,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eset_current_stack: " + err);
}
- assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
try {
H5.H5Eset_current_stack(stack_id);
@@ -363,7 +366,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eset_current_stack: " + err);
}
- assertTrue("H5.H5Eset_current_stack: get_num - " + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eset_current_stack: get_num - " + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
}
@Test(expected = IllegalArgumentException.class)
@@ -386,7 +389,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop before #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Epop before #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
try {
H5.H5Epop(HDF5Constants.H5E_DEFAULT, 1);
num_msg = H5.H5Eget_num(HDF5Constants.H5E_DEFAULT);
@@ -395,7 +398,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop after #:" + num_msg, num_msg == 3);
+ assertTrue("H5.H5Epop after #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT - 1);
}
@Test(expected = IllegalArgumentException.class)
@@ -471,7 +474,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eclear2_with_msg: " + err);
}
- assertTrue("H5.H5Eclear2_with_msg before #:" + num_msg, num_msg == 4);
+ assertTrue("H5.H5Eclear2_with_msg before #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_CNT);
try {
H5.H5Eclear2(HDF5Constants.H5E_DEFAULT);
num_msg = H5.H5Eget_num(HDF5Constants.H5E_DEFAULT);
@@ -480,7 +483,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eclear2_with_msg: " + err);
}
- assertTrue("H5.H5Eclear2_with_msg after #:" + num_msg, num_msg == 0);
+ assertTrue("H5.H5Eclear2_with_msg after #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_MTY_CNT);
}
@Test(expected = IllegalArgumentException.class)
@@ -516,7 +519,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_num: " + err);
}
- assertTrue("H5.H5Eget_num #:" + num_msg, num_msg == 0);
+ assertTrue("H5.H5Eget_num #:" + num_msg, num_msg == TestH5Edefault.ERRSTACK_MTY_CNT);
}
@Test
@@ -534,7 +537,7 @@ public class TestH5Edefault {
err.printStackTrace();
fail("H5.H5Eget_num_with_msg: " + err);
}
- assertTrue("H5.H5Eget_num_with_msg #:" + num_msg, num_msg > 0);
+ assertTrue("H5.H5Eget_num_with_msg #:" + num_msg, num_msg > TestH5Edefault.ERRSTACK_MTY_CNT);
}
}
diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt
index 4008634..edd876a 100644
--- a/release_docs/INSTALL_CMake.txt
+++ b/release_docs/INSTALL_CMake.txt
@@ -275,9 +275,14 @@ IV. Further considerations
packages there. Add the following CMake options:
-DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib
-DZLIB_INCLUDE_DIR:PATH=some_location/include
+ -DZLIB_USE_EXTERNAL:BOOL=OFF
-DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib
-DSZIP_INCLUDE_DIR:PATH=some_location/include
+ -DSZIP_USE_EXTERNAL:BOOL=OFF
where "some_location" is the full path to the extlibs folder.
+ Also the appropriate environment variable must be set;
+ set(ENV{ZLIB_ROOT} "some_location")
+ set(ENV{SZIP_ROOT} "some_location")
B. Use source packages from an GIT server by adding the following CMake
options:
@@ -319,6 +324,34 @@ IV. Further considerations
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING=Release ..
+ 6. CMake uses a toolchain of utilities to compile, link libraries and
+ create archives, and other tasks to drive the build. The toolchain
+ utilities available are determined by the languages enabled. In normal
+ builds, CMake automatically determines the toolchain for host builds
+ based on system introspection and defaults. In cross-compiling
+ scenarios, a toolchain file may be specified with information about
+ compiler and utility paths.
+ Variables and Properties
+ Several variables relate to the language components of a toolchain which
+ are enabled. CMAKE_<LANG>_COMPILER is the full path to the compiler used
+ for <LANG>. CMAKE_<LANG>_COMPILER_ID is the identifier used by CMake for
+ the compiler and CMAKE_<LANG>_COMPILER_VERSION is the version of the compiler.
+
+ The CMAKE_<LANG>_FLAGS variables and the configuration-specific equivalents
+ contain flags that will be added to the compile command when compiling a
+ file of a particular language.
+
+ As the linker is invoked by the compiler driver, CMake needs a way to
+ determine which compiler to use to invoke the linker. This is calculated
+ by the LANGUAGE of source files in the target, and in the case of static
+ libraries, the language of the dependent libraries. The choice CMake makes
+ may be overridden with the LINKER_LANGUAGE target property.
+
+ See the CMake help for more information on using toolchain files.
+
+ To use a toolchain file with the supplied cmake scripts, see the
+ HDF5options.cmake file under the toolchain section.
+
Notes: CMake and HDF5
1. Using CMake for building and using HDF5 is under active development.
@@ -591,6 +624,7 @@ HDF5_BUILD_TOOLS "Build HDF5 Tools" ON
---------------- HDF5 Advanced Options ---------------------
ALLOW_UNSUPPORTED "Allow unsupported combinations of configure options" OFF
+HDF5_EXTERNAL_LIB_PREFIX "Use prefix for custom library naming." ""
HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF
HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF
HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF
@@ -619,7 +653,8 @@ HDF_TEST_EXPRESS "Control testing framework (0-3)"
HDF5_TEST_VFD "Execute tests with different VFDs" OFF
HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF
HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF
-HDF5_USE_110_API_DEFAULT "Use the HDF5 1.10.x API by default" ON
+HDF5_USE_110_API_DEFAULT "Use the HDF5 1.10.x API by default" OFF
+HDF5_USE_112_API_DEFAULT "Use the HDF5 1.12.x API by default" ON
HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON
HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON
HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON
diff --git a/release_docs/INSTALL_Cygwin.txt b/release_docs/INSTALL_Cygwin.txt
index ddffcf1..74f494c 100644
--- a/release_docs/INSTALL_Cygwin.txt
+++ b/release_docs/INSTALL_Cygwin.txt
@@ -66,12 +66,11 @@ Preconditions:
2.2.2 Szip
The HDF5 library has a predefined compression filter that uses
the extended-Rice lossless compression algorithm for chunked
- datatsets. For more information about Szip compression and
- license terms see
- http://hdfgroup.org/HDF5/doc_resource/SZIP/index.html.
+ datatsets. For more information on Szip compression, license terms,
+ and obtaining the Szip source code, see:
+
+ https://portal.hdfgroup.org/display/HDF5/Szip+Compression+in+HDF+Products
- The latest supported public release of SZIP is available from
- ftp://ftp.hdfgroup.org/lib-external/szip/2.1.
2.3 Additional Utilities
@@ -266,4 +265,5 @@ Build, Test and Install HDF5 on Cygwin
-----------------------------------------------------------------------
-Need Further assistance, email help@hdfgroup.org
+ HDF Forum: https://forum.hdfgroup.org/
+ HDF Helpdesk: https://portal.hdfgroup.org/display/support/The+HDF+Help+Desk
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index d3f07a5..7560ab7 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.10.4 released on 2018-09-10
+HDF5 version 1.10.4 currently under development
================================================================================
@@ -40,11 +40,63 @@ CONTENTS
- CMake vs. Autotools installations
+New Features
+============
+
+ Configuration:
+ -------------
+ - Add toolchain and cross-compile support
+
+ Added info on using a toolchain file to INSTALL_CMAKE.txt. A
+ toolchain file is also used in cross-compiling, which requires
+ CMAKE_CROSSCOMPILING_EMULATOR to be set. To help with cross-compiling
+ the fortran configure process, the HDF5UseFortran.cmake file macros
+ were improved. Fixed a Fortran configure file issue that incorrectly
+ used #cmakedefine instead of #define.
+
+ (ADB - 2018/10/04, HDFFV-10594)
+
+ - Add warning flags for Intel compilers
+
+ Identified Intel compiler specific warnings flags that should be used
+ instead of GNU flags.
+
+ (ADB - 2018/10/04, TRILABS-21)
+
+ - Add default rpath to targets
+
+ Default rpaths should be set in shared executables and
+ libraries to allow the use of loading dependent libraries
+ without requiring LD_LIBRARY_PATH to be set. The default
+ path should be relative using @rpath on osx and $ORIGIN
+ on linux. Windows is not affected.
+
+ (ADB - 2018/09/26, HDFFV-10594)
+
+ Library:
+ --------
+ - Allow pre-generated H5Tinit.c and H5make_libsettings.c to be used.
+
+ Rather than always running H5detect and generating H5Tinit.c and
+ H5make_libsettings.c, supply a location for those files.
+
+ (ADB - 2018/09/18, HDFFV-10332)
+
+
Bug Fixes since HDF5-1.10.3 release
==================================
Library
-------
+ - Allow H5detect and H5make_libsettings to take a file as an argument.
+
+ Rather than only writing to stdout, add a command argument to name
+ the file that H5detect and H5make_libsettings will use for output.
+ Without an argument, stdout is still used, so backwards compatibility
+ is maintained.
+
+ (ADB - 2018/09/05, HDFFV-9059)
+
- A bug was discovered in the parallel library where an application
would hang if a collective read/write of a chunked dataset occurred
when collective metadata reads were enabled and some of the ranks
@@ -74,6 +126,30 @@ Bug Fixes since HDF5-1.10.3 release
(ADB - 2018/08/31, HDFFV-10568)
+ - Java iterator callbacks
+
+ Change global callback object to a small stack structure in order
+ to fix a runtime crash. This crash was discovered when iterating
+ through a file with nested group members. The global variable
+ visit_callback is overwritten when recursion starts. When recursion
+ completes, visit_callback will be pointing to the wrong callback method.
+
+ (ADB - 2018/08/15, HDFFV-10536)
+
+ - Java HDFLibraryException class
+
+ Change parent class from Exception to RuntimeException.
+
+ (ADB - 2018/07/30, HDFFV-10534)
+
+ - JNI Read and Write
+
+ Refactored variable-length functions, H5DreadVL and H5AreadVL,
+ to correct dataset and attribute reads. New write functions,
+ H5DwriteVL and H5AwriteVL, are under construction.
+
+ (ADB - 2018/06/02, HDFFV-10519)
+
Supported Platforms
===================
@@ -122,6 +198,7 @@ Supported Platforms
64-bit gfortran GNU Fortran (GCC) 7.1.0
(kite) Intel icc/icpc/ifort version 17.0.2
+
Tested Configuration Features Summary
=====================================
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3c5526f..3370c99 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -853,24 +853,62 @@ endif ()
# Setup the H5detect utility which generates H5Tinit with platform
# specific type checks inside
#-----------------------------------------------------------------------------
-add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
-target_include_directories(H5detect PRIVATE "${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-target_compile_definitions(H5detect PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
-TARGET_C_PROPERTIES (H5detect STATIC)
-target_link_libraries (H5detect
- PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- INTERFACE $<$<PLATFORM_ID:Emscripten>:"-O0">
-)
+option (HDF5_USE_PREGEN "Use pre-generated Files" OFF)
+if (HDF5_USE_PREGEN)
+ set (HDF5_GENERATED_SOURCE_DIR ${HDF5_USE_PREGEN_DIR})
+else ()
+ set (HDF5_GENERATED_SOURCE_DIR ${HDF5_BINARY_DIR})
+endif ()
-add_custom_command (
- OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c
- COMMAND $<TARGET_FILE:H5detect>
- ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c
- DEPENDS H5detect
-)
+if (BUILD_SHARED_LIBS)
+ file (MAKE_DIRECTORY "${HDF5_BINARY_DIR}/shared")
+endif ()
+
+if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c)
+ add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
+ target_include_directories(H5detect PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_compile_definitions(H5detect PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
+ TARGET_C_PROPERTIES (H5detect STATIC)
+ target_link_libraries (H5detect
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ INTERFACE $<$<PLATFORM_ID:Emscripten>:"-O0">
+ )
+
+ add_custom_command (
+ OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5detect>
+ ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ DEPENDS H5detect
+ WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
+ )
+ if (BUILD_SHARED_LIBS)
+ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c)
+ add_custom_command (
+ OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5detect>
+ ARGS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
+ DEPENDS H5detect
+ WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}/shared
+ )
+ else ()
+ set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE)
+ endif ()
+ endif ()
+else ()
+ set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE)
+ if (BUILD_SHARED_LIBS)
+ add_custom_command (
+ OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c"
+ DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ )
+ set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE)
+ endif ()
+endif ()
add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
-target_include_directories(H5make_libsettings PRIVATE "${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_include_directories(H5make_libsettings PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_definitions(H5make_libsettings PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
TARGET_C_PROPERTIES (H5make_libsettings STATIC)
target_link_libraries (H5make_libsettings
@@ -880,11 +918,20 @@ target_link_libraries (H5make_libsettings
add_custom_command (
OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
- COMMAND $<TARGET_FILE:H5make_libsettings>
- ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5make_libsettings>
+ ARGS ${HDF5_BINARY_DIR}/H5lib_settings.c
DEPENDS H5make_libsettings
WORKING_DIRECTORY ${HDF5_BINARY_DIR}
)
+if (BUILD_SHARED_LIBS)
+ add_custom_command (
+ OUTPUT ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5make_libsettings>
+ ARGS ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
+ DEPENDS H5make_libsettings
+ WORKING_DIRECTORY ${HDF5_BINARY_DIR}
+ )
+endif ()
## all_packages="AC,B,B2,D,F,FA,FL,FS,HL,I,O,S,ST,T,Z"
#all_packages="AC,B2,CX,D,F,HL,I,O,S,ST,T,Z"
@@ -893,7 +940,7 @@ option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF)
#-----------------------------------------------------------------------------
# Add H5Tinit source to build - generated by H5detect/CMake at configure time
#-----------------------------------------------------------------------------
-set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c)
+set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c)
add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS})
target_include_directories(${HDF5_LIB_TARGET}
@@ -921,22 +968,8 @@ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries)
set (install_targets ${HDF5_LIB_TARGET})
if (BUILD_SHARED_LIBS)
- file (MAKE_DIRECTORY "${HDF5_BINARY_DIR}/shared")
- add_custom_command (
- OUTPUT ${HDF5_BINARY_DIR}/shared/H5Tinit.c
- COMMAND $<TARGET_FILE:H5detect>
- ARGS > ${HDF5_BINARY_DIR}/shared/H5Tinit.c
- DEPENDS H5detect
- WORKING_DIRECTORY ${HDF5_BINARY_DIR}/shared
- )
- add_custom_command (
- OUTPUT ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
- COMMAND $<TARGET_FILE:H5make_libsettings>
- ARGS > ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
- DEPENDS H5make_libsettings
- WORKING_DIRECTORY ${HDF5_BINARY_DIR}
- )
- set (shared_gen_SRCS ${HDF5_BINARY_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c)
+ set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c)
+
add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS})
target_include_directories(${HDF5_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
diff --git a/src/H5detect.c b/src/H5detect.c
index 2d33a3d..4424009 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -26,11 +26,6 @@ static const char *FileHeader = "\n\
* help@hdfgroup.org. *\n\
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *";
/*
- *
- * Created: H5detect.c
- * 10 Aug 1997
- * Robb Matzke
- *
* Purpose: This code was borrowed heavily from the `detect.c'
* program in the AIO distribution from Lawrence
* Livermore National Laboratory.
@@ -44,9 +39,6 @@ static const char *FileHeader = "\n\
* features which aren't available. We're not
* running on a Vax or other machine with mixed
* endianness.
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#undef NDEBUG
@@ -117,6 +109,8 @@ typedef struct malign_t {
unsigned int comp_align; /* alignment for structure */
} malign_t;
+FILE *rawoutstream = NULL;
+
/* global variables types detection code */
H5_GCC_DIAG_OFF(larger-than=)
static detected_t d_g[MAXDETECT];
@@ -143,9 +137,9 @@ static void detect_C99_integers32(void);
static void detect_C99_integers64(void);
static void detect_alignments(void);
static unsigned int align_g[] = {1, 2, 4, 8, 16};
-static int align_status_g = 0; /* ALIGNMENT Signal Status */
+static int align_status_g = 0; /* ALIGNMENT Signal Status */
static int sigbus_handler_called_g = 0; /* how many times called */
-static int sigsegv_handler_called_g = 0;/* how many times called */
+static int sigsegv_handler_called_g = 0; /* how many times called */
static int sigill_handler_called_g = 0; /* how many times called */
static int signal_handler_tested_g = 0; /* how many times tested */
#if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL)
@@ -156,18 +150,13 @@ static H5JMP_BUF jbuf_g;
#endif
+
/*-------------------------------------------------------------------------
* Function: precision
*
- * Purpose: Determine the precision and offset.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * Thursday, June 18, 1998
- *
- * Modifications:
+ * Purpose: Determine the precision and offset.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -175,21 +164,22 @@ precision (detected_t *d)
{
unsigned int n;
- if (0 == d->msize) {
+ if(0 == d->msize) {
/*
* An integer. The permutation can have negative values at the
* beginning or end which represent padding of bytes. We must adjust
* the precision and offset accordingly.
*/
- if (d->perm[0] < 0) {
+ if(d->perm[0] < 0) {
/*
* Lower addresses are padded.
*/
- for (n = 0; n < d->size && d->perm[n] < 0; n++)
+ for(n = 0; n < d->size && d->perm[n] < 0; n++)
/*void*/;
d->precision = 8 * (d->size - n);
d->offset = 0;
- } else if (d->perm[d->size - 1] < 0) {
+ }
+ else if(d->perm[d->size - 1] < 0) {
/*
* Higher addresses are padded.
*/
@@ -197,36 +187,34 @@ precision (detected_t *d)
/*void*/;
d->precision = 8 * (d->size - n);
d->offset = 8 * n;
- } else {
+ }
+ else {
/*
* No padding.
*/
d->precision = 8 * d->size;
d->offset = 0;
}
- } else {
+ }
+ else {
/* A floating point */
d->offset = MIN3(d->mpos, d->epos, d->sign);
d->precision = d->msize + d->esize + 1;
}
}
-
+
/*-------------------------------------------------------------------------
* Function: DETECT_I/DETECT_BYTE
*
- * Purpose: These macro takes a type like `int' and a base name like
- * `nati' and detects the byte order. The VAR is used to
- * construct the names of the C variables defined.
+ * Purpose: These macro takes a type like `int' and a base name like
+ * `nati' and detects the byte order. The VAR is used to
+ * construct the names of the C variables defined.
*
* DETECT_I is used for types that are larger than one byte,
* DETECT_BYTE is used for types that are exactly one byte.
*
- * Return: void
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12 1996
+ * Return: void
*
* Modifications:
*
@@ -244,7 +232,7 @@ precision (detected_t *d)
*
* Neil Fortner, 6 Sep 2013
* Split macro into DETECT_I and DETECT_BYTE macros, extracted
- * common cod einto DETECT_I_BYTE_CORE. This was done to remove
+ * common code into DETECT_I_BYTE_CORE. This was done to remove
* "will never be executed" warnings.
*
*-------------------------------------------------------------------------
@@ -289,22 +277,15 @@ precision (detected_t *d)
DETECT_I_BYTE_CORE(TYPE,VAR,INFO,TYPE) \
}
-
+
/*-------------------------------------------------------------------------
* Function: DETECT_F
*
- * Purpose: This macro takes a floating point type like `double' and
- * a base name like `natd' and detects byte order, mantissa
- * location, exponent location, sign bit location, presence or
- * absence of implicit mantissa bit, and exponent bias and
- * initializes a detected_t structure with those properties.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12 1996
- *
+ * Purpose: This macro takes a floating point type like `double' and
+ * a base name like `natd' and detects byte order, mantissa
+ * location, exponent location, sign bit location, presence or
+ * absence of implicit mantissa bit, and exponent bias and
+ * initializes a detected_t structure with those properties.
*-------------------------------------------------------------------------
*/
#define DETECT_F(TYPE,VAR,INFO) { \
@@ -393,22 +374,15 @@ precision (detected_t *d)
} \
}
-
+
/*-------------------------------------------------------------------------
* Function: DETECT_M
*
- * Purpose: This macro takes only miscellaneous structures or pointer
+ * Purpose: This macro takes only miscellaneous structures or pointer
* (pointer, hvl_t, hobj_ref_t, hdset_reg_ref_t). It
- * constructs the names and decides the alignment in structure.
- *
- * Return: void
- *
- * Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
- * Dec 9, 2002
- *
- * Modifications:
+ * constructs the names and decides the alignment in structure.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
#define DETECT_M(TYPE,VAR,INFO) { \
@@ -438,29 +412,29 @@ precision (detected_t *d)
_buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \
if(H5SETJMP(jbuf_g)) _ano++; \
if(_ano < NELMTS(align_g)) { \
- *((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \
- _val2 = *((TYPE*)(_buf+align_g[_ano])); /*possible SIGBUS or SEGSEGV*/\
- /* Cray Check: This section helps detect alignment on Cray's */ \
+ *((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \
+ _val2 = *((TYPE*)(_buf+align_g[_ano])); /*possible SIGBUS or SEGSEGV*/\
+ /* Cray Check: This section helps detect alignment on Cray's */ \
/* vector machines (like the SV1) which mask off */ \
- /* pointer values when pointing to non-word aligned */ \
- /* locations with pointers that are supposed to be */ \
- /* word aligned. -QAK */ \
- HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \
- /*How to handle VAX types?*/ \
- if(INFO.perm[0]) /* Big-Endian */ \
- HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \
- else /* Little-Endian */ \
- HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \
- _val2 = *((TYPE*)(_buf+align_g[_ano])); \
- H5_GCC_DIAG_OFF(float-equal) \
- if(_val!=_val2) \
- H5LONGJMP(jbuf_g, 1); \
- H5_GCC_DIAG_ON(float-equal) \
- /* End Cray Check */ \
- (INFO.align)=align_g[_ano]; \
+ /* pointer values when pointing to non-word aligned */ \
+ /* locations with pointers that are supposed to be */ \
+ /* word aligned. -QAK */ \
+ HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \
+ /*How to handle VAX types?*/ \
+ if(INFO.perm[0]) /* Big-Endian */ \
+ HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \
+ else /* Little-Endian */ \
+ HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \
+ _val2 = *((TYPE*)(_buf+align_g[_ano])); \
+ H5_GCC_DIAG_OFF(float-equal) \
+ if(_val!=_val2) \
+ H5LONGJMP(jbuf_g, 1); \
+ H5_GCC_DIAG_ON(float-equal) \
+ /* End Cray Check */ \
+ (INFO.align)=align_g[_ano]; \
} else { \
(INFO.align)=0; \
- fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \
+ fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \
} \
HDfree(_buf); \
HDsignal(SIGBUS, _handler); /*restore original handler*/ \
@@ -476,21 +450,16 @@ precision (detected_t *d)
#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
+
/*-------------------------------------------------------------------------
* Function: sigsegv_handler
*
- * Purpose: Handler for SIGSEGV. We use signal() instead of sigaction()
- * because it's more portable to non-Posix systems. Although
- * it's not nearly as nice to work with, it does the job for
- * this simple stuff.
- *
- * Return: Returns via H5LONGJMP to jbuf_g.
- *
- * Programmer: Robb Matzke
- * Thursday, March 18, 1999
- *
- * Modifications:
+ * Purpose: Handler for SIGSEGV. We use signal() instead of sigaction()
+ * because it's more portable to non-Posix systems. Although
+ * it's not nearly as nice to work with, it does the job for
+ * this simple stuff.
*
+ * Return: Returns via H5LONGJMP to jbuf_g.
*-------------------------------------------------------------------------
*/
static void
@@ -514,21 +483,16 @@ sigsegv_handler(int H5_ATTR_UNUSED signo)
#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
+
/*-------------------------------------------------------------------------
* Function: sigbus_handler
*
- * Purpose: Handler for SIGBUS. We use signal() instead of sigaction()
- * because it's more portable to non-Posix systems. Although
- * it's not nearly as nice to work with, it does the job for
- * this simple stuff.
- *
- * Return: Returns via H5LONGJMP to jbuf_g.
- *
- * Programmer: Robb Matzke
- * Thursday, March 18, 1999
- *
- * Modifications:
+ * Purpose: Handler for SIGBUS. We use signal() instead of sigaction()
+ * because it's more portable to non-Posix systems. Although
+ * it's not nearly as nice to work with, it does the job for
+ * this simple stuff.
*
+ * Return: Returns via H5LONGJMP to jbuf_g.
*-------------------------------------------------------------------------
*/
static void
@@ -552,19 +516,16 @@ sigbus_handler(int H5_ATTR_UNUSED signo)
#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
+
/*-------------------------------------------------------------------------
* Function: sigill_handler
*
- * Purpose: Handler for SIGILL. We use signal() instead of sigaction()
- * because it's more portable to non-Posix systems. Although
- * it's not nearly as nice to work with, it does the job for
- * this simple stuff.
- *
- * Return: Returns via H5LONGJMP to jbuf_g.
- *
- * Programmer: Raymond Lu
- * 28 October 2013
+ * Purpose: Handler for SIGILL. We use signal() instead of sigaction()
+ * because it's more portable to non-Posix systems. Although
+ * it's not nearly as nice to work with, it does the job for
+ * this simple stuff.
*
+ * Return: Returns via H5LONGJMP to jbuf_g.
*-------------------------------------------------------------------------
*/
static void
@@ -586,20 +547,13 @@ sigill_handler(int H5_ATTR_UNUSED signo)
}
#endif
-
+
/*-------------------------------------------------------------------------
* Function: print_results
*
- * Purpose: Prints information about the detected data types.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 14, 1996
- *
- * Modifications:
+ * Purpose: Prints information about the detected data types.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -609,7 +563,7 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align)
int i, j;
/* Include files */
- printf("\
+ fprintf(rawoutstream, "\
/****************/\n\
/* Module Setup */\n\
/****************/\n\
@@ -662,7 +616,7 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align)
/*********************/\n\
\n\
\n");
- printf("\n\
+ fprintf(rawoutstream, "\n\
/*******************/\n\
/* Local Variables */\n\
/*******************/\n\
@@ -670,7 +624,7 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align)
/* The interface initialization function */
- printf("\n\
+ fprintf(rawoutstream, "\n\
\n\
/*-------------------------------------------------------------------------\n\
* Function: H5T__init_native\n\
@@ -713,12 +667,12 @@ H5T__init_native(void)\n\
}
/* Print a comment to describe this section of definitions. */
- printf("\n /*\n");
+ fprintf(rawoutstream, "\n /*\n");
iprint(d+i);
- printf(" */\n");
+ fprintf(rawoutstream, " */\n");
/* The part common to fixed and floating types */
- printf("\
+ fprintf(rawoutstream, "\
if(NULL == (dt = H5T__alloc()))\n\
HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, \"datatype allocation failed\")\n\
dt->shared->state = H5T_STATE_IMMUTABLE;\n\
@@ -728,16 +682,16 @@ H5T__init_native(void)\n\
d[i].size); /*size */
if(byte_order==-1)
- printf("\
+ fprintf(rawoutstream, "\
dt->shared->u.atomic.order = H5T_ORDER_VAX;\n");
else if(byte_order==0)
- printf("\
+ fprintf(rawoutstream, "\
dt->shared->u.atomic.order = H5T_ORDER_LE;\n");
else
- printf("\
+ fprintf(rawoutstream, "\
dt->shared->u.atomic.order = H5T_ORDER_BE;\n");
- printf("\
+ fprintf(rawoutstream, "\
dt->shared->u.atomic.offset = %d;\n\
dt->shared->u.atomic.prec = %d;\n\
dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;\n\
@@ -746,14 +700,15 @@ H5T__init_native(void)\n\
d[i].precision); /*precision */
/*HDassert((d[i].perm[0]>0)==(byte_order>0));*/ /* Double-check that byte-order doesn't change */
- if (0 == d[i].msize) {
+ if(0 == d[i].msize) {
/* The part unique to fixed point types */
- printf("\
+ fprintf(rawoutstream, "\
dt->shared->u.atomic.u.i.sign = H5T_SGN_%s;\n",
d[i].sign ? "2" : "NONE");
- } else {
+ }
+ else {
/* The part unique to floating point types */
- printf("\
+ fprintf(rawoutstream, "\
dt->shared->u.atomic.u.f.sign = %d;\n\
dt->shared->u.atomic.u.f.epos = %d;\n\
dt->shared->u.atomic.u.f.esize = %d;\n\
@@ -772,11 +727,11 @@ H5T__init_native(void)\n\
}
/* Atomize the type */
- printf("\
+ fprintf(rawoutstream, "\
if((H5T_NATIVE_%s_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)\n\
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \"can't register ID for built-in datatype\")\n",
d[i].varname);
- printf(" H5T_NATIVE_%s_ALIGN_g = %lu;\n",
+ fprintf(rawoutstream, " H5T_NATIVE_%s_ALIGN_g = %lu;\n",
d[i].varname, (unsigned long)(d[i].align));
/* Variables for alignment of compound datatype */
@@ -784,28 +739,29 @@ H5T__init_native(void)\n\
!HDstrcmp(d[i].varname, "INT") || !HDstrcmp(d[i].varname, "LONG") ||
!HDstrcmp(d[i].varname, "LLONG") || !HDstrcmp(d[i].varname, "FLOAT") ||
!HDstrcmp(d[i].varname, "DOUBLE") || !HDstrcmp(d[i].varname, "LDOUBLE")) {
- printf(" H5T_NATIVE_%s_COMP_ALIGN_g = %lu;\n",
+ fprintf(rawoutstream, " H5T_NATIVE_%s_COMP_ALIGN_g = %lu;\n",
d[i].varname, (unsigned long)(d[i].comp_align));
}
}
/* Consider VAX a little-endian machine */
if(byte_order==0 || byte_order==-1) {
- printf("\n\
+ fprintf(rawoutstream, "\n\
/* Set the native order for this machine */\n\
H5T_native_order_g = H5T_ORDER_%s;\n", "LE");
- } else {
- printf("\n\
+ }
+ else {
+ fprintf(rawoutstream, "\n\
/* Set the native order for this machine */\n\
H5T_native_order_g = H5T_ORDER_%s;\n", "BE");
}
/* Structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */
- printf("\n /* Structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */\n");
+ fprintf(rawoutstream, "\n /* Structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */\n");
for(j=0; j<na; j++)
- printf(" H5T_%s_COMP_ALIGN_g = %lu;\n", misc_align[j].name, (unsigned long)(misc_align[j].comp_align));
+ fprintf(rawoutstream, " H5T_%s_COMP_ALIGN_g = %lu;\n", misc_align[j].name, (unsigned long)(misc_align[j].comp_align));
- printf("\
+ fprintf(rawoutstream, "\
\n\
done:\n\
if(ret_value < 0) {\n\
@@ -818,73 +774,66 @@ done:\n\
FUNC_LEAVE_NOAPI(ret_value);\n} /* end H5T__init_native() */\n");
/* Print the ALIGNMENT and signal-handling status as comments */
- printf("\n"
+ fprintf(rawoutstream, "\n"
"/****************************************/\n"
"/* ALIGNMENT and signal-handling status */\n"
"/****************************************/\n");
if (align_status_g & STA_NoALIGNMENT)
- printf("/* ALIGNAMENT test is not available */\n");
+ fprintf(rawoutstream, "/* ALIGNAMENT test is not available */\n");
if (align_status_g & STA_NoHandlerVerify)
- printf("/* Signal handlers verify test is not available */\n");
+ fprintf(rawoutstream, "/* Signal handlers verify test is not available */\n");
/* The following is available in H5pubconf.h. Printing them here for */
/* convenience. */
#ifdef H5_HAVE_SIGNAL
- printf("/* Signal() support: yes */\n");
+ fprintf(rawoutstream, "/* Signal() support: yes */\n");
#else
- printf("/* Signal() support: no */\n");
+ fprintf(rawoutstream, "/* Signal() support: no */\n");
#endif
#ifdef H5_HAVE_SETJMP
- printf("/* setjmp() support: yes */\n");
+ fprintf(rawoutstream, "/* setjmp() support: yes */\n");
#else
- printf("/* setjmp() support: no */\n");
+ fprintf(rawoutstream, "/* setjmp() support: no */\n");
#endif
#ifdef H5_HAVE_LONGJMP
- printf("/* longjmp() support: yes */\n");
+ fprintf(rawoutstream, "/* longjmp() support: yes */\n");
#else
- printf("/* longjmp() support: no */\n");
+ fprintf(rawoutstream, "/* longjmp() support: no */\n");
#endif
#ifdef H5_HAVE_SIGSETJMP
- printf("/* sigsetjmp() support: yes */\n");
+ fprintf(rawoutstream, "/* sigsetjmp() support: yes */\n");
#else
- printf("/* sigsetjmp() support: no */\n");
+ fprintf(rawoutstream, "/* sigsetjmp() support: no */\n");
#endif
#ifdef H5_HAVE_SIGLONGJMP
- printf("/* siglongjmp() support: yes */\n");
+ fprintf(rawoutstream, "/* siglongjmp() support: yes */\n");
#else
- printf("/* siglongjmp() support: no */\n");
+ fprintf(rawoutstream, "/* siglongjmp() support: no */\n");
#endif
#ifdef H5_HAVE_SIGPROCMASK
- printf("/* sigprocmask() support: yes */\n");
+ fprintf(rawoutstream, "/* sigprocmask() support: yes */\n");
#else
- printf("/* sigprocmask() support: no */\n");
+ fprintf(rawoutstream, "/* sigprocmask() support: no */\n");
#endif
/* Print the statics of signal handlers called for debugging */
- printf("\n"
+ fprintf(rawoutstream, "\n"
"/******************************/\n"
"/* signal handlers statistics */\n"
"/******************************/\n");
- printf("/* signal_handlers tested: %d times */\n", signal_handler_tested_g);
- printf("/* sigbus_handler called: %d times */\n", sigbus_handler_called_g);
- printf("/* sigsegv_handler called: %d times */\n", sigsegv_handler_called_g);
- printf("/* sigill_handler called: %d times */\n", sigill_handler_called_g);
+ fprintf(rawoutstream, "/* signal_handlers tested: %d times */\n", signal_handler_tested_g);
+ fprintf(rawoutstream, "/* sigbus_handler called: %d times */\n", sigbus_handler_called_g);
+ fprintf(rawoutstream, "/* sigsegv_handler called: %d times */\n", sigsegv_handler_called_g);
+ fprintf(rawoutstream, "/* sigill_handler called: %d times */\n", sigill_handler_called_g);
} /* end print_results() */
-
+
/*-------------------------------------------------------------------------
* Function: iprint
*
- * Purpose: Prints information about the fields of a floating point
- * format.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 13, 1996
- *
- * Modifications:
+ * Purpose: Prints information about the fields of a floating point format.
*
+ * Return: void
+
*-------------------------------------------------------------------------
*/
static void
@@ -892,88 +841,92 @@ iprint(detected_t *d)
{
unsigned int pass;
- for (pass = (d->size - 1) / 4; ; --pass) {
+ for(pass = (d->size - 1) / 4; ; --pass) {
unsigned int i, k;
/*
* Print the byte ordering above the bit fields.
*/
- printf(" * ");
- for (i = MIN(pass * 4 + 3, d->size - 1); i >= pass * 4; --i) {
- printf("%4d", d->perm[i]);
- if (i > pass * 4) HDfputs(" ", stdout);
- if (!i) break;
+ fprintf(rawoutstream, " * ");
+ for(i = MIN(pass * 4 + 3, d->size - 1); i >= pass * 4; --i) {
+ fprintf(rawoutstream, "%4d", d->perm[i]);
+ if(i > pass * 4)
+ HDfputs(" ", stdout);
+ if(!i)
+ break;
}
/*
* Print the bit fields
*/
- printf("\n * ");
- for (i = MIN(pass * 4 + 3, d->size - 1), k = MIN(pass * 32 + 31,
+ fprintf(rawoutstream, "\n * ");
+ for(i = MIN(pass * 4 + 3, d->size - 1), k = MIN(pass * 32 + 31,
8 * d->size - 1); i >= pass * 4; --i) {
unsigned int j;
- for (j = 8; j > 0; --j) {
- if (k == d->sign && d->msize) {
- HDputchar('S');
- } else if (k >= d->epos && k < d->epos + d->esize) {
- HDputchar('E');
- } else if (k >= d->mpos && k < d->mpos + d->msize) {
- HDputchar('M');
- } else if (d->msize) {
- HDputchar('?'); /*unknown floating point bit */
- } else if (d->sign) {
- HDputchar('I');
- } else {
- HDputchar('U');
+ for(j = 8; j > 0; --j) {
+ if(k == d->sign && d->msize) {
+ HDfputc('S', rawoutstream);
+ }
+ else if(k >= d->epos && k < d->epos + d->esize) {
+ HDfputc('E', rawoutstream);
+ }
+ else if(k >= d->mpos && k < d->mpos + d->msize) {
+ HDfputc('M', rawoutstream);
+ }
+ else if(d->msize) {
+ HDfputc('?', rawoutstream); /*unknown floating point bit */
+ }
+ else if(d->sign) {
+ HDfputc('I', rawoutstream);
+ }
+ else {
+ HDfputc('U', rawoutstream);
}
--k;
}
- if (i > pass * 4) HDputchar(' ');
- if (!i) break;
+ if(i > pass * 4)
+ HDfputc(' ', rawoutstream);
+ if(!i)
+ break;
}
- HDputchar('\n');
- if (!pass) break;
+ HDfputc('\n', rawoutstream);
+ if(!pass)
+ break;
}
/*
* Is there an implicit bit in the mantissa.
*/
- if (d->msize) {
- printf(" * Implicit bit? %s\n", d->imp ? "yes" : "no");
+ if(d->msize) {
+ fprintf(rawoutstream, " * Implicit bit? %s\n", d->imp ? "yes" : "no");
}
/*
* Alignment
*/
- if (0 == d->align) {
- printf(" * Alignment: NOT CALCULATED\n");
- } else if (1 == d->align) {
- printf(" * Alignment: none\n");
- } else {
- printf(" * Alignment: %lu\n", (unsigned long) (d->align));
+ if(0 == d->align) {
+ fprintf(rawoutstream, " * Alignment: NOT CALCULATED\n");
+ }
+ else if(1 == d->align) {
+ fprintf(rawoutstream, " * Alignment: none\n");
+ }
+ else {
+ fprintf(rawoutstream, " * Alignment: %lu\n", (unsigned long) (d->align));
}
}
-
+
/*-------------------------------------------------------------------------
* Function: byte_cmp
*
- * Purpose: Compares two chunks of memory A and B and returns the
- * byte index into those arrays of the first byte that
- * differs between A and B. Ignores differences where the
+ * Purpose: Compares two chunks of memory A and B and returns the
+ * byte index into those arrays of the first byte that
+ * differs between A and B. Ignores differences where the
* corresponding bit in pad_mask is set to 0.
*
- * Return: Success: Index of differing byte.
- *
- * Failure: -1 if all bytes are the same.
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12, 1996
- *
- * Modifications:
- *
+ * Return: Success: Index of differing byte.
+ * Failure: -1 if all bytes are the same.
*-------------------------------------------------------------------------
*/
static int
@@ -990,17 +943,17 @@ byte_cmp(int n, const void *_a, const void *_b, const unsigned char *pad_mask)
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: bit_cmp
*
- * Purpose: Compares two bit vectors and returns the index for the
- * first bit that differs between the two vectors. The
- * size of the vector is NBYTES. PERM is a mapping from
- * actual order to little endian. Ignores differences where
+ * Purpose: Compares two bit vectors and returns the index for the
+ * first bit that differs between the two vectors. The
+ * size of the vector is NBYTES. PERM is a mapping from
+ * actual order to little endian. Ignores differences where
* the corresponding bit in pad_mask is set to 0.
*
- * Return: Index of first differing bit.
+ * Return: Index of first differing bit.
*
*-------------------------------------------------------------------------
*/
@@ -1013,14 +966,14 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b,
unsigned char *b = (unsigned char *) _b;
unsigned char aa, bb;
- for (i = 0; i < nbytes; i++) {
+ for(i = 0; i < nbytes; i++) {
HDassert(perm[i] < (int) nbytes);
- if ((aa = (unsigned char) (a[perm[i]] & pad_mask[perm[i]]))
+ if((aa = (unsigned char) (a[perm[i]] & pad_mask[perm[i]]))
!= (bb = (unsigned char) (b[perm[i]] & pad_mask[perm[i]]))) {
unsigned int j;
- for (j = 0; j < 8; j++, aa >>= 1, bb >>= 1) {
- if ((aa & 1) != (bb & 1)) return i * 8 + j;
+ for(j = 0; j < 8; j++, aa >>= 1, bb >>= 1) {
+ if((aa & 1) != (bb & 1)) return i * 8 + j;
}
fprintf(stderr, "INTERNAL ERROR");
HDabort();
@@ -1031,26 +984,19 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b,
return 0;
}
-
+
/*-------------------------------------------------------------------------
* Function: fix_order
*
- * Purpose: Given an array PERM with elements FIRST through LAST
- * initialized with zero origin byte numbers, this function
- * creates a permutation vector that maps the actual order
- * of a floating point number to little-endian.
- *
- * This function assumes that the mantissa byte ordering
- * implies the total ordering.
- *
- * Return: void
+ * Purpose: Given an array PERM with elements FIRST through LAST
+ * initialized with zero origin byte numbers, this function
+ * creates a permutation vector that maps the actual order
+ * of a floating point number to little-endian.
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 13, 1996
- *
- * Modifications:
+ * This function assumes that the mantissa byte ordering
+ * implies the total ordering.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -1058,79 +1004,79 @@ fix_order(int n, int last, int *perm, const char **mesg)
{
int i;
- if (last > 1) {
- /*
- * We have at least three points to consider.
- */
- if (perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) {
+ if(last > 1) {
/*
- * Little endian.
- */
- if (mesg) *mesg = "Little-endian";
- for (i = 0; i < n; i++) perm[i] = i;
+ * We have at least three points to consider.
+ */
+ if(perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) {
+ /*
+ * Little endian.
+ */
+ if(mesg)
+ *mesg = "Little-endian";
+ for(i = 0; i < n; i++)
+ perm[i] = i;
- } else if (perm[last] > perm[last-1] && perm[last-1] > perm[last-2]) {
- /*
- * Big endian.
- */
- if (mesg) *mesg = "Big-endian";
- for (i = 0; i < n; i++) perm[i] = (n - 1) - i;
+ }
+ else if(perm[last] > perm[last - 1]
+ && perm[last - 1] > perm[last - 2]) {
+ /*
+ * Big endian.
+ */
+ if(mesg)
+ *mesg = "Big-endian";
+ for(i = 0; i < n; i++)
+ perm[i] = (n - 1) - i;
- } else {
- /*
- * Bi-endian machines like VAX.
+ }
+ else {
+ /*
+ * Bi-endian machines like VAX.
* (NOTE: This is not an actual determination of the VAX-endianness.
* It could have some other endianness and fall into this
* case - JKM & QAK)
- */
- HDassert(0 == n % 2);
- if (mesg) *mesg = "VAX";
- for (i = 0; i < n; i += 2) {
- perm[i] = (n - 2) - i;
- perm[i + 1] = (n - 1) - i;
+ */
+ HDassert(0 == n % 2);
+ if(mesg)
+ *mesg = "VAX";
+ for(i = 0; i < n; i += 2) {
+ perm[i] = (n - 2) - i;
+ perm[i + 1] = (n - 1) - i;
+ }
}
}
- } else {
- fprintf(stderr,
- "Failed to detect byte order of %d-byte floating point.\n", n);
- HDexit(1);
+ else {
+ fprintf(stderr,
+ "Failed to detect byte order of %d-byte floating point.\n", n);
+ HDexit(1);
}
}
-
+
/*-------------------------------------------------------------------------
* Function: imp_bit
*
- * Purpose: Looks for an implicit bit in the mantissa. The value
- * of _A should be 1.0 and the value of _B should be 0.5.
- * Some floating-point formats discard the most significant
- * bit of the mantissa after normalizing since it will always
- * be a one (except for 0.0). If this is true for the native
- * floating point values stored in _A and _B then the function
- * returns non-zero.
+ * Purpose: Looks for an implicit bit in the mantissa. The value
+ * of _A should be 1.0 and the value of _B should be 0.5.
+ * Some floating-point formats discard the most significant
+ * bit of the mantissa after normalizing since it will always
+ * be a one (except for 0.0). If this is true for the native
+ * floating point values stored in _A and _B then the function
+ * returns non-zero.
*
- * This function assumes that the exponent occupies higher
- * order bits than the mantissa and that the most significant
- * bit of the mantissa is next to the least significant bit
- * of the exponent.
+ * This function assumes that the exponent occupies higher
+ * order bits than the mantissa and that the most significant
+ * bit of the mantissa is next to the least significant bit
+ * of the exponent.
*
*
- * Return: Success: Non-zero if the most significant bit
- * of the mantissa is discarded (ie, the
- * mantissa has an implicit `one' as the
- * most significant bit). Otherwise,
- * returns zero.
+ * Return: Success: Non-zero if the most significant bit
+ * of the mantissa is discarded (ie, the
+ * mantissa has an implicit `one' as the
+ * most significant bit). Otherwise,
+ * returns zero.
*
- * Failure: exit(1)
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 13, 1996
- *
- * Modifications:
- *
- * Robb Matzke, 6 Nov 1996
- * Fixed a bug that occurs with non-implicit architectures.
+ * Failure: 1
*
*-------------------------------------------------------------------------
*/
@@ -1160,26 +1106,14 @@ imp_bit(unsigned int n, int *perm, void *_a, void *_b, const unsigned char *pad_
return (a[perm[major]] >> minor) & 0x01 ? 0 : 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: find_bias
- *
- * Purpose: Determines the bias of the exponent. This function should
- * be called with _A having a value of `1'.
+ * Function: find_bias
*
- * Return: Success: The exponent bias.
+ * Purpose: Determines the bias of the exponent. This function should
+ * be called with _A having a value of `1'.
*
- * Failure:
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 13, 1996
- *
- * Modifications:
- *
- * Robb Matzke, 6 Nov 1996
- * Fixed a bug with non-implicit architectures returning the
- * wrong exponent bias.
+ * Return: The exponent bias.
*
*-------------------------------------------------------------------------
*/
@@ -1190,7 +1124,7 @@ find_bias(unsigned int epos, unsigned int esize, int *perm, void *_a)
unsigned char mask;
unsigned int b, shift = 0, nbits, bias = 0;
- while (esize > 0) {
+ while(esize > 0) {
nbits = MIN(esize, (8 - epos % 8));
mask = (unsigned char) ((1 << nbits) - 1);
b = (unsigned int) (a[perm[epos / 8]] >> (epos % 8)) & mask;
@@ -1203,34 +1137,27 @@ find_bias(unsigned int epos, unsigned int esize, int *perm, void *_a)
return bias;
}
-
+
/*-------------------------------------------------------------------------
* Function: print_header
*
- * Purpose: Prints the C file header for the generated file.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Mar 12 1997
- *
- * Modifications:
+ * Purpose: Prints the C file header for the generated file.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
print_header(void)
{
- time_t now = HDtime(NULL);
- struct tm *tm = HDlocaltime(&now);
- char real_name[30];
- char host_name[256];
+ time_t now = HDtime(NULL);
+ struct tm *tm = HDlocaltime(&now);
+ char real_name[30];
+ char host_name[256];
int i;
- const char *s;
+ const char *s;
#ifdef H5_HAVE_GETPWUID
- struct passwd *pwd = NULL;
+ struct passwd *pwd = NULL;
#else
int pwd = 1;
#endif
@@ -1281,20 +1208,21 @@ bit.\n";
*/
#ifdef H5_HAVE_GETPWUID
{
- size_t n;
- char *comma;
- if ((pwd = HDgetpwuid(HDgetuid()))) {
- if ((comma = HDstrchr(pwd->pw_gecos, ','))) {
- n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos));
- HDstrncpy(real_name, pwd->pw_gecos, n);
- real_name[n] = '\0';
- } else {
- HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
- real_name[sizeof(real_name) - 1] = '\0';
+ size_t n;
+ char *comma;
+ if((pwd = HDgetpwuid(HDgetuid()))) {
+ if((comma = HDstrchr(pwd->pw_gecos, ','))) {
+ n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos));
+ HDstrncpy(real_name, pwd->pw_gecos, n);
+ real_name[n] = '\0';
+ }
+ else {
+ HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
+ real_name[sizeof(real_name) - 1] = '\0';
+ }
}
- } else {
- real_name[0] = '\0';
- }
+ else
+ real_name[0] = '\0';
}
#else
real_name[0] = '\0';
@@ -1304,8 +1232,8 @@ bit.\n";
* The FQDM of this host or the empty string.
*/
#ifdef H5_HAVE_GETHOSTNAME
- if (HDgethostname(host_name, sizeof(host_name)) < 0) {
- host_name[0] = '\0';
+ if(HDgethostname(host_name, sizeof(host_name)) < 0) {
+ host_name[0] = '\0';
}
#else
host_name[0] = '\0';
@@ -1314,78 +1242,71 @@ bit.\n";
/*
* The file header: warning, copyright notice, build information.
*/
- printf("/* Generated automatically by H5detect -- do not edit */\n\n\n");
- HDputs(FileHeader); /*the copyright notice--see top of this file */
+ fprintf(rawoutstream, "/* Generated automatically by H5detect -- do not edit */\n\n\n");
+ HDfputs(FileHeader, rawoutstream); /*the copyright notice--see top of this file */
- printf(" *\n * Created:\t\t%s %2d, %4d\n",
+ fprintf(rawoutstream, " *\n * Created:\t\t%s %2d, %4d\n",
month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year);
- if (pwd || real_name[0] || host_name[0]) {
- printf(" *\t\t\t");
- if (real_name[0]) printf("%s <", real_name);
+ if(pwd || real_name[0] || host_name[0]) {
+ fprintf(rawoutstream, " *\t\t\t");
+ if(real_name[0])
+ fprintf(rawoutstream, "%s <", real_name);
#ifdef H5_HAVE_GETPWUID
- if (pwd) HDfputs(pwd->pw_name, stdout);
+ if(pwd) HDfputs(pwd->pw_name, rawoutstream);
#endif
- if (host_name[0]) printf("@%s", host_name);
- if (real_name[0]) printf(">");
- HDputchar('\n');
+ if(host_name[0])
+ fprintf(rawoutstream, "@%s", host_name);
+ if(real_name[0])
+ fprintf(rawoutstream, ">");
+ HDfputc('\n', rawoutstream);
}
- printf(" *\n * Purpose:\t\t");
- for (s = purpose; *s; s++) {
- HDputchar(*s);
- if ('\n' == *s && s[1]) printf(" *\t\t\t");
+ fprintf(rawoutstream, " *\n * Purpose:\t\t");
+ for(s = purpose; *s; s++) {
+ HDfputc(*s, rawoutstream);
+ if('\n' == *s && s[1])
+ fprintf(rawoutstream, " *\t\t\t");
}
- printf(" *\n * Modifications:\n *\n");
- printf(" *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n");
- printf(" *\tIt was generated by code in `H5detect.c'.\n");
+ fprintf(rawoutstream, " *\n * Modifications:\n *\n");
+ fprintf(rawoutstream, " *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n");
+ fprintf(rawoutstream, " *\tIt was generated by code in `H5detect.c'.\n");
- printf(" *\n *");
- for (i = 0; i < 73; i++) HDputchar('-');
- printf("\n */\n\n");
+ fprintf(rawoutstream, " *\n *");
+ for(i = 0; i < 73; i++)
+ HDfputc('-', rawoutstream);
+ fprintf(rawoutstream, "\n */\n\n");
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C89_integers
*
- * Purpose: Detect C89 integer types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C89 integer types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
detect_C89_integers(void)
{
- DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++;
- DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++;
- DETECT_I(short, SHORT, d_g[nd_g]); nd_g++;
- DETECT_I(unsigned short, USHORT, d_g[nd_g]); nd_g++;
- DETECT_I(int, INT, d_g[nd_g]); nd_g++;
- DETECT_I(unsigned int, UINT, d_g[nd_g]); nd_g++;
- DETECT_I(long, LONG, d_g[nd_g]); nd_g++;
- DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++;
+ DETECT_I(short, SHORT, d_g[nd_g]); nd_g++;
+ DETECT_I(unsigned short, USHORT, d_g[nd_g]); nd_g++;
+ DETECT_I(int, INT, d_g[nd_g]); nd_g++;
+ DETECT_I(unsigned int, UINT, d_g[nd_g]); nd_g++;
+ DETECT_I(long, LONG, d_g[nd_g]); nd_g++;
+ DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++;
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C89_floats
*
- * Purpose: Detect C89 floating point types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C89 floating point types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1395,19 +1316,13 @@ detect_C89_floats(void)
DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++;
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers8
*
- * Purpose: Detect C99 8 bit integer types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C99 8 bit integer types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1415,61 +1330,55 @@ detect_C99_integers8(void)
{
#if H5_SIZEOF_INT8_T>0
#if H5_SIZEOF_INT8_T==1
- DETECT_BYTE(int8_t, INT8, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(int8_t, INT8, d_g[nd_g]); nd_g++;
#else
- DETECT_I(int8_t, INT8, d_g[nd_g]); nd_g++;
+ DETECT_I(int8_t, INT8, d_g[nd_g]); nd_g++;
#endif
#endif
#if H5_SIZEOF_UINT8_T>0
#if H5_SIZEOF_UINT8_T==1
- DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]); nd_g++;
#else
- DETECT_I(uint8_t, UINT8, d_g[nd_g]); nd_g++;
+ DETECT_I(uint8_t, UINT8, d_g[nd_g]); nd_g++;
#endif
#endif
#if H5_SIZEOF_INT_LEAST8_T>0
#if H5_SIZEOF_INT_LEAST8_T==1
- DETECT_BYTE(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++;
#else
- DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++;
+ DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++;
#endif
#endif
#if H5_SIZEOF_UINT_LEAST8_T>0
#if H5_SIZEOF_UINT_LEAST8_T==1
- DETECT_BYTE(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++;
#else
- DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++;
#endif
#endif
#if H5_SIZEOF_INT_FAST8_T>0
#if H5_SIZEOF_INT_FAST8_T==1
- DETECT_BYTE(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++;
#else
DETECT_I(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++;
#endif
#endif
#if H5_SIZEOF_UINT_FAST8_T>0
#if H5_SIZEOF_UINT_FAST8_T==1
- DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++;
#else
- DETECT_I(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++;
#endif
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers16
*
- * Purpose: Detect C99 16 bit integer types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C99 16 bit integer types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1479,35 +1388,29 @@ detect_C99_integers16(void)
DETECT_I(int16_t, INT16, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT16_T>0
- DETECT_I(uint16_t, UINT16, d_g[nd_g]); nd_g++;
+ DETECT_I(uint16_t, UINT16, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_INT_LEAST16_T>0
- DETECT_I(int_least16_t, INT_LEAST16, d_g[nd_g]); nd_g++;
+ DETECT_I(int_least16_t, INT_LEAST16, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT_LEAST16_T>0
- DETECT_I(uint_least16_t, UINT_LEAST16, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_least16_t, UINT_LEAST16, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_INT_FAST16_T>0
- DETECT_I(int_fast16_t, INT_FAST16, d_g[nd_g]); nd_g++;
+ DETECT_I(int_fast16_t, INT_FAST16, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT_FAST16_T>0
- DETECT_I(uint_fast16_t, UINT_FAST16, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_fast16_t, UINT_FAST16, d_g[nd_g]); nd_g++;
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers32
*
- * Purpose: Detect C99 32 bit integer types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C99 32 bit integer types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1517,34 +1420,29 @@ detect_C99_integers32(void)
DETECT_I(int32_t, INT32, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT32_T>0
- DETECT_I(uint32_t, UINT32, d_g[nd_g]); nd_g++;
+ DETECT_I(uint32_t, UINT32, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_INT_LEAST32_T>0
- DETECT_I(int_least32_t, INT_LEAST32, d_g[nd_g]); nd_g++;
+ DETECT_I(int_least32_t, INT_LEAST32, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT_LEAST32_T>0
- DETECT_I(uint_least32_t, UINT_LEAST32, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_least32_t, UINT_LEAST32, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_INT_FAST32_T>0
- DETECT_I(int_fast32_t, INT_FAST32, d_g[nd_g]); nd_g++;
+ DETECT_I(int_fast32_t, INT_FAST32, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT_FAST32_T>0
- DETECT_I(uint_fast32_t, UINT_FAST32, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_fast32_t, UINT_FAST32, d_g[nd_g]); nd_g++;
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers64
*
- * Purpose: Detect C99 64 bit integer types
+ * Purpose: Detect C99 64 bit integer types
*
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Return: void
*
*-------------------------------------------------------------------------
*/
@@ -1555,24 +1453,24 @@ detect_C99_integers64(void)
DETECT_I(int64_t, INT64, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT64_T>0
- DETECT_I(uint64_t, UINT64, d_g[nd_g]); nd_g++;
+ DETECT_I(uint64_t, UINT64, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_INT_LEAST64_T>0
- DETECT_I(int_least64_t, INT_LEAST64, d_g[nd_g]); nd_g++;
+ DETECT_I(int_least64_t, INT_LEAST64, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT_LEAST64_T>0
- DETECT_I(uint_least64_t, UINT_LEAST64, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_least64_t, UINT_LEAST64, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_INT_FAST64_T>0
- DETECT_I(int_fast64_t, INT_FAST64, d_g[nd_g]); nd_g++;
+ DETECT_I(int_fast64_t, INT_FAST64, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_UINT_FAST64_T>0
- DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++;
+ DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++;
#endif
#if H5_SIZEOF_LONG_LONG>0
DETECT_I(long long, LLONG, d_g[nd_g]); nd_g++;
- DETECT_I(unsigned long long, ULLONG, d_g[nd_g]); nd_g++;
+ DETECT_I(unsigned long long, ULLONG, d_g[nd_g]); nd_g++;
#else
/*
* This architecture doesn't support an integer type larger than `long'
@@ -1580,23 +1478,17 @@ detect_C99_integers64(void)
* `long long' is probably equivalent to `long' here anyway.
*/
DETECT_I(long, LLONG, d_g[nd_g]); nd_g++;
- DETECT_I(unsigned long, ULLONG, d_g[nd_g]); nd_g++;
+ DETECT_I(unsigned long, ULLONG, d_g[nd_g]); nd_g++;
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_integers
*
- * Purpose: Detect C99 integer types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C99 integer types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1610,19 +1502,13 @@ detect_C99_integers(void)
detect_C99_integers64();
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_C99_floats
*
- * Purpose: Detect C99 floating point types
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect C99 floating point types
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1641,19 +1527,13 @@ detect_C99_floats(void)
#endif
}
-
+
/*-------------------------------------------------------------------------
* Function: detect_alignments
*
- * Purpose: Detect structure alignments
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * 2004/05/20
- *
- * Modifications:
+ * Purpose: Detect structure alignments
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void HDF_NO_UBSAN
@@ -1685,60 +1565,54 @@ static int verify_signal_handlers(int signum, void (*handler)(int))
#endif
void (*save_handler)(int) = HDsignal(signum, handler);
volatile int i, val;
- int ntries=5;
- volatile int nfailures=0;
- volatile int nsuccesses=0;
-
- for (i=0;i<ntries; i++){
- val=H5SETJMP(jbuf_g);
- if (val==0)
- {
- /* send self the signal to trigger the handler */
- signal_handler_tested_g++;
- HDraise(signum);
- /* Should not reach here. Record error. */
- nfailures++;
- }else{
- if (val==signum){
- /* return from signum handler. Record a sucess. */
- nsuccesses++;
- }else{
- fprintf(stderr, "Unknown return value (%d) from H5SETJMP",
- val);
- nfailures++;
+ int ntries = 5;
+ volatile int nfailures = 0;
+ volatile int nsuccesses = 0;
+
+ for(i=0;i<ntries; i++) {
+ val=H5SETJMP(jbuf_g);
+ if(val==0) {
+ /* send self the signal to trigger the handler */
+ signal_handler_tested_g++;
+ HDraise(signum);
+ /* Should not reach here. Record error. */
+ nfailures++;
+ }
+ else {
+ if(val==signum) {
+ /* return from signum handler. Record a sucess. */
+ nsuccesses++;
+ }
+ else {
+ fprintf(stderr, "Unknown return value (%d) from H5SETJMP", val);
+ nfailures++;
+ }
}
- }
}
/* restore save handler, check results and report failures */
HDsignal(signum, save_handler);
- if (nfailures>0 || nsuccesses != ntries){
- fprintf(stderr, "verify_signal_handlers for signal %d did %d tries. "
- "Found %d failures and %d successes\n",
- signum, ntries, nfailures, nsuccesses);
- return(-1);
- }else{
- /* all succeeded */
- return(0);
+ if(nfailures>0 || nsuccesses != ntries) {
+ fprintf(stderr, "verify_signal_handlers for signal %d did %d tries. "
+ "Found %d failures and %d successes\n",
+ signum, ntries, nfailures, nsuccesses);
+ return -1;
+ }
+ else {
+ /* all succeeded */
+ return 0;
}
}
#endif
-
+
/*-------------------------------------------------------------------------
* Function: main
*
- * Purpose: Main entry point.
- *
- * Return: Success: exit(0)
+ * Purpose: Main entry point.
*
- * Failure: exit(1)
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12, 1996
+ * Return: Success: EXIT_SUCCESS
*
* Modifications:
- * Albert Cheng, 2004/05/20
* Some compilers, e.g., Intel C v7.0, took a long time to compile
* with optimization when a module routine contains many code lines.
* Divide up all those types detections macros into subroutines, both
@@ -1747,8 +1621,23 @@ static int verify_signal_handlers(int signum, void (*handler)(int))
*-------------------------------------------------------------------------
*/
int HDF_NO_UBSAN
-main(void)
+main(int argc, char *argv[])
{
+ char *fname = NULL;
+ FILE *f; /* temporary holding place for the stream pointer
+ * so that rawoutstream is changed only when succeeded */
+
+ if(argc > 1)
+ fname = argv[1];
+
+ /* First check if filename is string "NULL" */
+ if(fname != NULL) {
+ /* binary output */
+ if((f = HDfopen(fname, "w")) != NULL)
+ rawoutstream = f;
+ }
+ if(!rawoutstream)
+ rawoutstream = stdout;
#if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS)
#if defined(UAC_NOPRINT) && defined(UAC_SIGBUS)
@@ -1759,8 +1648,8 @@ main(void)
int nvpairs[2];
nvpairs[0] = SSIN_UACPROC;
nvpairs[1] = UAC_NOPRINT | UAC_SIGBUS;
- if (setsysinfo(SSI_NVPAIRS, nvpairs, 1, 0, 0)<0) {
- fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n",
+ if(setsysinfo(SSI_NVPAIRS, nvpairs, 1, 0, 0)<0) {
+ fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n",
HDstrerror(errno));
}
#endif
@@ -1768,15 +1657,15 @@ main(void)
#if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL)
/* verify the SIGBUS and SIGSEGV handlers work properly */
- if (verify_signal_handlers(SIGBUS, sigbus_handler) != 0) {
+ if(verify_signal_handlers(SIGBUS, sigbus_handler) != 0) {
fprintf(stderr, "Signal handler %s for signal %d failed\n",
"sigbus_handler", SIGBUS);
}
- if (verify_signal_handlers(SIGSEGV, sigsegv_handler) != 0) {
+ if(verify_signal_handlers(SIGSEGV, sigsegv_handler) != 0) {
fprintf(stderr, "Signal handler %s for signal %d failed\n",
"sigsegv_handler", SIGSEGV);
}
- if (verify_signal_handlers(SIGILL, sigill_handler) != 0) {
+ if(verify_signal_handlers(SIGILL, sigill_handler) != 0) {
fprintf(stderr, "Signal handler %s for signal %d failed\n",
"sigill_handler", SIGILL);
}
@@ -1803,5 +1692,13 @@ main(void)
print_results (nd_g, d_g, na_g, m_g);
- return 0;
+ if(rawoutstream && rawoutstream != stdout) {
+ if(HDfclose(rawoutstream))
+ fprintf(stderr, "closing rawoutstream");
+ else
+ rawoutstream = NULL;
+ }
+
+ return EXIT_SUCCESS;
}
+
diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c
index 1892806..da7c8d9 100644
--- a/src/H5make_libsettings.c
+++ b/src/H5make_libsettings.c
@@ -26,13 +26,8 @@ static const char *FileHeader = "\n\
* help@hdfgroup.org. *\n\
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *";
/*
- *
- * Created: H5make_libsettings.c
- * 17 Mar 2010
- * Quincey Koziol
- *
- * Purpose: Generate the H5libsettings.c file from the
- * libhdf5.settings file.
+ * Purpose: Generate the H5libsettings.c file from the
+ * libhdf5.settings file.
*
*-------------------------------------------------------------------------
*/
@@ -43,33 +38,31 @@ static const char *FileHeader = "\n\
#define LIBSETTINGSFNAME "libhdf5.settings"
+FILE *rawoutstream = NULL;
+
/*-------------------------------------------------------------------------
- * Function: insert_libhdf5_settings
- *
- * Purpose: insert the contents of libhdf5.settings into a file
- * represented by flibinfo.
- * Make it an empty string if H5_HAVE_EMBEDDED_LIBINFO is not
- * defined, i.e., not enabled.
+ * Function: insert_libhdf5_settings
*
- * Return: void
- *
- * Programmer: Albert Cheng
- * Apr 20, 2009
+ * Purpose: insert the contents of libhdf5.settings into a file
+ * represented by flibinfo.
+ * Make it an empty string if H5_HAVE_EMBEDDED_LIBINFO is not
+ * defined, i.e., not enabled.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
insert_libhdf5_settings(FILE *flibinfo)
{
#ifdef H5_HAVE_EMBEDDED_LIBINFO
- FILE *fsettings; /* for files libhdf5.settings */
+ FILE *fsettings; /* for files libhdf5.settings */
int inchar;
- int bol = 0; /* indicates the beginning of a new line */
+ int bol = 0; /* indicates the beginning of a new line */
if(NULL == (fsettings = HDfopen(LIBSETTINGSFNAME, "r"))) {
HDperror(LIBSETTINGSFNAME);
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* end if */
/* print variable definition and the string */
@@ -77,33 +70,33 @@ insert_libhdf5_settings(FILE *flibinfo)
fprintf(flibinfo, "char H5libhdf5_settings[]=\n");
bol++;
while(EOF != (inchar = HDgetc(fsettings))) {
- if(bol) {
- /* Start a new line */
- fprintf(flibinfo, "\t\"");
- bol = 0;
- } /* end if */
- if(inchar == '\n') {
- /* end of a line */
- fprintf(flibinfo, "\\n\"\n");
- bol++;
+ if(bol) {
+ /* Start a new line */
+ fprintf(flibinfo, "\t\"");
+ bol = 0;
+ } /* end if */
+ if(inchar == '\n') {
+ /* end of a line */
+ fprintf(flibinfo, "\\n\"\n");
+ bol++;
} /* end if */
- else
- HDputc(inchar, flibinfo);
+ else
+ HDputc(inchar, flibinfo);
} /* end while */
if(HDfeof(fsettings)) {
- /* wrap up */
- if(!bol)
- /* EOF found without a new line */
- fprintf(flibinfo, "\\n\"\n");
- fprintf(flibinfo, ";\n\n");
+ /* wrap up */
+ if(!bol)
+ /* EOF found without a new line */
+ fprintf(flibinfo, "\\n\"\n");
+ fprintf(flibinfo, ";\n\n");
} /* end if */
else {
- fprintf(stderr, "Read errors encountered with %s\n", LIBSETTINGSFNAME);
- HDexit(1);
+ fprintf(stderr, "Read errors encountered with %s\n", LIBSETTINGSFNAME);
+ HDexit(EXIT_FAILURE);
} /* end else */
if(0 != HDfclose(fsettings)) {
- HDperror(LIBSETTINGSFNAME);
- HDexit(1);
+ HDperror(LIBSETTINGSFNAME);
+ HDexit(EXIT_FAILURE);
} /* end if */
#else
/* print variable definition and an empty string */
@@ -114,59 +107,50 @@ insert_libhdf5_settings(FILE *flibinfo)
/*-------------------------------------------------------------------------
- * Function: make_libinfo
- *
- * Purpose: Create the embedded library information definition.
- * This sets up for a potential extension that the declaration
- * is printed to a file different from stdout.
- *
- * Return: void
+ * Function: make_libinfo
*
- * Programmer: Albert Cheng
- * Sep 15, 2009
+ * Purpose: Create the embedded library information definition.
+ * This sets up for a potential extension that the declaration
+ * is printed to a file different from stdout.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
make_libinfo(void)
{
/* print variable definition and then the string as a macro. */
- insert_libhdf5_settings(stdout);
+ insert_libhdf5_settings(rawoutstream);
}
/*-------------------------------------------------------------------------
- * Function: print_header
+ * Function: print_header
*
- * Purpose: Prints the header for the generated file.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Mar 12 1997
+ * Purpose: Prints the header for the generated file.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
print_header(void)
{
- time_t now = HDtime(NULL);
- struct tm *tm = HDlocaltime(&now);
- char real_name[30];
- char host_name[256];
- int i;
- const char *s;
+ time_t now = HDtime(NULL);
+ struct tm *tm = HDlocaltime(&now);
+ char real_name[30];
+ char host_name[256];
+ int i;
+ const char *s;
#ifdef H5_HAVE_GETPWUID
- struct passwd *pwd = NULL;
+ struct passwd *pwd = NULL;
#else
- int pwd = 1;
+ int pwd = 1;
#endif
- static const char *month_name[] =
+ static const char *month_name[] =
{
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
- static const char *purpose = "\
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+ static const char *purpose = "\
This machine-generated source code contains\n\
information about the library build configuration\n";
@@ -175,22 +159,22 @@ information about the library build configuration\n";
*/
#ifdef H5_HAVE_GETPWUID
{
- size_t n;
- char *comma;
+ size_t n;
+ char *comma;
- if((pwd = HDgetpwuid(HDgetuid()))) {
- if((comma = HDstrchr(pwd->pw_gecos, ','))) {
- n = MIN(sizeof(real_name) - 1, (unsigned)(comma - pwd->pw_gecos));
- HDstrncpy(real_name, pwd->pw_gecos, n);
- real_name[n] = '\0';
- } /* end if */
+ if((pwd = HDgetpwuid(HDgetuid()))) {
+ if((comma = HDstrchr(pwd->pw_gecos, ','))) {
+ n = MIN(sizeof(real_name) - 1, (unsigned)(comma - pwd->pw_gecos));
+ HDstrncpy(real_name, pwd->pw_gecos, n);
+ real_name[n] = '\0';
+ } /* end if */
else {
- HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
- real_name[sizeof(real_name) - 1] = '\0';
- } /* end else */
- } /* end if */
+ HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
+ real_name[sizeof(real_name) - 1] = '\0';
+ } /* end else */
+ } /* end if */
else
- real_name[0] = '\0';
+ real_name[0] = '\0';
}
#else
real_name[0] = '\0';
@@ -201,7 +185,7 @@ information about the library build configuration\n";
*/
#ifdef H5_HAVE_GETHOSTNAME
if(HDgethostname(host_name, sizeof(host_name)) < 0)
- host_name[0] = '\0';
+ host_name[0] = '\0';
#else
host_name[0] = '\0';
#endif
@@ -209,54 +193,49 @@ information about the library build configuration\n";
/*
* The file header: warning, copyright notice, build information.
*/
- printf("/* Generated automatically by H5make_libsettings -- do not edit */\n\n\n");
- HDputs(FileHeader); /*the copyright notice--see top of this file */
+ fprintf(rawoutstream, "/* Generated automatically by H5make_libsettings -- do not edit */\n\n\n");
+ HDfputs(FileHeader, rawoutstream); /*the copyright notice--see top of this file */
- printf(" *\n * Created:\t\t%s %2d, %4d\n",
- month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year);
+ fprintf(rawoutstream, " *\n * Created:\t\t%s %2d, %4d\n",
+ month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year);
if(pwd || real_name[0] || host_name[0]) {
- printf(" *\t\t\t");
- if(real_name[0])
- printf("%s <", real_name);
+ fprintf(rawoutstream, " *\t\t\t");
+ if(real_name[0])
+ fprintf(rawoutstream, "%s <", real_name);
#ifdef H5_HAVE_GETPWUID
- if(pwd)
- HDfputs(pwd->pw_name, stdout);
+ if(pwd)
+ HDfputs(pwd->pw_name, rawoutstream);
#endif
- if(host_name[0])
- printf("@%s", host_name);
- if(real_name[0])
- printf(">");
- HDputchar('\n');
+ if(host_name[0])
+ fprintf(rawoutstream, "@%s", host_name);
+ if(real_name[0])
+ fprintf(rawoutstream, ">");
+ HDfputc('\n', rawoutstream);
} /* end if */
- printf(" *\n * Purpose:\t\t");
+ fprintf(rawoutstream, " *\n * Purpose:\t\t");
for(s = purpose; *s; s++) {
- HDputchar(*s);
- if('\n' == *s && s[1])
- printf(" *\t\t\t");
+ HDfputc(*s, rawoutstream);
+ if('\n' == *s && s[1])
+ fprintf(rawoutstream, " *\t\t\t");
} /* end for */
- printf(" *\n * Modifications:\n *\n");
- printf(" *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n");
- printf(" *\tIt was generated by code in `H5make_libsettings.c'.\n");
+ fprintf(rawoutstream, " *\n * Modifications:\n *\n");
+ fprintf(rawoutstream, " *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n");
+ fprintf(rawoutstream, " *\tIt was generated by code in `H5make_libsettings.c'.\n");
- printf(" *\n *");
+ fprintf(rawoutstream, " *\n *");
for(i = 0; i < 73; i++)
- HDputchar('-');
- printf("\n */\n\n");
+ HDfputc('-', rawoutstream);
+ fprintf(rawoutstream, "\n */\n\n");
}
/*-------------------------------------------------------------------------
- * Function: print_footer
+ * Function: print_footer
*
- * Purpose: Prints the file footer for the generated file.
- *
- * Return: void
- *
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Mar 31 2010
+ * Purpose: Prints the file footer for the generated file.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -267,22 +246,33 @@ print_footer(void)
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Main entry point.
- *
- * Return: Success: exit(0)
+ * Function: main
*
- * Failure: exit(1)
- *
- * Programmer: Albert Cheng
- * 2010/4/1
+ * Purpose: Main entry point.
*
+ * Return: Success: EXIT_SUCCESS
*-------------------------------------------------------------------------
*/
int
-main(void)
+main(int argc, char *argv[])
{
+ char *fname = NULL;
+ FILE *f; /* temporary holding place for the stream pointer
+ * so that rawoutstream is changed only when succeeded
+ */
+
+ if(argc > 1)
+ fname = argv[1];
+
+ /* First check if filename is string "NULL" */
+ if(fname != NULL) {
+ /* binary output */
+ if((f = HDfopen(fname, "w")) != NULL)
+ rawoutstream = f;
+ }
+ if(!rawoutstream)
+ rawoutstream = stdout;
+
print_header();
/* Generate embedded library information variable definition */
@@ -290,5 +280,13 @@ main(void)
print_footer();
- HDexit(0);
+ if(rawoutstream && rawoutstream != stdout) {
+ if(HDfclose(rawoutstream))
+ fprintf(stderr, "closing rawoutstream");
+ else
+ rawoutstream = NULL;
+ }
+
+ HDexit(EXIT_SUCCESS);
}
+
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 517a620..c8119fe 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -224,7 +224,7 @@ set (H5_TESTS
ntypes
dangle
dtransform
- reserved
+ # reserved disabled
cross_read
freespace
mf
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index cc6ebb8..8838c34 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -439,14 +439,6 @@ set (test_CLEANFILES
tvlstr.h5
tvlstr2.h5
twriteorder.dat
- flush.h5
- flush-swmr.h5
- noflush.h5
- noflush-swmr.h5
- flush_extend.h5
- flush_extend-swmr.h5
- noflush_extend.h5
- noflush_extend-swmr.h5
enum1.h5
titerate.h5
ttsafe.h5
@@ -551,6 +543,8 @@ set (H5TEST_SEPARATE_TESTS
testhdf5
cache
cache_image
+ flush1
+ flush2
)
foreach (test ${H5_TESTS})
if (NOT ${test} IN_LIST H5TEST_SEPARATE_TESTS)
@@ -587,7 +581,6 @@ foreach (test ${H5_TESTS})
endif ()
endforeach ()
-set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1)
set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800)
set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800)
set_tests_properties (H5TEST-btree2 PROPERTIES TIMEOUT 1800)
@@ -630,7 +623,6 @@ if (BUILD_SHARED_LIBS)
endif ()
endforeach ()
- set_tests_properties (H5TEST-shared-flush2 PROPERTIES DEPENDS H5TEST-shared-flush1)
set_tests_properties (H5TEST-shared-fheap PROPERTIES TIMEOUT 1800)
set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT 1800)
set_tests_properties (H5TEST-shared-btree2 PROPERTIES TIMEOUT 1800)
@@ -720,6 +712,54 @@ if (BUILD_SHARED_LIBS)
endif ()
endif ()
+#-- Adding test for flush1/2
+add_test (NAME H5TEST-clear-flush-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ flush.h5
+ flush-swmr.h5
+ noflush.h5
+ noflush-swmr.h5
+ flush_extend.h5
+ flush_extend-swmr.h5
+ noflush_extend.h5
+ noflush_extend-swmr.h5
+ WORKING_DIRECTORY
+ ${HDF5_TEST_BINARY_DIR}/H5TEST
+)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5TEST-flush1 COMMAND $<TARGET_FILE:flush1>)
+else ()
+ add_test (NAME H5TEST-flush1 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:flush1>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=flush1.txt"
+ -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+endif ()
+set_tests_properties (H5TEST-flush1 PROPERTIES
+ DEPENDS H5TEST-clear-flush-objects
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5TEST-flush2 COMMAND $<TARGET_FILE:flush2>)
+else ()
+ add_test (NAME H5TEST-flush2 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:flush2>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=flush2.txt"
+ -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+endif ()
+set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1)
+
#-- Adding test for tcheck_version
add_test (NAME H5TEST-tcheck_version-major COMMAND $<TARGET_FILE:tcheck_version> "-tM")
set_tests_properties (H5TEST-tcheck_version-major PROPERTIES
@@ -826,9 +866,10 @@ add_test (NAME H5TEST-clear-error_test-objects
set_tests_properties (H5TEST-clear-error_test-objects PROPERTIES FIXTURES_SETUP error_test_clear_objects)
if (HDF5_USE_16_API_DEFAULT)
add_test (
- NAME H5TEST-error_test-SKIPPED
+ NAME H5TEST-error_test
COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test>"
)
+ set_property(TEST H5TEST-error_test PROPERTY DISABLED)
else ()
add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
@@ -925,9 +966,10 @@ if (BUILD_SHARED_LIBS)
set_tests_properties (H5TEST-shared-clear-error_test-objects PROPERTIES FIXTURES_SETUP shared_error_test_clear_objects)
if (HDF5_USE_16_API_DEFAULT)
add_test (
- NAME H5TEST-shared-error_test-SKIPPED
+ NAME H5TEST-shared-error_test
COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test-shared>"
)
+ set_property(TEST H5TEST-shared-error_test PROPERTY DISABLED)
else ()
add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:error_test-shared>"
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index a5f0369..b9e37e8 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -65,7 +65,7 @@ struct handler_t {
* parameters. The long-named ones can be partially spelled. When
* adding more, make sure that they don't clash with each other.
*/
-/* The following initialization makes use of C language cancatenating */
+/* The following initialization makes use of C language concatenating */
/* "xxx" "yyy" into "xxxyyy". */
static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RE*CM:O*N:vG:";
static struct long_options l_opts[] = {
diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c
index 0fc0289..b9ed9ce 100644
--- a/tools/src/h5format_convert/h5format_convert.c
+++ b/tools/src/h5format_convert/h5format_convert.c
@@ -226,81 +226,84 @@ convert(hid_t fid, const char *dname)
/* Open the dataset */
if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) {
- error_msg("unable to open dataset \"%s\"\n", dname);
- h5tools_setstatus(EXIT_FAILURE);
- goto error;
-
- } else if(verbose_g)
- HDfprintf(stdout, "Open the dataset\n");
+ error_msg("unable to open dataset \"%s\"\n", dname);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
+ }
+ else if(verbose_g)
+ HDfprintf(stdout, "Open the dataset\n");
/* Get the dataset's creation property list */
if((dcpl = H5Dget_create_plist(did)) < 0) {
- error_msg("unable to get the dataset creation property list\n");
- h5tools_setstatus(EXIT_FAILURE);
- goto error;
+ error_msg("unable to get the dataset creation property list\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
}
/* Get the dataset's layout */
if((layout_type = H5Pget_layout(dcpl)) < 0) {
- error_msg("unable to get the dataset layout type\n");
- h5tools_setstatus(EXIT_FAILURE);
- goto error;
-
- } else if(verbose_g)
- HDfprintf(stdout, "Retrieve the dataset's layout\n");
+ error_msg("unable to get the dataset layout type\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
+ }
+ else if(verbose_g)
+ HDfprintf(stdout, "Retrieve the dataset's layout\n");
switch(layout_type) {
- case H5D_CHUNKED:
- if(verbose_g)
- HDfprintf(stdout, "Dataset is a chunked dataset\n");
-
- /* Get the dataset's chunk indexing type */
- if(H5Dget_chunk_index_type(did, &idx_type) < 0) {
- error_msg("unable to get the chunk indexing type for \"%s\"\n", dname);
- h5tools_setstatus(EXIT_FAILURE);
- goto error;
- } else if(verbose_g)
- HDfprintf(stdout, "Retrieve the dataset's chunk indexing type\n");
+ case H5D_CHUNKED:
+ if(verbose_g)
+ HDfprintf(stdout, "Dataset is a chunked dataset\n");
+
+ /* Get the dataset's chunk indexing type */
+ if(H5Dget_chunk_index_type(did, &idx_type) < 0) {
+ error_msg("unable to get the chunk indexing type for \"%s\"\n", dname);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
+ }
+ else if(verbose_g)
+ HDfprintf(stdout, "Retrieve the dataset's chunk indexing type\n");
+
+ if(idx_type == H5D_CHUNK_IDX_BTREE) {
+ if(verbose_g)
+ HDfprintf(stdout, "Dataset's chunk indexing type is already version 1 B-tree: no further action\n");
+ h5tools_setstatus(EXIT_SUCCESS);
+ goto done;
+ }
+ else if (verbose_g)
+ HDfprintf(stdout, "Dataset's chunk indexing type is not version 1 B-tree\n");
- if(idx_type == H5D_CHUNK_IDX_BTREE) {
- if(verbose_g)
- HDfprintf(stdout, "Dataset's chunk indexing type is already version 1 B-tree: no further action\n");
- h5tools_setstatus(EXIT_SUCCESS);
- goto done;
- } else if (verbose_g)
- HDfprintf(stdout, "Dataset's chunk indexing type is not version 1 B-tree\n");
break;
- case H5D_CONTIGUOUS:
- if(verbose_g)
- HDfprintf(stdout, "Dataset is a contiguous dataset: downgrade layout version as needed\n");
- break;
+ case H5D_CONTIGUOUS:
+ if(verbose_g)
+ HDfprintf(stdout, "Dataset is a contiguous dataset: downgrade layout version as needed\n");
+ break;
- case H5D_COMPACT:
- if(verbose_g)
- HDfprintf(stdout, "Dataset is a compact dataset: downgrade layout version as needed\n");
- break;
+ case H5D_COMPACT:
+ if(verbose_g)
+ HDfprintf(stdout, "Dataset is a compact dataset: downgrade layout version as needed\n");
+ break;
- case H5D_VIRTUAL:
- if(verbose_g)
- HDfprintf(stdout, "No further action for virtual dataset\n");
- goto done;
+ case H5D_VIRTUAL:
+ if(verbose_g)
+ HDfprintf(stdout, "No further action for virtual dataset\n");
+ goto done;
- case H5D_NLAYOUTS:
- case H5D_LAYOUT_ERROR:
- default:
- error_msg("unknown layout type for \"%s\"\n", dname);
- h5tools_setstatus(EXIT_FAILURE);
- goto error;
+ case H5D_NLAYOUTS:
+ case H5D_LAYOUT_ERROR:
+ default:
+ error_msg("unknown layout type for \"%s\"\n", dname);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
} /* end switch */
/* No further action if it is a noop */
if(noop_g) {
- if(verbose_g)
- HDfprintf(stdout, "Not converting the dataset\n");
- h5tools_setstatus(EXIT_SUCCESS);
- goto done;
+ if(verbose_g)
+ HDfprintf(stdout, "Not converting the dataset\n");
+ h5tools_setstatus(EXIT_SUCCESS);
+ goto done;
}
if(verbose_g)
@@ -308,51 +311,54 @@ convert(hid_t fid, const char *dname)
/* Downgrade the dataset */
if(H5Dformat_convert(did) < 0) {
- error_msg("unable to downgrade dataset \"%s\"\n", dname);
- h5tools_setstatus(EXIT_FAILURE);
- goto error;
- } else if(verbose_g)
- HDfprintf(stdout, "Done\n");
+ error_msg("unable to downgrade dataset \"%s\"\n", dname);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto error;
+ }
+ else if(verbose_g)
+ HDfprintf(stdout, "Done\n");
done:
/* Close the dataset */
if(H5Dclose(did) < 0) {
error_msg("unable to close dataset \"%s\"\n", dname);
h5tools_setstatus(EXIT_FAILURE);
- goto error;
- } else if(verbose_g)
- HDfprintf(stdout, "Close the dataset\n");
+ goto error;
+ }
+ else if(verbose_g)
+ HDfprintf(stdout, "Close the dataset\n");
/* Close the dataset creation property list */
if(H5Pclose(dcpl) < 0) {
error_msg("unable to close dataset creation property list\n");
h5tools_setstatus(EXIT_FAILURE);
- goto error;
- } else if(verbose_g)
- printf("Close the dataset creation property list\n");
+ goto error;
+ }
+ else if(verbose_g)
+ HDprintf("Close the dataset creation property list\n");
- return(0);
+ return 0;
error:
if(verbose_g)
- HDfprintf(stdout, "Error encountered\n");
+ HDfprintf(stdout, "Error encountered\n");
H5E_BEGIN_TRY {
H5Pclose(dcpl);
H5Dclose(did);
} H5E_END_TRY;
- return(-1);
+ return -1;
} /* convert() */
/*-------------------------------------------------------------------------
- * Function: convert_dsets_cb()
+ * Function: convert_dsets_cb()
*
- * Purpose: The callback routine from the traversal to convert the
- * chunk indexing type of the dataset object.
+ * Purpose: The callback routine from the traversal to convert the
+ * chunk indexing type of the dataset object.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static int
@@ -363,11 +369,11 @@ convert_dsets_cb(const char *path, const H5O_info_t *oi, const char *already_vis
/* If the object has already been seen then just return */
if(NULL == already_visited) {
if(oi->type == H5O_TYPE_DATASET) {
- if(verbose_g)
- HDfprintf(stdout, "Going to process dataset:%s...\n", path);
- if(convert(fid, path) < 0)
- goto error;
- } /* end if */
+ if(verbose_g)
+ HDfprintf(stdout, "Going to process dataset:%s...\n", path);
+ if(convert(fid, path) < 0)
+ goto error;
+ } /* end if */
} /* end if */
return 0;
diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c
index 01ba4af..4f3e7a4 100644
--- a/tools/src/h5jam/h5jam.c
+++ b/tools/src/h5jam/h5jam.c
@@ -221,7 +221,7 @@ main (int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- parse_command_line (argc, argv);
+ parse_command_line(argc, argv);
if (ub_file == NULL) {
/* no user block */
@@ -252,21 +252,21 @@ main (int argc, const char *argv[])
leave (EXIT_FAILURE);
}
- ifile = H5Fopen (input_file, H5F_ACC_RDONLY, H5P_DEFAULT);
+ ifile = H5Fopen(input_file, H5F_ACC_RDONLY, H5P_DEFAULT);
if (ifile < 0) {
error_msg("Can't open input HDF5 file \"%s\"\n", input_file);
leave (EXIT_FAILURE);
}
- plist = H5Fget_create_plist (ifile);
+ plist = H5Fget_create_plist(ifile);
if (plist < 0) {
error_msg("Can't get file creation plist for file \"%s\"\n", input_file);
H5Fclose(ifile);
leave (EXIT_FAILURE);
}
- status = H5Pget_userblock (plist, &usize);
+ status = H5Pget_userblock(plist, &usize);
if (status < 0) {
error_msg("Can't get user block for file \"%s\"\n", input_file);
H5Pclose(plist);
@@ -330,7 +330,7 @@ main (int argc, const char *argv[])
}
}
- newubsize = compute_user_block_size ((hsize_t) fsize);
+ newubsize = compute_user_block_size((hsize_t) fsize);
startub = usize;
@@ -345,22 +345,22 @@ main (int argc, const char *argv[])
else {
/* add new ub to current ublock, pad to new offset */
newubsize += usize;
- newubsize = compute_user_block_size ((hsize_t) newubsize);
+ newubsize = compute_user_block_size((hsize_t) newubsize);
}
}
/* copy the HDF5 from starting at usize to starting at newubsize:
* makes room at 'from' for new ub */
/* if no current ub, usize is 0 */
- copy_some_to_file (h5fid, ofid, usize, newubsize, (ssize_t) (h5fsize - usize));
+ copy_some_to_file(h5fid, ofid, usize, newubsize, (ssize_t) (h5fsize - usize));
/* copy the old ub to the beginning of the new file */
if (!do_clobber) {
- where = copy_some_to_file (h5fid, ofid, (hsize_t) 0, (hsize_t) 0, (ssize_t) usize);
+ where = copy_some_to_file(h5fid, ofid, (hsize_t) 0, (hsize_t) 0, (ssize_t) usize);
}
/* copy the new ub to the end of the ub */
- where = copy_some_to_file (ufid, ofid, (hsize_t) 0, startub, (ssize_t) - 1);
+ where = copy_some_to_file(ufid, ofid, (hsize_t) 0, startub, (ssize_t) - 1);
/* pad the ub */
if(write_pad(ofid, where, &where) < 0) {
@@ -372,18 +372,18 @@ main (int argc, const char *argv[])
} /* end if */
if(ub_file)
- HDfree (ub_file);
+ HDfree(ub_file);
if(input_file)
- HDfree (input_file);
+ HDfree(input_file);
if(output_file)
- HDfree (output_file);
+ HDfree(output_file);
if(ufid >= 0)
- HDclose (ufid);
+ HDclose(ufid);
if(h5fid >= 0)
- HDclose (h5fid);
+ HDclose(h5fid);
if(ofid >= 0)
- HDclose (ofid);
+ HDclose(ofid);
return h5tools_getstatus();
}
diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c
index b66e7ce..088e6e9 100644
--- a/tools/src/misc/h5debug.c
+++ b/tools/src/misc/h5debug.c
@@ -346,7 +346,7 @@ main(int argc, char *argv[])
/*
* Debug a global heap collection.
*/
- status = H5HG_debug (f, addr, stdout, 0, VCOL);
+ status = H5HG_debug(f, addr, stdout, 0, VCOL);
} else if(!HDmemcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake
index 1bdefa6..924ade1 100644
--- a/tools/test/h5copy/CMakeTests.cmake
+++ b/tools/test/h5copy/CMakeTests.cmake
@@ -128,9 +128,10 @@
macro (ADD_SKIP_H5_TEST testname skipresultfile)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5COPY-${testname}-${skipresultfile}-SKIPPED
+ NAME H5COPY-${testname}-${skipresultfile}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname}-${skipresultfile} ${ARGN}"
)
+ set_property(TEST H5COPY-${testname}-${skipresultfile} PROPERTY DISABLED)
endif ()
endmacro ()
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index 57df850..f74ee50 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -439,9 +439,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5DUMP-${skipresultfile}-SKIPPED
+ NAME H5DUMP-${skipresultfile}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}"
)
+ set_property(TEST H5DUMP-${skipresultfile} PROPERTY DISABLED)
endif ()
else ()
ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN})
diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake
index 9c68e5f..de87d2f 100644
--- a/tools/test/h5dump/CMakeTestsXML.cmake
+++ b/tools/test/h5dump/CMakeTestsXML.cmake
@@ -164,9 +164,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5DUMP_XML-${skipresultfile}-SKIPPED
+ NAME H5DUMP_XML-${skipresultfile}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}"
)
+ set_property(TEST H5DUMP_XML-${skipresultfile} PROPERTY DISABLED)
endif ()
else ()
ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN})
diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake
index 3c65b0b..7d76fba 100644
--- a/tools/test/h5import/CMakeTests.cmake
+++ b/tools/test/h5import/CMakeTests.cmake
@@ -283,9 +283,10 @@
macro (ADD_H5_SKIP_DUMPTEST testname datasetname testfile)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5IMPORT-DUMP-${testname}-SKIPPED
+ NAME H5IMPORT-DUMP-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available"
)
+ set_property(TEST H5IMPORT-DUMP-${testname} PROPERTY DISABLED)
endif ()
endmacro ()
diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake
index f40c0b1..a063e19 100644
--- a/tools/test/h5repack/CMakeTests.cmake
+++ b/tools/test/h5repack/CMakeTests.cmake
@@ -229,9 +229,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_OLD-${testname}-SKIPPED
+ NAME H5REPACK_OLD-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}"
)
+ set_property(TEST H5REPACK_OLD-${testname} PROPERTY DISABLED)
endif ()
else ()
add_test (
@@ -260,9 +261,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK-${testname}-SKIPPED
+ NAME H5REPACK-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}"
)
+ set_property(TEST H5REPACK-${testname} PROPERTY DISABLED)
endif ()
else ()
add_test (
@@ -291,9 +293,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_CMP-${testname}-SKIPPED
+ NAME H5REPACK_CMP-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}"
)
+ set_property(TEST H5REPACK_CMP-${testname} PROPERTY DISABLED)
endif ()
else ()
# If using memchecker add tests without using scripts
@@ -338,9 +341,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_MASK-${testname}-SKIPPED
+ NAME H5REPACK_MASK-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}"
)
+ set_property(TEST H5REPACK_MASK-${testname} PROPERTY DISABLED)
endif ()
else ()
# If using memchecker add tests without using scripts
@@ -385,9 +389,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_DMP-${testname}-SKIPPED
+ NAME H5REPACK_DMP-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}"
)
+ set_property(TEST H5REPACK_DMP-${testname} PROPERTY DISABLED)
endif ()
else ()
add_test (
@@ -427,9 +432,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_STAT-${testname}-SKIPPED
+ NAME H5REPACK_STAT-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile}"
)
+ set_property(TEST H5REPACK_STAT-${testname} PROPERTY DISABLED)
endif ()
else ()
add_test (
@@ -469,9 +475,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED
+ NAME H5REPACK_VERIFY_LAYOUT-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}"
)
+ set_property(TEST H5REPACK_VERIFY_LAYOUT-${testname} PROPERTY DISABLED)
endif ()
else ()
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -542,9 +549,10 @@
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}-SKIPPED
+ NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}"
)
+ set_property(TEST H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTY DISABLED)
endif ()
else ()
if (NOT HDF5_ENABLE_USING_MEMCHECKER)