mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
Add SZ filter and adjust compression file names to avoid conflicts (#1434)
* Updated plugins project required adjustments * Updated plugins need to distinguish external libs * Fix missed rename * Use same name for windows as linux - avoid name clash
This commit is contained in:
parent
bbb0acf353
commit
08ec5b45a5
@ -19,7 +19,7 @@ include (FetchContent)
|
||||
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)
|
||||
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
option (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1)
|
||||
option (ZLIB_USE_EXTERNAL "Use External Library Building for HDF5_ZLIB" 1)
|
||||
option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1)
|
||||
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT")
|
||||
set (ZLIB_URL ${ZLIB_GIT_URL} CACHE STRING "Path to zlib git repository")
|
||||
@ -82,7 +82,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
|
||||
set (H5_HAVE_ZLIB_H 1)
|
||||
set (H5_HAVE_LIBZ 1)
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
|
||||
message (VERBOSE "Filter ZLIB is built")
|
||||
message (VERBOSE "Filter HDF5_ZLIB is built")
|
||||
endif ()
|
||||
else ()
|
||||
message (FATAL_ERROR " ZLib is Required for ZLib support in HDF5")
|
||||
@ -100,7 +100,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
|
||||
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY})
|
||||
INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS})
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
|
||||
message (VERBOSE "Filter ZLIB is ON")
|
||||
message (VERBOSE "Filter HDF5_ZLIB is ON")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
@ -149,9 +149,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
|
||||
message (VERBOSE "... with library AEC")
|
||||
endif ()
|
||||
set (SZ_PACKAGE_NAME ${LIBAEC_PACKAGE_NAME})
|
||||
set (SZIP_PACKAGE_NAME ${LIBAEC_PACKAGE_NAME})
|
||||
else ()
|
||||
set (SZ_PACKAGE_NAME ${SZIP_PACKAGE_NAME})
|
||||
set (SZIP_PACKAGE_NAME ${SZIP_PACKAGE_NAME})
|
||||
endif ()
|
||||
else ()
|
||||
message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5")
|
||||
|
@ -442,11 +442,11 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
|
||||
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
|
||||
if (WIN32)
|
||||
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;ALL;/")
|
||||
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};HDF5_ZLIB;ALL;/")
|
||||
else ()
|
||||
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/")
|
||||
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/")
|
||||
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/")
|
||||
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};HDF5_ZLIB;libraries;/")
|
||||
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};HDF5_ZLIB;headers;/")
|
||||
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};HDF5_ZLIB;configinstall;/")
|
||||
endif ()
|
||||
endif ()
|
||||
if (SZIP_FOUND AND SZIP_USE_EXTERNAL)
|
||||
|
@ -895,10 +895,10 @@ add_subdirectory (src)
|
||||
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
|
||||
if (NOT ONLY_SHARED_LIBS)
|
||||
add_dependencies (${HDF5_LIB_TARGET} ZLIB)
|
||||
add_dependencies (${HDF5_LIB_TARGET} HDF5_ZLIB)
|
||||
endif ()
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_dependencies (${HDF5_LIBSH_TARGET} ZLIB)
|
||||
add_dependencies (${HDF5_LIBSH_TARGET} HDF5_ZLIB)
|
||||
endif ()
|
||||
endif ()
|
||||
if (SZIP_FOUND AND SZIP_USE_EXTERNAL)
|
||||
|
@ -19,6 +19,8 @@ set (CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 50000)
|
||||
set (CTEST_CUSTOM_WARNING_EXCEPTION
|
||||
${CTEST_CUSTOM_WARNING_EXCEPTION}
|
||||
"note.*expected.*void.*but argument is of type.*volatile"
|
||||
"plugin-build.*:[ \t]*warning"
|
||||
"CMake Warning*stamp"
|
||||
"src.ZLIB.*:[ \t]*warning"
|
||||
"warning LNK4197:.*ZLIB-prefix"
|
||||
"src.SZIP.*:[ \t]*warning"
|
||||
|
@ -57,8 +57,8 @@ macro (EXTERNAL_PLUGIN_LIBRARY compress_type)
|
||||
add_dependencies (h5ex_d_mafisc ${HDF5_LIBSH_TARGET})
|
||||
target_include_directories (h5ex_d_mafisc PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}")
|
||||
endif ()
|
||||
if (ENABLE_SZF)
|
||||
add_dependencies (h5szf ${HDF5_LIBSH_TARGET})
|
||||
if (ENABLE_SZ)
|
||||
add_dependencies (h5sz ${HDF5_LIBSH_TARGET})
|
||||
add_dependencies (h5ex_d_sz ${HDF5_LIBSH_TARGET})
|
||||
target_include_directories (h5ex_d_sz PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}")
|
||||
endif ()
|
||||
|
@ -47,12 +47,12 @@ set (HDF5_MINGW_STATIC_GCC_LIBS ON CACHE BOOL "Statically link libgcc/libstdc++"
|
||||
set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE)
|
||||
set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ)
|
||||
|
||||
set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
|
||||
set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use HDF5_ZLib from compressed file" FORCE)
|
||||
set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE)
|
||||
set (SZAEC_TGZ_NAME "LIBAEC.tar.gz" CACHE STRING "Use SZip AEC from compressed file" FORCE)
|
||||
set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE)
|
||||
|
||||
set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
|
||||
set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of HDF5_ZLIB package" FORCE)
|
||||
set (LIBAEC_PACKAGE_NAME "libaec" CACHE STRING "Name of AEC SZIP package" FORCE)
|
||||
set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE)
|
||||
|
||||
@ -85,12 +85,12 @@ set (BLOSC_TGZ_NAME "c-blosc.tar.gz" CACHE STRING "Use BLOSC from compressed fil
|
||||
|
||||
set (BLOSC_PACKAGE_NAME "blosc" CACHE STRING "Name of BLOSC package" FORCE)
|
||||
|
||||
set (ZLIB_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/zlib.git" CACHE STRING "Use ZLIB from HDF repo" FORCE)
|
||||
set (ZLIB_GIT_BRANCH "master" CACHE STRING "" FORCE)
|
||||
set (BLOSC_ZLIB_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/zlib.git" CACHE STRING "Use BLOSC_ZLIB from HDF repo" FORCE)
|
||||
set (BLOSC_ZLIB_GIT_BRANCH "master" CACHE STRING "" FORCE)
|
||||
|
||||
set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
|
||||
set (BLOSC_ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use BLOSC_ZLib from compressed file" FORCE)
|
||||
|
||||
set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
|
||||
set (BLOSC_ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of BLOSC_ZLIB package" FORCE)
|
||||
|
||||
#######
|
||||
# bzip2
|
||||
@ -159,15 +159,15 @@ set (LZF_PACKAGE_NAME "lzf" CACHE STRING "Name of LZF package" FORCE)
|
||||
#set (MAFISC_PACKAGE_NAME "mafisc" CACHE STRING "Name of MAFISC package" FORCE)
|
||||
|
||||
######
|
||||
# szf
|
||||
# sz
|
||||
######
|
||||
|
||||
set (SZF_GIT_URL "https://github.com/disheng222/SZ" CACHE STRING "Use SZ from github repository" FORCE)
|
||||
set (SZF_GIT_BRANCH "master" CACHE STRING "" FORCE)
|
||||
set (SZ_GIT_URL "https://github.com/disheng222/SZ" CACHE STRING "Use SZ filter from github repository" FORCE)
|
||||
set (SZ_GIT_BRANCH "master" CACHE STRING "" FORCE)
|
||||
|
||||
set (SZF_TGZ_NAME "szf.tar.gz" CACHE STRING "Use SZ from compressed file" FORCE)
|
||||
set (SZ_TGZ_NAME "szf.tar.gz" CACHE STRING "Use SZ filter from compressed file" FORCE)
|
||||
|
||||
set (SZF_PACKAGE_NAME "szf" CACHE STRING "Name of SZ package" FORCE)
|
||||
set (SZ_PACKAGE_NAME "SZ" CACHE STRING "Name of SZ filter package" FORCE)
|
||||
|
||||
######
|
||||
# zfp
|
||||
|
@ -116,7 +116,7 @@ if (NOT TARGET "@HDF5_PACKAGE@")
|
||||
include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
|
||||
endif ()
|
||||
if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS)
|
||||
include (@PACKAGE_SHARE_INSTALL_DIR@/@SZ_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
|
||||
include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
|
||||
endif ()
|
||||
include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
|
||||
endif ()
|
||||
|
@ -139,11 +139,11 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
|
||||
# add_subdirectory(${szip_SOURCE_DIR} ${szip_BINARY_DIR})
|
||||
# endif()
|
||||
#
|
||||
##include (${BINARY_DIR}/${SZ_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
|
||||
##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
|
||||
# Create imported target szip-static
|
||||
if (USE_LIBAEC)
|
||||
add_library(${HDF_PACKAGE_NAMESPACE}sz-static STATIC IMPORTED)
|
||||
HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}sz-static "sz" STATIC "")
|
||||
HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}sz-static "szaec" STATIC "")
|
||||
add_dependencies (${HDF_PACKAGE_NAMESPACE}sz-static SZIP)
|
||||
add_library(${HDF_PACKAGE_NAMESPACE}aec-static STATIC IMPORTED)
|
||||
HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}aec-static "aec" STATIC "")
|
||||
@ -188,7 +188,7 @@ endmacro ()
|
||||
#-------------------------------------------------------------------------------
|
||||
macro (EXTERNAL_ZLIB_LIBRARY compress_type)
|
||||
if (${compress_type} MATCHES "GIT")
|
||||
EXTERNALPROJECT_ADD (ZLIB
|
||||
EXTERNALPROJECT_ADD (HDF5_ZLIB
|
||||
GIT_REPOSITORY ${ZLIB_URL}
|
||||
GIT_TAG ${ZLIB_BRANCH}
|
||||
INSTALL_COMMAND ""
|
||||
@ -207,7 +207,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
|
||||
-DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
|
||||
)
|
||||
elseif (${compress_type} MATCHES "TGZ")
|
||||
EXTERNALPROJECT_ADD (ZLIB
|
||||
EXTERNALPROJECT_ADD (HDF5_ZLIB
|
||||
URL ${ZLIB_URL}
|
||||
URL_MD5 ""
|
||||
INSTALL_COMMAND ""
|
||||
@ -226,19 +226,15 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
|
||||
-DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
|
||||
)
|
||||
endif ()
|
||||
externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR)
|
||||
externalproject_get_property (HDF5_ZLIB BINARY_DIR SOURCE_DIR)
|
||||
|
||||
if (WIN32)
|
||||
set (ZLIB_LIB_NAME "zlib")
|
||||
else ()
|
||||
set (ZLIB_LIB_NAME "z")
|
||||
endif ()
|
||||
##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
|
||||
# Create imported target zlib-static
|
||||
add_library(${HDF_PACKAGE_NAMESPACE}zlib-static STATIC IMPORTED)
|
||||
# add_library(${HDF_PACKAGE_NAMESPACE}zlib-static ALIAS zlib-static)
|
||||
HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-static ${ZLIB_LIB_NAME} STATIC "")
|
||||
add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-static ZLIB)
|
||||
add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-static HDF5_ZLIB)
|
||||
set (ZLIB_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-static")
|
||||
set (ZLIB_LIBRARIES ${ZLIB_STATIC_LIBRARY})
|
||||
|
||||
@ -256,6 +252,6 @@ macro (PACKAGE_ZLIB_LIBRARY compress_type)
|
||||
)
|
||||
set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h)
|
||||
if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ")
|
||||
add_dependencies (ZLIB-GenHeader-Copy ZLIB)
|
||||
add_dependencies (ZLIB-GenHeader-Copy HDF5_ZLIB)
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
Loading…
Reference in New Issue
Block a user