Skip to content
Draft

Dev #35

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
269 commits
Select commit Hold shift + click to select a range
aa0d9bd
Added allocate_frame_header, allocate_frame_data. Changed free_frame …
Apr 11, 2025
ac32e27
Remove bin, modified config.mk
Apr 11, 2025
6ae5a46
Fix typo in allocate_frame_data
Apr 17, 2025
aa303ef
Add compress_frame
Apr 17, 2025
58d346c
Fix typo in allocate_frame_header
Apr 17, 2025
1952a7e
Change MQ1_NUM_FIELDS to MQ1_FIELDS_NUM_FIELDS
Apr 17, 2025
ff2783e
Change mq1_fields_info to use macros
Apr 17, 2025
d22c3db
Change dac_info to use macros
Apr 17, 2025
76ecde8
Add compress_frame in framebuffer.h
Apr 17, 2025
c2b0e79
Move header files to src
Apr 22, 2025
7e4744d
Add header files into src
Apr 22, 2025
ee13830
Change header guard for macros.h
Apr 22, 2025
fe162a6
resolve conflict in clang-format-check.yml with dev branch
Apr 22, 2025
dad382b
Merge branch 'dev' into features/files_framebuffer_mib_props_supp
Apr 22, 2025
d2eafde
Change formatting using clang-format
Apr 22, 2025
f40e432
Add files for initializing hdf5
Apr 22, 2025
e4d9240
Comment out debug functions in hdf5_init.h
Apr 22, 2025
8e41d21
Add files for reading .mib files into framebuffer
Apr 22, 2025
bc67db7
Remove duplicate malloc for framebuffer
Apr 22, 2025
97465e8
Change Format according to clang-format
Apr 22, 2025
599102c
Remove extra mq1_header allocation in framebuffer.c
Apr 23, 2025
8eef264
Fix typo in framebuffer.c
Apr 23, 2025
5361a2e
Fix bugs due to messing up clang-format, pre-commit and git
Apr 23, 2025
d59d378
Fix typo in frambuffer
Apr 23, 2025
7159c76
fix typo
Apr 23, 2025
22c74c5
Revert "Add compress_frame"
Apr 24, 2025
d558ce0
Revert "Add compress_frame in framebuffer.h"
Apr 24, 2025
28b99e7
Remove bin
Apr 24, 2025
2fa140f
Remove blosc.h
Apr 24, 2025
688c076
Remove include drectory in config.mk
Apr 24, 2025
b3a2116
Merge pull request #7 from ePSIC-DLS/features/files_framebuffer_mib_p…
ptim0626 Apr 24, 2025
e4902b6
Add files for initializing hdf5
Apr 22, 2025
e0c6c23
Comment out debug functions in hdf5_init.h
Apr 22, 2025
94a37c0
Change checking in close_handle
Apr 23, 2025
cfef2ac
Remove extra comment in hdf5_init
Apr 25, 2025
8cee881
Refactored initialize plist and file
Apr 25, 2025
e83f12d
Remove commented out code
Apr 25, 2025
faeef66
Fix clang-format
Apr 25, 2025
e7f30e4
Remove blosc related code
Apr 25, 2025
674cd11
Remove more blosc code
Apr 25, 2025
8735420
Changes to references in initialize_plist and initialize_file
Apr 28, 2025
969335a
Modifying references in create_merlin_dataset
Apr 28, 2025
7cc698d
Modifying references in header file for create_merlin_dataset
Apr 28, 2025
69294f0
Create function bufsize_to_datatype to handle logic related to differ…
Apr 28, 2025
1c0c4bc
Change rdcc_nbytes in H5Pset_chunk_cache to use macros
Apr 28, 2025
e4be56f
Move bufsize_to_datatype to utils
Apr 28, 2025
8024603
Use macros for rdcc_nslot in H5Pset_chunk_cache
Apr 28, 2025
b5d89b0
Add null check to filename
Apr 28, 2025
71e3633
Modify references in create_meta_dataset and create_dac_dataset
Apr 28, 2025
9b38dfa
Fix reference in initialize_plist
teoching0705 Apr 28, 2025
be1740f
Add logics and macros to determine alignment block size
teoching0705 Apr 28, 2025
a135c29
Fix typo in initialize_file
teoching0705 Apr 28, 2025
8c7fbe5
Add closing types in create_meta_dataset
teoching0705 Apr 28, 2025
94cdec0
Add logics to check meta_handle in create_meta_dataset
teoching0705 Apr 28, 2025
60bd787
Fix typo
teoching0705 Apr 28, 2025
3c97105
Fix missing return statement
teoching0705 Apr 29, 2025
3fd859a
Remove moved functions declarations in hdf5_init.h
teoching0705 Apr 29, 2025
fdf0c48
Fix typo
teoching0705 Apr 29, 2025
1df709c
update logi in checking meta_handle and num_dataset
teoching0705 Apr 29, 2025
2f2784e
modify logic to check if dataset is valid
teoching0705 Apr 29, 2025
1d85097
Change logics in cleaning up hdf5 in create_dac_dataset
teoching0705 Apr 29, 2025
daa444c
Fix return no value in utils.c
teoching0705 Apr 30, 2025
0fd324f
Move include header outside the header guard
teoching0705 Apr 30, 2025
4755992
Add logics to clean up property lists in create_merlin_dataset
teoching0705 Apr 30, 2025
617af1b
Fix typo on line 88 in hdf5_init.c
teoching0705 May 1, 2025
78c9f81
Fix typo on line 186 in hdf5_init_meta.c
teoching0705 May 1, 2025
f55c966
Add header <sys/statvfs> to utils.c
teoching0705 May 1, 2025
00e5866
Add null pointer check for path in get_filesystem_block_size
teoching0705 May 1, 2025
31d7046
Move the declaration to the top of function in create_meta)mq1_fields…
teoching0705 May 1, 2025
dd63a7a
Modify declaration in create_merlin_dataset to make it clearer
teoching0705 May 1, 2025
f453bf3
Fix header typo
teoching0705 May 1, 2025
7c276c6
Fix typo
teoching0705 May 1, 2025
ff8d5f9
Fix cleanup in create_dac_dataset
teoching0705 May 1, 2025
8d7768f
Remove not needed header in hdf5_init and hdf5_init_meta
May 2, 2025
2c02036
Fix typo
May 2, 2025
7e7214e
Merge pull request #16 from ePSIC-DLS/features/init_hdf5
ptim0626 May 2, 2025
b42a561
Remove extra mq1_header allocation in framebuffer.c
Apr 23, 2025
b151ead
Fix typo in framebuffer.c
Apr 23, 2025
f63bc22
Fix bugs due to messing up clang-format, pre-commit and git
Apr 23, 2025
aef49ce
Fix typo in frambuffer
Apr 23, 2025
5d97a4e
Revert "Add compress_frame"
Apr 24, 2025
6061f70
Revert "Add compress_frame in framebuffer.h"
Apr 24, 2025
2252de9
Remove bin
Apr 24, 2025
e4fe572
Remove blosc.h
Apr 24, 2025
5247462
Remove include drectory in config.mk
Apr 24, 2025
5ab6269
Change checking in close_handle
Apr 23, 2025
9b19711
Remove extra comment in hdf5_init
Apr 25, 2025
421fd48
Refactored initialize plist and file
Apr 25, 2025
96c9ed4
Remove commented out code
Apr 25, 2025
8b1f61e
Fix clang-format
Apr 25, 2025
73e221b
Remove blosc related code
Apr 25, 2025
fa6219a
Remove more blosc code
Apr 25, 2025
dd3b7fa
Changes to references in initialize_plist and initialize_file
Apr 28, 2025
7aa5528
Modifying references in create_merlin_dataset
Apr 28, 2025
940face
Modifying references in header file for create_merlin_dataset
Apr 28, 2025
0276243
Create function bufsize_to_datatype to handle logic related to differ…
Apr 28, 2025
57fffd5
Change rdcc_nbytes in H5Pset_chunk_cache to use macros
Apr 28, 2025
c4b4236
Move bufsize_to_datatype to utils
Apr 28, 2025
1548b46
Use macros for rdcc_nslot in H5Pset_chunk_cache
Apr 28, 2025
0cf9a82
Add null check to filename
Apr 28, 2025
6c9eae9
Modify references in create_meta_dataset and create_dac_dataset
Apr 28, 2025
893a584
resolve conflicts
teoching0705 May 6, 2025
ab9527d
Merge branch 'dev' into features/read
teoching0705 May 6, 2025
00aae9a
Update path in clang-format-check.yml
teoching0705 May 6, 2025
2f063ff
resolve conflicts
teoching0705 May 6, 2025
e95577e
add codes for header_id in metadata
teoching0705 May 6, 2025
86adb76
Remove <blosc.h>
teoching0705 May 7, 2025
4035eec
Change to use local macros for header size
teoching0705 May 7, 2025
1189faa
Add checks for fseek and fread
teoching0705 May 7, 2025
5ad7a63
Add checks for dac pointer
teoching0705 May 7, 2025
e0b74a1
add checks for mq1_header pointers
teoching0705 May 7, 2025
ec43f5f
Add checks for bufsize size range
teoching0705 May 7, 2025
d4c43d0
Use macros for header bytes size
teoching0705 May 7, 2025
73c1016
Fix logic error
teoching0705 May 7, 2025
31f7cb2
Fix memory leak in read.c
teoching0705 May 7, 2025
220cfcf
move convrt endian logics to utils
teoching0705 May 7, 2025
0080be6
Fix deallocating null pointers
teoching0705 May 7, 2025
0110079
fix potential uninit values
teoching0705 May 7, 2025
62a3d2c
Fix bugs
teoching0705 May 7, 2025
dc38432
Fix typo
teoching0705 May 7, 2025
4c26e6e
Fix uninit variables
teoching0705 May 7, 2025
c1b2f74
Fix detangling pointers
teoching0705 May 7, 2025
aa09329
Fix typo in fprintf
teoching0705 May 8, 2025
2e26014
Modify order for deallocation
teoching0705 May 8, 2025
459e7c8
Merge pull request #21 from ePSIC-DLS/features/header_id
ptim0626 May 9, 2025
78c041c
change strtol to strtoul
teoching0705 May 12, 2025
ab05e68
Change to use macros.h for headersize
teoching0705 May 12, 2025
e0ac6b7
freeing raw_data in read_frame
teoching0705 May 12, 2025
b9afde2
Change variables input to unsigned
teoching0705 May 12, 2025
e4119b7
Add null check to fb->rows in read_frame
teoching0705 May 12, 2025
64938c8
Remove offset checking on negativity
teoching0705 May 13, 2025
f373fc5
Add checks on headersize
teoching0705 May 13, 2025
0915444
Remove unnecessary mq1_header
teoching0705 May 13, 2025
8b0d598
Fix fb->mq1_header Null check and typing
teoching0705 May 13, 2025
82e97ff
modify for clarity
teoching0705 May 15, 2025
f1d7033
Fix logics error
teoching0705 May 15, 2025
dab9d16
Freeing unused dac1, dac2, dac3 in single chip data
teoching0705 May 15, 2025
1974410
Remove freeing unused dac
teoching0705 May 15, 2025
b2a3332
Merge pull request #17 from ePSIC-DLS/features/read
ptim0626 May 15, 2025
47efd76
Add logics to separate threshold into different fields
teoching0705 May 20, 2025
5b3d69b
Add logics to compress with blosc and hdf5-blosc
teoching0705 May 20, 2025
5713ea7
Add in autotools file
teoching0705 May 1, 2025
c3e4b30
Add logics to let user provide path for hdf5, blosc, and hdf5-blosc
teoching0705 May 8, 2025
26b4865
Change the third argument to be issue page
teoching0705 May 12, 2025
f5e51bb
change default debug to no
teoching0705 May 12, 2025
66e4378
Modify configure.ac
teoching0705 May 12, 2025
2c979c0
change silent rules to use m4_ifdef
teoching0705 May 12, 2025
9b553b6
Modify logic to remove redundant code
teoching0705 May 13, 2025
430a86e
Change with-compression to enable-compression
teoching0705 May 15, 2025
9dce5df
Fix hdf5 not correctly detected when HDFDIR alredy set before the con…
teoching0705 May 15, 2025
8c30a1c
Separate blosc and hdf5-blosc detection
teoching0705 May 15, 2025
df1988b
Modify checking logics of HDF5 to make it more robust
teoching0705 May 19, 2025
517bfa3
modify logics to check compression dependencies
teoching0705 May 19, 2025
f815b93
Remove GNU files
teoching0705 May 19, 2025
e8535dd
Remove jython files
teoching0705 May 20, 2025
49cf129
static inline function for malloc in utils
teoching0705 May 21, 2025
0430f89
change directory for checking hdf5-blosc
May 21, 2025
ce6a74c
Merge pull request #19 from ePSIC-DLS/features/autotools
ptim0626 May 21, 2025
7553340
Modify configure.ac to let it cross platform
teoching0705 May 21, 2025
ba3184e
Use static inline function for malloc error declaration
teoching0705 May 21, 2025
a58bc70
Hard-code threshold index in io_header.c
teoching0705 May 28, 2025
20481a0
remove wrong comments
teoching0705 May 28, 2025
98a63fd
Fix freeing and closing property lists and variables
teoching0705 May 28, 2025
65fc237
Modify logics to prevent freeing fb->data first
teoching0705 May 28, 2025
a02319f
Change compatiable version check to 2.64 as AS_VAR_SET requires 2.64
teoching0705 May 28, 2025
7f3ecd0
Remove AC_CANONICAL_HOST
teoching0705 May 28, 2025
2734b01
Fix rpath=
teoching0705 May 28, 2025
7863be7
Fix checking cache
teoching0705 May 28, 2025
34c82de
Merge pull request #23 from ePSIC-DLS/features/thresholds
ptim0626 May 29, 2025
61f8249
Use m4macro to unset cache
teoching0705 May 29, 2025
34fbe45
Add comments for version
teoching0705 May 29, 2025
152f562
Add in basic main.c for build purposes
teoching0705 May 29, 2025
6ccbf74
Fix dangling dcpl in dcpl_compress
teoching0705 May 29, 2025
c37d117
Merge pull request #24 from ePSIC-DLS/features/compress
ptim0626 May 29, 2025
6397265
Comment out mib_to_h5
teoching0705 May 29, 2025
6655dbc
Merge pull request #25 from ePSIC-DLS/features/autotools
ptim0626 May 29, 2025
c3eca7e
Add code for appending frames
teoching0705 May 28, 2025
e1d1ed9
Add logics to handle error for get_space and get_simple_extent_dims
teoching0705 May 29, 2025
9206004
Add comments for clarifing the need to reopen filespace
teoching0705 May 29, 2025
1f08a9c
Add comments for reopening filespace in appending dac
teoching0705 May 29, 2025
be0f74e
Add a section in README about how to contribute and bug report
ptim0626 May 29, 2025
36b128c
Add a list of maintainers and contributors
ptim0626 May 29, 2025
1375e9e
Add in error handling logics
teoching0705 May 29, 2025
849795a
add comments for clarifying the freeing of array used
teoching0705 May 29, 2025
cf931be
Merge pull request #27 from ePSIC-DLS/features/append
ptim0626 Jul 5, 2025
d471826
Merge pull request #31 from ePSIC-DLS/add-contributors
ptim0626 Jul 5, 2025
193a816
Add files for cython wrapper
teoching0705 May 28, 2025
7a78ea4
Add checks for header file
teoching0705 May 28, 2025
f8f929d
Relocate Python wrapper files
ptim0626 Jul 5, 2025
0473f72
Uncomment placeholder mib_to_h5 function
ptim0626 Jul 6, 2025
eff4f68
Add mib_to_h5 to make target
ptim0626 Jul 6, 2025
aff684c
Add header file for the main conversion function
ptim0626 Jul 6, 2025
2f22950
Fix typos in error message in allocate_frame_data
ptim0626 Jul 7, 2025
cdac546
Fix memory free-up in error path
ptim0626 Jul 7, 2025
f790d2a
Create expandable initial dataset for Merlin frames
ptim0626 Jul 7, 2025
ccc55af
Fix memory leak (won't be freed outside)
ptim0626 Jul 9, 2025
592070b
Add an utility function to determine the output filename
ptim0626 Jul 9, 2025
b2c9500
Add initial implementation of main conversion function mib_to_h5
ptim0626 Jul 12, 2025
412df2a
Avoid double headersize offset when called from mib_to_h5
ptim0626 Jul 14, 2025
3892b61
Use snprintf for safety
ptim0626 Aug 27, 2025
ecd3c75
Enhance error message in getting file system block size
ptim0626 Aug 27, 2025
7d7dcef
Add a function to check if a directory exists
ptim0626 Aug 27, 2025
80d5788
Avoid passing output file name to statvfs as it hasn't been created yet
ptim0626 Aug 27, 2025
59bb75d
Use a custom build_ext class to run autotool configuration if necessary
ptim0626 Aug 27, 2025
110223e
Use a Cython wrapper script to call mib_to_h5
ptim0626 Aug 27, 2025
da4df0b
Add initial pyproject and MANIFEST.in
ptim0626 Aug 27, 2025
0e281aa
Add initial README file for Python wrapper
ptim0626 Aug 27, 2025
823e0eb
Ignore autotools and Cython generated files
ptim0626 Aug 27, 2025
2e44d0b
Put default values into a single file so it can be reused
ptim0626 Aug 28, 2025
3b61abd
Use default values from the constant file in the wrapper
ptim0626 Aug 28, 2025
acc1e7c
Add cli mib2h5
ptim0626 Aug 28, 2025
fb27e8f
Provide __verision__ attribute for backwards compatibility
ptim0626 Aug 28, 2025
a721a58
Align environment variable searching for HDF5 installation in Python …
ptim0626 Aug 28, 2025
43533ea
Increase lower bound of setuptool version to adhere PEP 639 for licen…
ptim0626 Aug 28, 2025
4da2d94
Merge pull request #28 from ePSIC-DLS/features/cython_wrapper
ptim0626 Aug 28, 2025
3c8e512
Add public header for mib_to_h5
ptim0626 Aug 28, 2025
22844d1
Handle multiple mib files and metadata inclusion as specified in the …
ptim0626 Aug 28, 2025
4ab98d8
Support multiple .mib file with long command-line options
ptim0626 Aug 28, 2025
751a8f8
Update README with long options, env var and metadata control
ptim0626 Aug 28, 2025
27e4959
Update build instruction
ptim0626 Aug 28, 2025
c5e8eda
Migrate Python information to the README of Python wrapper
ptim0626 Aug 28, 2025
c471a96
Update default values in Python wrapper
ptim0626 Aug 28, 2025
bb6fa7a
Use the single file version of mib_to_h5 in Python wrapper
ptim0626 Aug 28, 2025
a7b021a
Handle multiple input files in Python wrapper
ptim0626 Aug 28, 2025
9c7f09d
Modify Python cli to support multiple input files
ptim0626 Aug 28, 2025
e170607
Update Python README to reflect multiple input files usage
ptim0626 Aug 28, 2025
849f85e
Merge pull request #32 from ePSIC-DLS/api-tidy-up
ptim0626 Aug 28, 2025
b557f84
Add option to display version
ptim0626 Sep 5, 2025
378e782
Display the actual specified path to find hdf5 library
ptim0626 Sep 5, 2025
be60c44
Fail configuration when the explicit path specified is invalid
ptim0626 Sep 5, 2025
e27eafb
Remove redundant AC message
ptim0626 Sep 5, 2025
5b2b734
Provide guidance for users with information about honoured paths
ptim0626 Sep 5, 2025
e958ddb
Add summary about where HDF5 is found for clarity
ptim0626 Sep 5, 2025
21dc1a1
Be more specific about the discovery of HDF5 library
ptim0626 Sep 5, 2025
1c67270
Add initial test script for building with Autotool for C
ptim0626 Sep 5, 2025
1023357
Add initial GH action to test building with autotools from C source
ptim0626 Sep 13, 2025
1c0b497
Use apt-get in container script
ptim0626 Sep 13, 2025
d0150b4
Add sudo for apt-get
ptim0626 Sep 13, 2025
6f601dc
Format apt-get update and install as two lines
ptim0626 Sep 13, 2025
72ecf63
Remove sudo in Docker image
ptim0626 Sep 13, 2025
f858669
Use archive repositories for gcc <= 10
ptim0626 Sep 13, 2025
d33ef8f
Avoid passing empty string to env
ptim0626 Sep 13, 2025
761858b
Fix gcc docker version with buster
ptim0626 Sep 13, 2025
917f10b
Merge pull request #33 from ePSIC-DLS/build-tests-c
ptim0626 Sep 13, 2025
5a332b0
Fix missed method call
ptim0626 Sep 15, 2025
0d175d7
Add initial test script for building the Python wrapper
ptim0626 Sep 19, 2025
65a31d3
Add initial GH action for testing Python build
ptim0626 Sep 27, 2025
ce4e5bf
Use default retention day for hdf5 library in C test GH action (90 days)
ptim0626 Sep 27, 2025
a8500e0
Only download build dependency if needed in C GH build tests
ptim0626 Sep 27, 2025
573c02b
Merge pull request #34 from ePSIC-DLS/python-build-test
ptim0626 Sep 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ jobs:
formatting-check:
runs-on: ubuntu-latest
name: Formatting Check
strategy:
matrix:
path:
- 'src'
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check
uses: jidicula/clang-format-action@v4.15.0
with:
clang-format-version: '20'
check-path: 'src'
check-path: ${{ matrix.path }}
200 changes: 200 additions & 0 deletions .github/workflows/test-build-c.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
name: C Build Tests

on:
push:
branches: [main, dev]
pull_request:
workflow_dispatch:

jobs:
# build different hdf5 artefacts
build-hdf5:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
include:
- name: system
prefix: /usr/local
artefact-name: hdf5-system
- name: custom
prefix: /opt/hdf5
artefact-name: hdf5-custom
container: gcc:7
name: Build HDF5 - ${{ matrix.name }}
steps:
- name: Cache HDF5 build
id: cache-hdf5
uses: actions/cache@v4
with:
path: /tmp/${{ matrix.artefact-name }}
key: hdf5-1.14.6-${{ matrix.name }}-gcc7-${{ runner.os }}-v1
restore-keys: |
hdf5-1.14.6-${{ matrix.name }}-gcc7-${{ runner.os }}-
hdf5-1.14.6-${{ matrix.name }}-gcc7-

- name: Download and build HDF5
if: steps.cache-hdf5.outputs.cache-hit != 'true'
run: |
# use archive repositories for Debian Buster
sed -i 's|deb.debian.org|archive.debian.org|g' /etc/apt/sources.list
sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list
sed -i '/buster-updates/d' /etc/apt/sources.list
apt-get update && apt-get install -y wget

# use HDF5 1.14.x
wget https://github.com/HDFGroup/hdf5/releases/download/hdf5_1.14.6/hdf5-1.14.6.tar.gz
tar -xzf hdf5-1.14.6.tar.gz
cd hdf5-1.14.6

# configure for specified prefix
./configure --prefix=${{ matrix.prefix }}
make -j$(nproc)

# staged for artefact
make install DESTDIR=/tmp/${{ matrix.artefact-name }}

- name: Create tarball artefact
run: |
cd /tmp/${{ matrix.artefact-name }}
tar -czf /tmp/${{ matrix.artefact-name }}.tar.gz .

- name: Upload HDF5 artefact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artefact-name }}
path: /tmp/${{ matrix.artefact-name }}.tar.gz
compression-level: 0

