Skip to content

Commit

Permalink
HDF5 2021-07-06 (820695a7)
Browse files Browse the repository at this point in the history
Code extracted from:

    https://github.com/HDFGroup/hdf5.git

at commit 820695a78e3a277daea1bdcbb8ad54b8ee6650a5 (hdf5-1_12_1).
  • Loading branch information
HDF5 Maintainers authored and hjmjohnson committed Jan 1, 2022
1 parent 044057f commit 43cb3bb
Show file tree
Hide file tree
Showing 689 changed files with 178,263 additions and 120,609 deletions.
96 changes: 96 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
Language: Cpp
BasedOnStyle: LLVM
AlignConsecutiveAssignments: true
#llvm11: AlignConsecutiveBitFields: false
AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: true
#llvm10-11: AlignOperands: true - Align
#llvm11: AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: None
AlwaysBreakAfterReturnType: AllDefinitions
# Can enable the following section when llvm 12.x is out
#AttributeMacros:
# - H5_ATTR_FORMAT
# - H5_ATTR_UNUSED
# - H5_ATTR_DEPRECATED_USED
# - H5_ATTR_NDEBUG_UNUSED
# - H5_ATTR_DEBUG_API_USED
# - H5_ATTR_PARALLEL_UNUSED
# - H5_ATTR_PARALLEL_USED
# - H5_ATTR_NORETURN
# - H5_ATTR_CONST
# - H5_ATTR_PURE
# - H5_ATTR_FALLTHROUGH
BraceWrapping:
AfterFunction: true
#llvm10-11: AfterControlStatement: false - Never
BeforeCatch: true
BeforeElse: true
#llvm11: BeforeLambdaBody: false
#llvm11: BeforeWhile: false
BreakBeforeBraces: Stroustrup
BreakAfterJavaFieldAnnotations: true
BreakStringLiterals: true
ColumnLimit: 110 # Update $max_trace_macro_line_len in bin/trace also
ForEachMacros: ['ALL_MEMBERS', 'UNIQUE_MEMBERS']
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 3
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 4
SortPriority: 0
- Regex: '.*'
Priority: 0
SortPriority: 0
- Regex: '^H5*.*'
Priority: 1
SortPriority: 0
- Regex: 'private.*'
Priority: 2
SortPriority: 0
IncludeIsMainRegex: '(public)?$'
IndentCaseLabels: true
#llvm11: IndentCaseBlocks: false
IndentGotoLabels: false
#llvm11: IndentExternBlock: AfterExternBlock
IndentWidth: 4
#llvm11: InsertTrailingCommas: None
MacroBlockBegin: "^BEGIN_FUNC"
MacroBlockEnd: "^END_FUNC"
ObjCBlockIndentWidth: 4
#llvm11: ObjCBreakBeforeNestedBlockParam: true
ReflowComments: true
SortIncludes: false
StatementMacros:
- FUNC_ENTER_API
- FUNC_LEAVE_API
- FUNC_ENTER_NOAPI_NOINIT_NOERR
- FUNC_LEAVE_NOAPI
- H5_BEGIN_TAG
- HGOTO_DONE_TAG
- H5_END_TAG
- HSYS_DONE_ERROR
- HSYS_GOTO_ERROR
- HDONE_ERROR
- HERROR
- H5_LEAVE
- H5E_PRINTF
- H5E_THROW
- HGOTO_DONE
- HGOTO_ERROR
- HMPI_ERROR
- HMPI_DONE_ERROR
- HMPI_GOTO_ERROR
- H5_GCC_DIAG_OFF
- H5_GCC_DIAG_ON
- CATCH
#llvm10: TypenameMacros:
#llvm10: - STACK_OF
#llvm10: - LIST
#llvm11: WhitespaceSensitiveMacros:
#llvm11: - STRINGIZE
#llvm11: - PP_STRINGIZE
...

32 changes: 24 additions & 8 deletions CMakeFilters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# [email protected].
#
option (USE_LIBAEC "Use AEC library as SZip Filter" OFF)

include (ExternalProject)
include (FetchContent)

#option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO")
set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)")
set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ)
Expand All @@ -30,15 +32,19 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT
set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME})
if (NOT EXISTS "${ZLIB_URL}")
set (HDF5_ENABLE_Z_LIB_SUPPORT OFF CACHE BOOL "" FORCE)
message (STATUS "Filter ZLIB file ${ZLIB_URL} not found")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter ZLIB file ${ZLIB_URL} not found")
endif ()
endif ()
set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME})
if (USE_LIBAEC)
set (SZIP_URL ${TGZPATH}/${SZAEC_TGZ_NAME})
endif ()
if (NOT EXISTS "${SZIP_URL}")
set (HDF5_ENABLE_SZIP_SUPPORT OFF CACHE BOOL "" FORCE)
message (STATUS "Filter SZIP file ${SZIP_URL} not found")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter SZIP file ${SZIP_URL} not found")
endif ()
endif ()
else ()
set (ZLIB_USE_EXTERNAL 0)
Expand Down Expand Up @@ -74,7 +80,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
set (H5_HAVE_FILTER_DEFLATE 1)
set (H5_HAVE_ZLIB_H 1)
set (H5_HAVE_LIBZ 1)
message (STATUS "Filter ZLIB is built")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter ZLIB is built")
endif ()
else ()
message (FATAL_ERROR " ZLib is Required for ZLib support in HDF5")
endif ()
Expand All @@ -90,7 +98,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
endif ()
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY})
INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS})
message (STATUS "Filter ZLIB is ON")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter ZLIB is ON")
endif ()
endif ()

