-
-
Notifications
You must be signed in to change notification settings - Fork 326
Description
Description:
Overview
The HDF5 CMake build system currently defaults to looking specifically for SZIP libraries when HDF5_ENABLE_SZIP_SUPPORT is enabled. However, on most modern Linux distributions (Debian, Ubuntu, Fedora, Arch), the libaec library is the standard, widely available open-source drop-in replacement for SZIP.
Currently, configuring HDF5 to use a system-installed libaec is not straightforward. It often fails to detect libaec automatically, requiring users to manually define SZIP_INCLUDE_DIR and SZIP_LIBRARY paths, to symlink libaec to libsz to trick the build system, or to compile the compression software.
Motivation
- User Experience: Users installing HDF5 dependencies via standard package managers (e.g.,
apt install libaec-dev) expect CMake to find these libraries without manual intervention. - Licensing & Availability:
libaecis BSD-licensed and is the preferred SZIP implementation in the open-source community. HDF5 should treat it as a first-class citizen. - Build Automation: Simplifying this detection reduces the complexity of CI/CD pipelines and Docker builds that rely on system packages.
Current Behavior
When a user runs:
cmake -DHDF5_ENABLE_SZIP_SUPPORT=ON -DHDF5_ENABLE_SZIP_ENCODING=ON ..The build system attempts to find SZIP. If szip is not strictly named or located in standard FindSZIP lookups (often looking for szlib.h or libsz.so), the configuration fails or requires the user to manually path to libaec artifacts.
Desired Behavior
When HDF5_ENABLE_SZIP_SUPPORT is ON, the CMake logic should:
- Check for
SZIP. - If
SZIPis not found, automatically fall back to checking forlibaec(usinglibaec-config.cmakeorpkg-config). - If
libaecis found, automatically alias the targets or set the internalH5_SZIP_*variables to point to thelibaecincludes and libraries. - Handle the difference in library names transparently (i.e., linking against
libaecinstead oflibszif that is what was found).
Environment
- OS: Linux (Ubuntu, Fedora, etc.)
- Build System: CMake
- Library:
libaec(v1.0+) installed via system package manager.
Reproduction Steps
- On a clean Linux container (e.g., Ubuntu 22.04), install build essentials and libaec:
apt-get install build-essential cmake libaec-dev. - Download HDF5 source.
- Attempt to configure with SZIP support:
cmake -S . -B build -DHDF5_ENABLE_SZIP_SUPPORT=ON. - Observation: CMake fails to find SZIP, despite
libaec(the compatible replacement) being present in the system path.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status