# test gcc 7-14
test-gcc-versions:
needs: build-hdf5
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
gcc-version: [7, 8, 9, 10, 11, 12, 13, 14]
container: gcc:${{ matrix.gcc-version }}
name: GCC ${{ matrix.gcc-version }} - system-wide installation
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Download HDF5 system artefact
uses: actions/download-artifact@v4
with:
name: hdf5-system

- name: Install HDF5 system-wide
run: |
tar -xzf hdf5-system.tar.gz -C /
ldconfig

- name: Use archive repositories for Debian Buster
if: matrix.gcc-version == 7 || matrix.gcc-version == 8
run: |
# gcc 7, 8 use debian buster which reached EOL
sed -i 's|deb.debian.org|archive.debian.org|g' /etc/apt/sources.list
sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list
sed -i '/buster-updates/d' /etc/apt/sources.list

- name: Install build dependencies
run: |
apt-get update
apt-get install -y autoconf automake libtool pkg-config

- name: Generate configure script
run: autoreconf -i

- name: Run build test
run: |
./tests/test_build/test_build_c.sh --only system

- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-gcc-${{ matrix.gcc-version }}-system
path: tests/test_build/logs/
retention-days: 7

# test different methods of specifying HDF5
test-hdf5-methods:
needs: build-hdf5
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
# system-wide
- method: system
artefact: hdf5-system
test-name: system
setup: ""
lib-path: ""
description: "system-wide HDF5 at /usr/local"

