You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When configuring the source I can use the cmake define -DGDAL_USE_HDF5=OFF to disable HDF5 support. What happens is that HDF5 is still detected due to the following code in cmake/helpers/CheckDependentLibraries.cmake:
if(HAVE_KEA)
# CXX is only needed for KEA driver
gdal_check_package(HDF5 "Enable HDF5" COMPONENTS "C" "CXX" CAN_DISABLE VERSION 1.10)
else()
gdal_check_package(HDF5 "Enable HDF5" COMPONENTS "C" CAN_DISABLE VERSION 1.10)
endif()
KEA driver depends on HDF5 but if both KEA and HDF5 are disabled, the configure system still looks for HDF5 libraries. I think that something like the following will fix the issue:
if(HAVE_KEA)
# CXX is only needed for KEA driver
gdal_check_package(HDF5 "Enable HDF5" COMPONENTS "C" "CXX" CAN_DISABLE VERSION 1.10)
else()
if(GDAL_USE_HDF5)
gdal_check_package(HDF5 "Enable HDF5" COMPONENTS "C" CAN_DISABLE VERSION 1.10)
endif()
endif()
Steps to reproduce the issue
just run cmake with -DGDAL_USE_HDF5=no and -DGDAL_USE_KEA=OFF on a system with hdf5 installed
I get
...
-- Found HDF5: /usr/lib64/libhdf5.so;/usr/lib64/libsz.so;/usr/lib64/libz.so;/usr/lib64/libdl.a;/usr/lib64/libm.so (found version "1.14.4-3") found components: C
...
* HDF5
Enable HDF5
...
in the output log.
Versions and provenance
Gentoo Linux
$ gdalinfo --version
GDAL 3.9.1, released 2024/06/22
Additional context
No response
The text was updated successfully, but these errors were encountered:
That's probably more a UI / documentation issue than a bug (but not sure where/how clarifying it). Turning off the use of a package doesn't turn off its detection. That's on purpose for reasons I don't remember right now. But the end effect is that drivers that depend on the packages, namely HDF5 and KEA, are not enabled themselves:
-- The following OPTIONAL packages have been found:
[....]
* HDF5
Enable HDF5
[....]
-- The following features have been disabled:
[...]
* gdal_HDF5, Hierarchical Data Format Release 5 (HDF5)
* gdal_KEA, Kea
[....]
I see. Thanks for pointing it out. Typically disabling some feature disables also its detection, IMHO it makes sense to cite in the docs. I will leave open there this issue and let you decide if you want to convert into a documentation issue.
What is the bug?
When configuring the source I can use the cmake define
-DGDAL_USE_HDF5=OFF
to disable HDF5 support. What happens is that HDF5 is still detected due to the following code in cmake/helpers/CheckDependentLibraries.cmake:KEA driver depends on HDF5 but if both KEA and HDF5 are disabled, the configure system still looks for HDF5 libraries. I think that something like the following will fix the issue:
Steps to reproduce the issue
just run cmake with
-DGDAL_USE_HDF5=no
and-DGDAL_USE_KEA=OFF
on a system with hdf5 installedI get
in the output log.
Versions and provenance
Gentoo Linux
Additional context
No response
The text was updated successfully, but these errors were encountered: