Skip to content

Commit edf3857

Browse files
Add workflows to test filter libraries installed in various ways (#238)
Add GitHub workflows to test building inline with HDF5 and with an already-installed HDF5 using filter libraries installed from both package managers and from CMake's FetchContent Updated the ZSTD build process with newer files to fix a build issue due to an old CMake macro definition Fixed the Blosc, Blosc2, LZ4 and ZSTD CMake logic so system-installed libraries can be found with find_package() Updated h5repack testing to make added filters required instead of optional so that testing issues aren't masked over Fixed the Bitgroom and Bitround testing after making those filters required in h5repack testing Synced CMake files with HDF5 develop to fix various issues
1 parent 7614cad commit edf3857

142 files changed

Lines changed: 2613 additions & 912 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
name: HDF5 plugins testing with CMake FetchContent on MacOS
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
build_mode:
7+
description: "Build type (CMAKE_BUILD_TYPE)"
8+
required: true
9+
type: string
10+
hdf5_tag:
11+
description: "HDF5 git tag to use"
12+
required: false
13+
default: "develop"
14+
type: string
15+
zlib_type:
16+
description: "Type of zlib to use ('zlib' (default) or 'zlib-ng')"
17+
required: false
18+
default: "zlib"
19+
type: string
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
# Test building filter libraries and hdf5_plugins project inline with CMake's
26+
# FetchContent (git) functionality while building HDF5.
27+
build_and_test_inline:
28+
name: "MacOS Clang (hdf5_plugins built inline with HDF5)"
29+
runs-on: macos-latest
30+
steps:
31+
- name: Get sources for HDF5
32+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
33+
with:
34+
repository: HDFGroup/hdf5
35+
ref: "${{ inputs.hdf5_tag }}"
36+
path: ${{ github.workspace }}/hdf5
37+
38+
- name: Set zlib-ng option
39+
id: set_zlibng_option
40+
run: |
41+
if test "${{ inputs.zlib_type }}" = "zlib-ng"; then
42+
echo "zlibng_option=ON" >> "$GITHUB_OUTPUT"
43+
echo "zlib_external=ON" >> "$GITHUB_OUTPUT"
44+
else
45+
echo "zlibng_option=OFF" >> "$GITHUB_OUTPUT"
46+
echo "zlib_external=OFF" >> "$GITHUB_OUTPUT"
47+
fi
48+
49+
# TODO: Re-enable ZSTD testing after CMake logic issue is fixed
50+
# NOTE: HDF_ENABLE_BLOSC_ZLIB_SUPPORT is set to OFF because otherwise
51+
# the hdf5_plugins Blosc build process will try to build its own zlib
52+
# instead of allowing blosc to use its internal sources that are patched
53+
# for MacOS.
54+
- name: Build HDF5 and HDF5 plugins
55+
run: |
56+
cd ${{ github.workspace }}/hdf5
57+
mkdir build
58+
cd build
59+
cmake \
60+
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
61+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/hdf5_build \
62+
-DBUILD_STATIC_LIBS=OFF \
63+
-DHDF5_ALLOW_EXTERNAL_SUPPORT=GIT \
64+
-DHDF5_ENABLE_ZLIB_SUPPORT=OFF \
65+
-DZLIB_USE_EXTERNAL=${{ steps.set_zlibng_option.outputs.zlib_external }} \
66+
-DHDF5_USE_ZLIB_NG=${{ steps.set_zlibng_option.outputs.zlibng_option }} \
67+
-DHDF5_ENABLE_SZIP_SUPPORT=ON \
68+
-DSZIP_USE_EXTERNAL=ON \
69+
-DHDF5_ENABLE_PLUGIN_SUPPORT=ON \
70+
-DPLUGIN_USE_EXTERNAL=ON \
71+
-DPLUGIN_USE_LOCALCONTENT=OFF \
72+
-DH5PL_ALLOW_EXTERNAL_SUPPORT=GIT \
73+
-DH5PL_BUILD_TESTING=ON \
74+
-DH5PL_BUILD_EXAMPLES=ON \
75+
-DENABLE_BLOSC=ON \
76+
-DHDF_ENABLE_BLOSC_ZLIB_SUPPORT=OFF \
77+
-DENABLE_BLOSC2=ON \
78+
-DENABLE_BZIP2=ON \
79+
-DENABLE_JPEG=ON \
80+
-DENABLE_LZ4=ON \
81+
-DENABLE_LZF=ON \
82+
-DENABLE_ZFP=ON \
83+
-DENABLE_ZSTD=OFF \
84+
-DENABLE_BITGROOM=ON \
85+
-DENABLE_BITROUND=ON \
86+
-DENABLE_BSHUF=ON \
87+
..
88+
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
89+
cmake --install . --config ${{ inputs.build_mode }}
90+
91+
- name: Test HDF5 and HDF5 plugins
92+
shell: bash
93+
run: |
94+
cd "${{ github.workspace }}/hdf5/build"
95+
ctest . --output-on-failure --parallel 3 -C ${{ inputs.build_mode }}
96+
97+
# Test building hdf5_plugins project against an already-installed HDF5. Filter
98+
# libraries are built with FetchContent (git) while building hdf5_plugins.
99+
build_and_test_git:
100+
name: "MacOS Clang (hdf5_plugins built standalone; plugins built via git)"
101+
runs-on: macos-latest
102+
steps:
103+
- name: Get sources for HDF5 plugins project
104+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
105+
106+
- name: Get sources for HDF5
107+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
108+
with:
109+
repository: HDFGroup/hdf5
110+
ref: "${{ inputs.hdf5_tag }}"
111+
path: ${{ github.workspace }}/hdf5
112+
113+
- name: Set zlib-ng option
114+
id: set_zlibng_option
115+
run: |
116+
if test "${{ inputs.zlib_type }}" = "zlib-ng"; then
117+
echo "zlibng_option=ON" >> "$GITHUB_OUTPUT"
118+
else
119+
echo "zlibng_option=OFF" >> "$GITHUB_OUTPUT"
120+
fi
121+
122+
- name: Build HDF5
123+
run: |
124+
cd ${{ github.workspace }}/hdf5
125+
mkdir build
126+
cd build
127+
cmake \
128+
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
129+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/hdf5_build \
130+
-DBUILD_STATIC_LIBS=OFF \
131+
-DHDF5_ALLOW_EXTERNAL_SUPPORT=GIT \
132+
-DHDF5_ENABLE_ZLIB_SUPPORT=ON \
133+
-DZLIB_USE_EXTERNAL=ON \
134+
-DHDF5_USE_ZLIB_NG=${{ steps.set_zlibng_option.outputs.zlibng_option }} \
135+
-DHDF5_ENABLE_SZIP_SUPPORT=ON \
136+
-DSZIP_USE_EXTERNAL=ON \
137+
..
138+
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
139+
cmake --install . --config ${{ inputs.build_mode }}
140+
141+
# NOTE: HDF_ENABLE_BLOSC_ZLIB_SUPPORT is set to OFF because otherwise
142+
# the hdf5_plugins Blosc build process will try to build its own zlib
143+
# instead of allowing blosc to use its internal sources that are patched
144+
# for MacOS.
145+
- name: Build HDF5 plugins project
146+
run: |
147+
mkdir "${{ runner.workspace }}/build"
148+
cd "${{ runner.workspace }}/build"
149+
cmake \
150+
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
151+
-DHDF5_DIR=${{ github.workspace }}/hdf5_build/cmake \
152+
-DH5PL_ALLOW_EXTERNAL_SUPPORT=GIT \
153+
-DH5PL_BUILD_TESTING=ON \
154+
-DH5PL_BUILD_EXAMPLES=ON \
155+
-DENABLE_BLOSC=ON \
156+
-DHDF_ENABLE_BLOSC_ZLIB_SUPPORT=OFF \
157+
-DENABLE_BLOSC2=ON \
158+
-DENABLE_BZIP2=ON \
159+
-DENABLE_JPEG=ON \
160+
-DENABLE_LZ4=ON \
161+
-DENABLE_LZF=ON \
162+
-DENABLE_ZFP=ON \
163+
-DENABLE_ZSTD=ON \
164+
-DENABLE_BITGROOM=ON \
165+
-DENABLE_BITROUND=ON \
166+
-DENABLE_BSHUF=ON \
167+
$GITHUB_WORKSPACE
168+
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
169+
170+
- name: Test HDF5 plugins project
171+
run: |
172+
cd "${{ runner.workspace }}/build"
173+
ctest . --output-on-failure --parallel 4 -C ${{ inputs.build_mode }}
174+
175+
# Test building hdf5_plugins project against an already-installed HDF5. Filter
176+
# libraries are built with FetchContent (tgz) while building hdf5_plugins.
177+
build_and_test_tgz:
178+
name: "MacOS Clang (hdf5_plugins built standalone; plugins built via tgz)"
179+
runs-on: macos-latest
180+
steps:
181+
- name: Get sources for HDF5 plugins project
182+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
183+
184+
- name: Get sources for HDF5
185+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
186+
with:
187+
repository: HDFGroup/hdf5
188+
ref: "${{ inputs.hdf5_tag }}"
189+
path: ${{ github.workspace }}/hdf5
190+
191+
- name: Set zlib-ng option
192+
id: set_zlibng_option
193+
run: |
194+
if test "${{ inputs.zlib_type }}" = "zlib-ng"; then
195+
echo "zlibng_option=ON" >> "$GITHUB_OUTPUT"
196+
else
197+
echo "zlibng_option=OFF" >> "$GITHUB_OUTPUT"
198+
fi
199+
200+
- name: Build HDF5
201+
run: |
202+
cd ${{ github.workspace }}/hdf5
203+
mkdir build
204+
cd build
205+
cmake \
206+
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
207+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/hdf5_build \
208+
-DBUILD_STATIC_LIBS=OFF \
209+
-DHDF5_ALLOW_EXTERNAL_SUPPORT=TGZ \
210+
-DHDF5_ENABLE_ZLIB_SUPPORT=ON \
211+
-DZLIB_USE_EXTERNAL=ON \
212+
-DZLIB_USE_LOCALCONTENT=OFF \
213+
-DHDF5_USE_ZLIB_NG=${{ steps.set_zlibng_option.outputs.zlibng_option }} \
214+
-DHDF5_ENABLE_SZIP_SUPPORT=ON \
215+
-DSZIP_USE_EXTERNAL=ON \
216+
-DLIBAEC_USE_LOCALCONTENT=OFF \
217+
..
218+
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
219+
cmake --install . --config ${{ inputs.build_mode }}
220+
221+
- name: Build HDF5 plugins project
222+
run: |
223+
mkdir "${{ runner.workspace }}/build"
224+
cd "${{ runner.workspace }}/build"
225+
cmake \
226+
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
227+
-DHDF5_DIR=${{ github.workspace }}/hdf5_build/cmake \
228+
-DH5PL_ALLOW_EXTERNAL_SUPPORT=TGZ \
229+
-DH5PL_BUILD_TESTING=ON \
230+
-DH5PL_BUILD_EXAMPLES=ON \
231+
-DENABLE_BLOSC=ON \
232+
-DENABLE_BLOSC2=ON \
233+
-DENABLE_BZIP2=ON \
234+
-DENABLE_JPEG=ON \
235+
-DENABLE_LZ4=ON \
236+
-DENABLE_LZF=ON \
237+
-DENABLE_ZFP=ON \
238+
-DENABLE_ZSTD=ON \
239+
-DENABLE_BITGROOM=ON \
240+
-DENABLE_BITROUND=ON \
241+
-DENABLE_BSHUF=ON \
242+
$GITHUB_WORKSPACE
243+
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
244+
245+
- name: Test HDF5 plugins project
246+
run: |
247+
cd "${{ runner.workspace }}/build"
248+
ctest . --output-on-failure --parallel 3 -C ${{ inputs.build_mode }}

0 commit comments

Comments
 (0)