# explicit path
- method: explicit
artefact: hdf5-custom
test-name: explicit
setup: "export HDF5_TEST_PATH=/opt/hdf5"
lib-path: /opt/hdf5/lib
description: "explicit --with-hdf5=/opt/hdf5"

# via environment variable
- method: env_var
artefact: hdf5-custom
test-name: hdf5_root
setup: "export HDF5_ROOT=/opt/hdf5"
lib-path: /opt/hdf5/lib
description: "environment variable HDF5_ROOT"

container: gcc:11
name: HDF5 ${{ matrix.method }}
env:
LD_LIBRARY_PATH: ${{ matrix.lib-path }}
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Download HDF5 artefact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.artefact }}

- name: Install HDF5
run: |
echo "Installing HDF5 for: ${{ matrix.description }}"
tar -xzf ${{ matrix.artefact }}.tar.gz -C /
# update library cache for system-wide installation
if [ "${{ matrix.method }}" = "system" ]; then
ldconfig
fi

- name: Install build dependencies
run: |
apt-get update
apt-get install -y autoconf automake libtool pkg-config

- name: Generate configure script
run: autoreconf -i

- name: Run build test
run: |
# set test-specific environment
${{ matrix.setup }}

# run test
echo "Testing: ${{ matrix.description }}"
./tests/test_build/test_build_c.sh --only ${{ matrix.test-name }}

- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-hdf5-${{ matrix.method }}
path: tests/test_build/logs/
retention-days: 7
116 changes: 116 additions & 0 deletions .github/workflows/test-build-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Python Build Tests

on:
push:
branches: [main, dev]
pull_request:

jobs:
# build hdf5 library for python tests
build-hdf5:
runs-on: ubuntu-latest
timeout-minutes: 30
container: gcc:7
name: Build HDF5
steps:
- name: Cache HDF5 build
id: cache-hdf5
uses: actions/cache@v4
with:
path: /tmp/hdf5-python
key: hdf5-1.14.6-python-gcc7-${{ runner.os }}-v1
restore-keys: |
hdf5-1.14.6-python-gcc7-${{ runner.os }}-
hdf5-1.14.6-python-gcc7-

- name: Download and build HDF5
if: steps.cache-hdf5.outputs.cache-hit != 'true'
run: |
# use archive repositories for Debian Buster
sed -i 's|deb.debian.org|archive.debian.org|g' /etc/apt/sources.list
sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list
sed -i '/buster-updates/d' /etc/apt/sources.list
apt-get update && apt-get install -y wget

# use HDF5 1.14.x
wget https://github.com/HDFGroup/hdf5/releases/download/hdf5_1.14.6/hdf5-1.14.6.tar.gz
tar -xzf hdf5-1.14.6.tar.gz
cd hdf5-1.14.6

