Skip to content

Commit df54310

Browse files
authored
Update internal HDF5 dependency to 1.14.6 (#88)
* Update internal HDF5 dependency to 1.14.6 This appears to be the first version to build on MSYS2/UCRT64; recent previous versions fail due to undefined vasprintf(3). The undefined FLT16_MAX issue can be worked around by invoking cmake with -DCMAKE_C_FLAGS=-DFLT16_MAX=__FLT16_MAX__ (this may be an HDF5 issue: gcc does define __FLT16_MAX__ and the _Float16 check passes at configuration time; see comment in HDF5's config/ConfigureChecks.cmake). Also, use pkg-config to find external HDF5 package, if necessary, and be more explicit about the HDF5 version requirement (1.10 or later). * Replace byacc dependency with bison Because swig-fortran occasionally asks for it.
1 parent 6b5d0e5 commit df54310

File tree

8 files changed

+35
-51
lines changed

8 files changed

+35
-51
lines changed

.dev/docker/make_tests.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUN mkdir /app
55
COPY ./cbflib /app/cbflib
66

77
RUN apt-get update && \
8-
apt-get install -y build-essential git wget libjpeg-dev m4 automake libpcre2-dev byacc liblzma-dev rsync gfortran libz-dev
8+
apt-get install -y bison build-essential git wget libjpeg-dev m4 automake libpcre2-dev liblzma-dev rsync gfortran libz-dev
99

1010
RUN mkdir -p ~/miniconda3 && \
1111
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh && \

CMakeLists.txt

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ fetchcontent_declare(data_output
454454
-N -i "${CMAKE_CURRENT_SOURCE_DIR}/patches/cbflib-data-output-${PROJECT_VERSION}.patch" -p 1 -t --binary)
455455

456456
fetchcontent_declare(hdf5
457-
URL "http://downloads.sf.net/cbflib/hdf5-1.14.4-2.tar.gz"
458-
URL_HASH MD5=1791c5f70660bf4ec2e05fc15526c181)
457+
URL "https://github.com/HDFGroup/hdf5/releases/download/hdf5_1.14.6/hdf5-1.14.6.tar.gz"
458+
URL_HASH MD5=63426c8e24086634eaf9179a8c5fe9e5)
459459

460460
fetchcontent_declare(pcreposix
461461
URL "http://downloads.sf.net/cbflib/pcre-8.38.tar.gz"
@@ -544,16 +544,16 @@ if(CBF_WITH_HDF5)
544544
"HDF5 configured externally")
545545
set(HDF_PACKAGE_NAMESPACE "hdf5::" CACHE INTERNAL
546546
"Name for HDF package namespace (can be empty)")
547-
set(LIBAEC_TGZ_NAME "libaec-1.0.6.tar.gz" CACHE INTERNAL
547+
set(LIBAEC_TGZ_NAME "libaec-1.1.3.tar.gz" CACHE INTERNAL
548548
"Use SZIP AEC from compressed file")
549549
set(LIBAEC_TGZ_ORIGPATH
550-
"https://github.com/MathisRosenhauer/libaec/releases/download/v1.0.6"
550+
"https://github.com/MathisRosenhauer/libaec/releases/download/v1.1.3"
551551
CACHE INTERNAL
552552
"Use LIBAEC from original location")
553-
set(ZLIB_TGZ_NAME "zlib-1.3.tar.gz" CACHE INTERNAL
553+
set(ZLIB_TGZ_NAME "zlib-1.3.1.tar.gz" CACHE INTERNAL
554554
"Use HDF5_ZLib from compressed file")
555555
set(ZLIB_TGZ_ORIGPATH
556-
"https://github.com/madler/zlib/releases/download/v1.3"
556+
"https://github.com/madler/zlib/releases/download/v1.3.1"
557557
CACHE INTERNAL
558558
"Use zlib from original location")
559559
fetchcontent_makeavailable(hdf5)
@@ -566,15 +566,10 @@ if(CBF_WITH_HDF5)
566566
set(_hdf5_target hdf5-static)
567567
endif()
568568
else()
569-
if(NOT BUILD_SHARED_LIBS)
570-
# HDF5_USE_STATIC_LIBRARIES does not seem to do what it is
571-
# supposed to, see
572-
# https://gitlab.kitware.com/cmake/cmake/-/issues/24613.
573-
set(HDF5_USE_STATIC_LIBRARIES TRUE)
574-
endif()
575-
find_package(HDF5 REQUIRED)
569+
find_package(PkgConfig REQUIRED)
570+
pkg_check_modules(hdf5 REQUIRED IMPORTED_TARGET hdf5>=1.10)
576571
find_program(_h5dump_executable h5dump REQUIRED)
577-
set(_hdf5_target hdf5::hdf5)
572+
set(_hdf5_target PkgConfig::hdf5)
578573
endif()
579574

580575

@@ -589,6 +584,7 @@ endif()
589584

590585
# CBFlib must be compiled with H5_USE_110_API. With MSVC, also need
591586
# H5_BUILT_AS_DYNAMIC_LIB if HDF5 is a dynamic library.
587+
# target_compile_definitions cannot be used on an ALIAS target.
592588
add_library(hdf5 ALIAS ${_hdf5_target})
593589
target_compile_definitions(${_hdf5_target}
594590
INTERFACE H5_USE_110_API)

Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,8 @@ endif
374374

375375
ifneq ("$(CBFLIB_DONT_USE_LOCAL_HDF5)","yes")
376376
HDF5_PREFIX ?= $(PWD)
377-
HDF5 ?= hdf5-1.14.4-2
378-
ifeq ("$(HDF5)","hdf5-1.14.4-2")
379-
HDF5CFLAGS=-DH5_USE_110_API
380-
endif
377+
HDF5 ?= hdf5-1.14.6
378+
HDF5CFLAGS=-DH5_USE_110_API
381379
HDF5dep = $(HDF5)
382380
HDF5_INSTALL = $(HDF5)_INSTALL
383381
ifneq ("$(MSYS2)","yes")
@@ -787,7 +785,7 @@ PY3PLYURL = http://downloads.sf.net/cbflib/$(PY3PLY).tar.gz
787785
endif
788786
REGEX_URL ?= http://downloads.sf.net/cbflib/$(REGEX).tar.gz
789787
TIFF_URL ?= http://downloads.sf.net/cbflib/$(TIFF).tar.gz
790-
HDF5_URL ?= http://downloads.sf.net/cbflib/$(HDF5).tar.gz
788+
HDF5_URL ?= https://github.com/HDFGroup/hdf5/releases/download/hdf5_1.14.6/$(HDF5).tar.gz
791789
ifneq ($(CBFLIB_DONT_USE_LOCAL_NUWEB),yes)
792790
NUWEB_URL ?= http://downloads.sf.net/cbflib/$(NUWEB_DEP).tar.gz
793791
endif
@@ -1055,7 +1053,7 @@ default:
10551053
@echo ' NUWEB_DEP = $(NUWEB_DEP)'
10561054
@echo ' NUWEB_DEP2 = $(NUWEB_DEP2)'
10571055
@echo ' '
1058-
@echo ' You will need either a system HDF5 1.12 or it to be installed here.'
1056+
@echo ' You will need either a system HDF5 >=1.10 or it to be installed here.'
10591057
@echo ' Check that CBFLIB_DONT_USE_LOCAL_HDF5 and HDF5 are defined correctly :'
10601058
@echo ' '
10611059
@echo ' The current values are:'

Makefile_LINUX

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,8 @@ endif
374374

375375
ifneq ("$(CBFLIB_DONT_USE_LOCAL_HDF5)","yes")
376376
HDF5_PREFIX ?= $(PWD)
377-
HDF5 ?= hdf5-1.14.4-2
378-
ifeq ("$(HDF5)","hdf5-1.14.4-2")
379-
HDF5CFLAGS=-DH5_USE_110_API
380-
endif
377+
HDF5 ?= hdf5-1.14.6
378+
HDF5CFLAGS=-DH5_USE_110_API
381379
HDF5dep = $(HDF5)
382380
HDF5_INSTALL = $(HDF5)_INSTALL
383381
ifneq ("$(MSYS2)","yes")
@@ -783,7 +781,7 @@ PY3PLYURL = http://downloads.sf.net/cbflib/$(PY3PLY).tar.gz
783781
endif
784782
REGEX_URL ?= http://downloads.sf.net/cbflib/$(REGEX).tar.gz
785783
TIFF_URL ?= http://downloads.sf.net/cbflib/$(TIFF).tar.gz
786-
HDF5_URL ?= http://downloads.sf.net/cbflib/$(HDF5).tar.gz
784+
HDF5_URL ?= https://github.com/HDFGroup/hdf5/releases/download/hdf5_1.14.6/$(HDF5).tar.gz
787785
ifneq ($(CBFLIB_DONT_USE_LOCAL_NUWEB),yes)
788786
NUWEB_URL ?= http://downloads.sf.net/cbflib/$(NUWEB_DEP).tar.gz
789787
endif
@@ -1051,7 +1049,7 @@ default:
10511049
@echo ' NUWEB_DEP = $(NUWEB_DEP)'
10521050
@echo ' NUWEB_DEP2 = $(NUWEB_DEP2)'
10531051
@echo ' '
1054-
@echo ' You will need either a system HDF5 1.12 or it to be installed here.'
1052+
@echo ' You will need either a system HDF5 >=1.10 or it to be installed here.'
10551053
@echo ' Check that CBFLIB_DONT_USE_LOCAL_HDF5 and HDF5 are defined correctly :'
10561054
@echo ' '
10571055
@echo ' The current values are:'

Makefile_MINGW

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,8 @@ endif
374374

375375
ifneq ("$(CBFLIB_DONT_USE_LOCAL_HDF5)","yes")
376376
HDF5_PREFIX ?= $(PWD)
377-
HDF5 ?= hdf5-1.14.4-2
378-
ifeq ("$(HDF5)","hdf5-1.14.4-2")
379-
HDF5CFLAGS=-DH5_USE_110_API
380-
endif
377+
HDF5 ?= hdf5-1.14.6
378+
HDF5CFLAGS=-DH5_USE_110_API
381379
HDF5dep = $(HDF5)
382380
HDF5_INSTALL = $(HDF5)_INSTALL
383381
ifneq ("$(MSYS2)","yes")
@@ -797,7 +795,7 @@ PY3PLYURL = http://downloads.sf.net/cbflib/$(PY3PLY).tar.gz
797795
endif
798796
REGEX_URL ?= http://downloads.sf.net/cbflib/$(REGEX).tar.gz
799797
TIFF_URL ?= http://downloads.sf.net/cbflib/$(TIFF).tar.gz
800-
HDF5_URL ?= http://downloads.sf.net/cbflib/$(HDF5).tar.gz
798+
HDF5_URL ?= https://github.com/HDFGroup/hdf5/releases/download/hdf5_1.14.6/$(HDF5).tar.gz
801799
ifneq ($(CBFLIB_DONT_USE_LOCAL_NUWEB),yes)
802800
NUWEB_URL ?= http://downloads.sf.net/cbflib/$(NUWEB_DEP).tar.gz
803801
endif
@@ -1065,7 +1063,7 @@ default:
10651063
@echo ' NUWEB_DEP = $(NUWEB_DEP)'
10661064
@echo ' NUWEB_DEP2 = $(NUWEB_DEP2)'
10671065
@echo ' '
1068-
@echo ' You will need either a system HDF5 1.12 or it to be installed here.'
1066+
@echo ' You will need either a system HDF5 >=1.10 or it to be installed here.'
10691067
@echo ' Check that CBFLIB_DONT_USE_LOCAL_HDF5 and HDF5 are defined correctly :'
10701068
@echo ' '
10711069
@echo ' The current values are:'

Makefile_MSYS2

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,8 @@ endif
373373

374374
ifneq ("$(CBFLIB_DONT_USE_LOCAL_HDF5)","yes")
375375
HDF5_PREFIX ?= $(PWD)
376-
HDF5 ?= hdf5-1.14.4-2
377-
ifeq ("$(HDF5)","hdf5-1.14.4-2")
378-
HDF5CFLAGS=-DH5_USE_110_API
379-
endif
376+
HDF5 ?= hdf5-1.14.6
377+
HDF5CFLAGS=-DH5_USE_110_API
380378
HDF5dep = $(HDF5)
381379
HDF5_INSTALL = $(HDF5)_INSTALL
382380
ifneq ("$(MSYS2)","yes")
@@ -782,7 +780,7 @@ PY3PLYURL = http://downloads.sf.net/cbflib/$(PY3PLY).tar.gz
782780
endif
783781
REGEX_URL ?= http://downloads.sf.net/cbflib/$(REGEX).tar.gz
784782
TIFF_URL ?= http://downloads.sf.net/cbflib/$(TIFF).tar.gz
785-
HDF5_URL ?= http://downloads.sf.net/cbflib/$(HDF5).tar.gz
783+
HDF5_URL ?= https://github.com/HDFGroup/hdf5/releases/download/hdf5_1.14.6/$(HDF5).tar.gz
786784
ifneq ($(CBFLIB_DONT_USE_LOCAL_NUWEB),yes)
787785
NUWEB_URL ?= http://downloads.sf.net/cbflib/$(NUWEB_DEP).tar.gz
788786
endif
@@ -1050,7 +1048,7 @@ default:
10501048
@echo ' NUWEB_DEP = $(NUWEB_DEP)'
10511049
@echo ' NUWEB_DEP2 = $(NUWEB_DEP2)'
10521050
@echo ' '
1053-
@echo ' You will need either a system HDF5 1.12 or it to be installed here.'
1051+
@echo ' You will need either a system HDF5 >=1.10 or it to be installed here.'
10541052
@echo ' Check that CBFLIB_DONT_USE_LOCAL_HDF5 and HDF5 are defined correctly :'
10551053
@echo ' '
10561054
@echo ' The current values are:'

Makefile_OSX

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,8 @@ endif
374374

375375
ifneq ("$(CBFLIB_DONT_USE_LOCAL_HDF5)","yes")
376376
HDF5_PREFIX ?= $(PWD)
377-
HDF5 ?= hdf5-1.14.4-2
378-
ifeq ("$(HDF5)","hdf5-1.14.4-2")
379-
HDF5CFLAGS=-DH5_USE_110_API
380-
endif
377+
HDF5 ?= hdf5-1.14.6
378+
HDF5CFLAGS=-DH5_USE_110_API
381379
HDF5dep = $(HDF5)
382380
HDF5_INSTALL = $(HDF5)_INSTALL
383381
ifneq ("$(MSYS2)","yes")
@@ -781,7 +779,7 @@ PY3PLYURL = http://downloads.sf.net/cbflib/$(PY3PLY).tar.gz
781779
endif
782780
REGEX_URL ?= http://downloads.sf.net/cbflib/$(REGEX).tar.gz
783781
TIFF_URL ?= http://downloads.sf.net/cbflib/$(TIFF).tar.gz
784-
HDF5_URL ?= http://downloads.sf.net/cbflib/$(HDF5).tar.gz
782+
HDF5_URL ?= https://github.com/HDFGroup/hdf5/releases/download/hdf5_1.14.6/$(HDF5).tar.gz
785783
ifneq ($(CBFLIB_DONT_USE_LOCAL_NUWEB),yes)
786784
NUWEB_URL ?= http://downloads.sf.net/cbflib/$(NUWEB_DEP).tar.gz
787785
endif
@@ -1049,7 +1047,7 @@ default:
10491047
@echo ' NUWEB_DEP = $(NUWEB_DEP)'
10501048
@echo ' NUWEB_DEP2 = $(NUWEB_DEP2)'
10511049
@echo ' '
1052-
@echo ' You will need either a system HDF5 1.12 or it to be installed here.'
1050+
@echo ' You will need either a system HDF5 >=1.10 or it to be installed here.'
10531051
@echo ' Check that CBFLIB_DONT_USE_LOCAL_HDF5 and HDF5 are defined correctly :'
10541052
@echo ' '
10551053
@echo ' The current values are:'

m4/Makefile.m4

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,8 @@ endif
381381

382382
ifneq ("$(CBFLIB_DONT_USE_LOCAL_HDF5)","yes")
383383
HDF5_PREFIX ?= $(PWD)
384-
HDF5 ?= hdf5-1.14.4-2
385-
ifeq ("$(HDF5)","hdf5-1.14.4-2")
386-
HDF5CFLAGS=-DH5_USE_110_API
387-
endif
384+
HDF5 ?= hdf5-1.14.6
385+
HDF5CFLAGS=-DH5_USE_110_API
388386
HDF5dep = $(HDF5)
389387
HDF5_INSTALL = $(HDF5)_INSTALL
390388
ifneq ("$(MSYS2)","yes")
@@ -1156,7 +1154,7 @@ PY3PLYURL = http://downloads.sf.net/cbflib/$(PY3PLY).tar.gz
11561154
endif
11571155
REGEX_URL ?= http://downloads.sf.net/cbflib/$(REGEX).tar.gz
11581156
TIFF_URL ?= http://downloads.sf.net/cbflib/$(TIFF).tar.gz
1159-
HDF5_URL ?= http://downloads.sf.net/cbflib/$(HDF5).tar.gz
1157+
HDF5_URL ?= https://github.com/HDFGroup/hdf5/releases/download/hdf5_1.14.6/$(HDF5).tar.gz
11601158
ifneq ($(CBFLIB_DONT_USE_LOCAL_NUWEB),yes)
11611159
NUWEB_URL ?= http://downloads.sf.net/cbflib/$(NUWEB_DEP).tar.gz
11621160
endif
@@ -1424,7 +1422,7 @@ default:
14241422
@echo ''` NUWEB_DEP = $(NUWEB_DEP)''`
14251423
@echo ''` NUWEB_DEP2 = $(NUWEB_DEP2)''`
14261424
@echo ''` ''`
1427-
@echo ''` You will need either a system HDF5 1.12 or it to be installed here.''`
1425+
@echo ''` You will need either a system HDF5 >=1.10 or it to be installed here.''`
14281426
@echo ''` Check that CBFLIB_DONT_USE_LOCAL_HDF5 and HDF5 are defined correctly :''`
14291427
@echo ''` ''`
14301428
@echo ''` The current values are:''`

0 commit comments

Comments
 (0)