From 257e19cf8d00f66eec078155c0ff4a85858f6329 Mon Sep 17 00:00:00 2001 From: Jan-Willem Blokland Date: Fri, 28 May 2021 17:01:33 +0200 Subject: [PATCH 1/3] CMake: (feature) libaec Implemented better support for the compression library libaec. Especially, for the new version 1.0.5: - The CMake config files of this version 1.0.5 now set certain SZIP variables which can be used in the existing CMake structure. - Both static and shared SZIP compatible libaec library contains all required objects such it can be easily used when building HDF5 from scratch. - Introduced the USE_LIBAEC_STATIC option to make use of the static version of SZIP compatible libaec library. --- CMakeFilters.cmake | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index d5f801e2895..fd56210b956 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -10,6 +10,7 @@ # help@hdfgroup.org. # option (USE_LIBAEC "Use AEC library as SZip Filter" OFF) +option (USE_LIBAEC_STATIC "Use static AEC library " OFF) include (ExternalProject) include (FetchContent) @@ -110,12 +111,20 @@ option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) if (HDF5_ENABLE_SZIP_SUPPORT) option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) if (NOT SZIP_USE_EXTERNAL) - find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) - if (NOT SZIP_FOUND) - find_package (SZIP) # Legacy find + if (USE_LIBAEC) + set(libaec_USE_STATIC_LIBS ${USE_LIBAEC_STATIC}) + find_package (libaec 1.0.5 CONFIG) if (SZIP_FOUND) set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) endif () + else () + find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT SZIP_FOUND) + find_package (SZIP) # Legacy find + if (SZIP_FOUND) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) + endif () + endif () endif () endif () if (SZIP_FOUND) From 9a8dfbc26ed03cf5a56b37ce08e25c7e6be5b22f Mon Sep 17 00:00:00 2001 From: Jan-Willem Blokland Date: Tue, 15 Jun 2021 16:04:52 +0200 Subject: [PATCH 2/3] CMake: (fix) libaec Implemented the fallback option for the case if version 1.0.5 of libaec could not be found. --- CMakeFilters.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index fd56210b956..51ac61cdea1 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -111,13 +111,16 @@ option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) if (HDF5_ENABLE_SZIP_SUPPORT) option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) if (NOT SZIP_USE_EXTERNAL) + set(SZIP_FOUND FALSE) if (USE_LIBAEC) set(libaec_USE_STATIC_LIBS ${USE_LIBAEC_STATIC}) find_package (libaec 1.0.5 CONFIG) if (SZIP_FOUND) set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) endif () - else () + endif () + + if (NOT SZIP_FOUND) find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) if (NOT SZIP_FOUND) find_package (SZIP) # Legacy find From 2c80177ee3b92a7e2de80c2760d54e86d5c75de5 Mon Sep 17 00:00:00 2001 From: Jan-Willem Blokland Date: Wed, 16 Jun 2021 14:44:21 +0200 Subject: [PATCH 3/3] Docs: Added description about libaec implementation. Added short description about the libaec improvement to the Bug Fixes section in the Configuration sub-section. --- release_docs/RELEASE.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 3c1870efef3..31e088acb1a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1060,6 +1060,21 @@ Bug Fixes since HDF5-1.12.0 release Configuration ------------- + - Better support for libaec (open-source Szip library) in CMake + + Implemented better support for libaec 1.0.5 (or later) library. This version + of libaec contains improvements for better integration with HDF5. Furthermore, + the variable USE_LIBAEC_STATIC has been introduced to allow to make use of + static version of libaec library. Use libaec_DIR or libaec_ROOT to set + the location in which libaec can be found. + + Be aware, the Szip library of libaec 1.0.4 depends on another library within + libaec library. This dependency is not specified in the current CMake + configuration which means that one can not use the static Szip library of + libaec 1.0.4 when building HDF5. This has been resolved in libaec 1.0.5. + + (JWSB - 2021/06/22) + - Refactor CMake configure for Fortran The Fortran configure tests for KINDs reused a single output file that was