# configure for /opt/hdf5
./configure --prefix=/opt/hdf5
make -j$(nproc)

# staged for artefact
make install DESTDIR=/tmp/hdf5-python

- name: Create tarball artefact
run: |
cd /tmp/hdf5-python
tar -czf /tmp/hdf5-python.tar.gz .

- name: Upload HDF5 artefact
uses: actions/upload-artifact@v4
with:
name: hdf5-python
path: /tmp/hdf5-python.tar.gz
compression-level: 0

# test python installation methods
test-python:
needs: build-hdf5
runs-on: ubuntu-latest
timeout-minutes: 15
env:
HDF5_ROOT: /opt/hdf5
LD_LIBRARY_PATH: /opt/hdf5/lib
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
install-method: ["standard"]
include:
# add editable and pipx test for lowest-supported Python
- python-version: "3.10"
install-method: "editable"
- python-version: "3.10"
install-method: "pipx"
name: Python ${{ matrix.python-version }} - ${{ matrix.install-method }}
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake libtool
# install pipx only when needed
if [[ "${{ matrix.install-method }}" == "pipx" ]]; then
sudo apt-get install -y pipx
fi

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Download HDF5 artefact
uses: actions/download-artifact@v4
with:
name: hdf5-python

- name: Install HDF5
run: |
sudo tar -xzf hdf5-python.tar.gz -C /

- name: Run build test
run: |
./tests/test_build/test_build_python.sh --only ${{ matrix.install-method }}

- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-py${{ matrix.python-version }}-${{ matrix.install-method }}
path: tests/test_build/logs/
retention-days: 7
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,24 @@ doc/.build/*
*egg-info*
*__pycache__*
*sg_execution_times.rst
venv/*

# autotools generated files
**/aclocal.m4
**/autom4te.cache/
**/compile
**/config.h
**/config.h.in
**/config.log
**/config.status
**/configure
**/depcomp
**/install-sh
**/missing
**/stamp-h1
**/Makefile
**/Makefile.in
**/.deps/

# cython generated c files
**/_wrapper.c
2 changes: 2 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MD024:
siblings_only: true
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBDIRS = src
Loading