#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -120,9 +130,13 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
set (H5_HAVE_FILTER_SZIP 1)
set (H5_HAVE_SZLIB_H 1)
set (H5_HAVE_LIBSZ 1)
message (STATUS "Filter SZIP is built")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter SZIP is built")
endif ()
if (USE_LIBAEC)
message (STATUS "... with library AEC")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "... with library AEC")
endif ()
set (SZ_PACKAGE_NAME ${LIBAEC_PACKAGE_NAME})
else ()
set (SZ_PACKAGE_NAME ${SZIP_PACKAGE_NAME})
Expand All @@ -133,7 +147,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
endif ()
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY})
INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS})
message (STATUS "Filter SZIP is ON")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter SZIP is ON")
endif ()
if (H5_HAVE_FILTER_SZIP)
set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE")
endif ()
Expand Down
50 changes: 25 additions & 25 deletions CMakeInstallation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# [email protected].
#
Expand Down Expand Up @@ -53,7 +53,7 @@ endif ()
#-----------------------------------------------------------------------------
set (HDF5_INCLUDES_BUILD_TIME
${HDF5_SRC_DIR} ${HDF5_CPP_SRC_DIR} ${HDF5_HL_SRC_DIR}
${HDF5_TOOLS_SRC_DIR} ${HDF5_BINARY_DIR}
${HDF5_TOOLS_SRC_DIR} ${HDF5_SRC_BINARY_DIR}
)

#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -124,10 +124,10 @@ else ()
endif ()
configure_file (
${HDF_RESOURCES_DIR}/libhdf5.settings.cmake.in
${HDF5_BINARY_DIR}/libhdf5.settings ESCAPE_QUOTES @ONLY
${HDF5_SRC_BINARY_DIR}/libhdf5.settings ESCAPE_QUOTES @ONLY
)
install (
FILES ${HDF5_BINARY_DIR}/libhdf5.settings
FILES ${HDF5_SRC_BINARY_DIR}/libhdf5.settings
DESTINATION ${HDF5_INSTALL_LIB_DIR}
COMPONENT libraries
)
Expand Down Expand Up @@ -185,7 +185,7 @@ HDF_README_PROPERTIES(HDF5_BUILD_FORTRAN)
#-----------------------------------------------------------------------------
# Configure the COPYING.txt file for the windows binary package
#-----------------------------------------------------------------------------
if (WIN32 OR MINGW)
if (WIN32)
configure_file (${HDF5_SOURCE_DIR}/COPYING ${HDF5_BINARY_DIR}/COPYING.txt @ONLY)
endif ()

Expand All @@ -201,10 +201,9 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs")
set (release_files
${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_CMake.txt
${HDF5_SOURCE_DIR}/release_docs/COPYING
${HDF5_SOURCE_DIR}/release_docs/RELEASE.txt
)
if (WIN32 OR MINGW)
if (WIN32)
set (release_files
${release_files}
${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt
Expand All @@ -218,7 +217,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt
${HDF5_SOURCE_DIR}/release_docs/INSTALL
)
if (WIN32 OR MINGW)
if (WIN32)
set (release_files
${release_files}
${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt
Expand All @@ -245,19 +244,6 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
endif ()
endif ()

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
if (CMAKE_HOST_UNIX)
set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}"
CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
else ()
GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
set (CMAKE_INSTALL_PREFIX
"${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}"
CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
set (CMAKE_GENERIC_PROGRAM_FILES)
endif ()
endif ()

#-----------------------------------------------------------------------------
# Set the cpack variables
#-----------------------------------------------------------------------------
Expand All @@ -272,9 +258,9 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
set (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}")
set (CPACK_PACKAGE_VERSION_PATCH "")
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
if (EXISTS "${HDF5_SOURCE_DIR}/release_docs")
set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt")
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt")
endif ()
set (CPACK_PACKAGE_RELOCATABLE TRUE)
Expand All @@ -286,7 +272,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}/hdf.bmp")

set (CPACK_GENERATOR "TGZ")
if (WIN32 OR MINGW)
if (WIN32)
set (CPACK_GENERATOR "ZIP")

if (NSIS_EXECUTABLE)
Expand Down Expand Up @@ -451,7 +437,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
if (HDF5_PACKAGE_EXTLIBS)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
if (WIN32 OR MINGW)
if (WIN32)
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;ALL;/")
else ()
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/")
Expand All @@ -460,14 +446,21 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
endif ()
endif ()
if (SZIP_FOUND AND SZIP_USE_EXTERNAL)
if (WIN32 OR MINGW)
if (WIN32)
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;ALL;/")
else ()
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/")
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/")
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/")
endif ()
endif ()
if (PLUGIN_FOUND AND PLUGIN_USE_EXTERNAL)
if (WIN32)
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PLUGIN_BINARY_DIR};PLUGIN;ALL;/")
else ()
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PLUGIN_BINARY_DIR};PLUGIN;libraries;/")
endif ()
endif ()
endif ()
endif ()

Expand Down Expand Up @@ -550,6 +543,13 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
)
endif ()

cpack_add_component (utilsapplications
DISPLAY_NAME "HDF5 Utility Applications"
DEPENDS libraries
GROUP Applications
INSTALL_TYPES Full Developer User
)

if (HDF5_BUILD_TOOLS)
cpack_add_component (toolsapplications
DISPLAY_NAME "HDF5 Tools Applications"
Expand Down
Loading

0 comments on commit 43cb3bb

Please sign in to comment.