Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop libaec fix #5182

Merged
merged 13 commits into from
Jan 10, 2025
12 changes: 9 additions & 3 deletions CMakeFilters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -173,20 +173,26 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
set(libaec_USE_STATIC_LIBS ${HDF5_USE_LIBAEC_STATIC})
set(SZIP_FOUND FALSE)
# Search pure Config mode, there is not a FindSZIP module available
find_package (SZIP NAMES ${LIBAEC_PACKAGE_NAME}${HDF_PACKAGE_EXT} OPTIONAL_COMPONENTS ${LIBAEC_SEARCH_TYPE})
set(H5_SZIP_FOUND ${SZIP_FOUND})
find_package ({LIBAEC_PACKAGE_NAME} NAMES ${LIBAEC_PACKAGE_NAME}${HDF_PACKAGE_EXT} OPTIONAL_COMPONENTS ${LIBAEC_SEARCH_TYPE})
set(H5_SZIP_FOUND ${{LIBAEC_PACKAGE_NAME}_FOUND})
if (H5_SZIP_FOUND)
set (H5_SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR})
set (H5_SZIP_INCLUDE_DIRS ${H5_SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR})
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES})
if(LIBAEC_PACKAGE_NAME STREQUAL "libaec")
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} libaec::sz libaec::aec)
else ()
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES})
endif ()
endif ()
message (VERBOSE "H5_SZIP_FOUND=${SZIP_FOUND} and LINK_COMP_LIBS=${LINK_COMP_LIBS}")
else ()
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING})
message (VERBOSE "Filter SZIP is built using library AEC")
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${H5_SZIP_STATIC_LIBRARY})
endif ()
endif ()
message (VERBOSE "LINK_COMP_LIBS=${LINK_COMP_LIBS}")
if (H5_SZIP_FOUND)
set (H5_HAVE_FILTER_SZIP 1)
set (H5_HAVE_SZLIB_H 1)
Expand Down
7 changes: 6 additions & 1 deletion release_docs/INSTALL_CMake.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ IV. Further considerations
web site. The HDF5 2."X"."Y" product requires a minimum CMake version 3.18.
If you are using VS2022, the CMake minimum version is 3.21.

2. If you plan to use Zlib or Szip:
2. If you plan to use Zlib or Szip (libaec):
A. Download the binary packages and install them in a central location.
For example on Windows, create a folder extlibs and install the
packages there. Add the following CMake options:
Expand All @@ -295,10 +295,15 @@ IV. Further considerations
-DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib
-DSZIP_INCLUDE_DIR:PATH=some_location/include
-DSZIP_USE_EXTERNAL:BOOL=OFF
(For libaec use -Dlibaec_* options)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe (For libaec use -Dlibaec_* in place of -DSZIP_* for these options) would be clearer, if that is the actual meaning?

Copy link

@vessokolev vessokolev Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the actual meaning indeed. The original SZIP package (under that name) is not only carrying code with problematic licence, it is very old as a conception. Currently, the only reliable SZIP compressor and encoder is provided by Libaec. Maybe some sites still support SZIP, but I consider that to be driven by purely anthropological interest.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command "cmake -C ../<hdf5_src_dir>/config/cmake/cacheinit.cmake -G "Unix Makefiles" -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="GIT" -DHDF5_ENABLE_ROS3_VFD=ON -DHDF5_ENABLE_ZLIB_SUPPORT=ON -DHDF5_ENABLE_SZIP_SUPPORT=ON -DHDF5_ENABLE_PLUGIN_SUPPORT=ON -DCMAKE_BUILD_TYPE:STRING=Release ../<hdf5_src_dir>" now downloads and builds szip from https://github.com/MathisRosenhauer/libaec.git using the code from byrnHDF:develop-libaec-fix.

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")
set(ENV{libaec_ROOT} "some_location")

Note that if there is a problem finding the libraries, try adding the
CMake variable CMAKE_FIND_DEBUG_MODE:BOOL=ON to the command line.

B. Use source packages from an GIT server by adding the following CMake
options:
Expand Down
8 changes: 8 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,14 @@ Bug Fixes since HDF5-2.0.0 release

Configuration
-------------
- Use pre-installed libaec compression library

The CMake logic for finding the libaec compression library has been
modified for a system-installed version of the library. Two options
must be set, HDF5_ALLOW_EXTERNAL_SUPPORT:STRING=NO and *_USE_EXTERNAL:BOOL=OFF.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there is only one *_USE_EXTERNAL:BOOL=OFF option to set? Is it libaec_USE_EXTERNAL:BOOL=OFF, or one or more others?

Note that disables building all plugins and external libraries in-line with the
HDF5 library. In addition, the *_ROOT environment variables must be set.

- Changed the zlib/szip compression find message to FATAL ERROR

The message was changed to indicate that zlib/szip compression was requested and
Expand Down
Loading