Skip to content

Commit 21235f5

Browse files
committed
ci:macos: test with mpich and openmpi
ci:build workflow
1 parent d25db1d commit 21235f5

File tree

4 files changed

+139
-61
lines changed

4 files changed

+139
-61
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: ci
22

33
env:
4-
CTEST_PARALLEL_LEVEL: 4
5-
CMAKE_BUILD_TYPE: Release
4+
HOMEBREW_NO_INSTALL_CLEANUP: 1
65

76
on:
87
push:
@@ -18,14 +17,21 @@ on:
1817
jobs:
1918

2019
linux:
21-
runs-on: ubuntu-latest
2220
timeout-minutes: 15
2321

2422
strategy:
2523
matrix:
24+
os: [ubuntu-latest, macos-latest]
2625
shared: [true, false]
2726
gcc: [8, 11]
28-
27+
mpi: [mpich, openmpi]
28+
exclude:
29+
- os: macos-latest
30+
mpi: mpich
31+
- os: macos-latest
32+
gcc: 8
33+
34+
runs-on: ${{ matrix.os }}
2935
env:
3036
CC: gcc-${{ matrix.gcc }}
3137
FC: gfortran-${{ matrix.gcc }}
@@ -37,12 +43,17 @@ jobs:
3743
python-version: '3.10'
3844

3945
- name: Python pkgs
40-
run: pip install numpy h5py pandas matplotlib
46+
run: pip install numpy h5py
4147

42-
- name: install hdf5
48+
- name: install HDF5-${{ matrix.mpi }} (Linux)
49+
if: runner.os == 'Linux'
4350
run: |
4451
sudo apt update
45-
sudo apt install --no-install-recommends gcc-${{ matrix.gcc }} gfortran-${{ matrix.gcc}} ninja-build libhdf5-openmpi-dev hdf5-tools libopenmpi-dev openmpi-bin
52+
sudo apt install --no-install-recommends gcc-${{ matrix.gcc }} gfortran-${{ matrix.gcc}} ninja-build libhdf5-${{ matrix.mpi }}-dev hdf5-tools lib${{ matrix.mpi }}-dev
53+
54+
- name: Install HDF5-${{ matrix.mpi }} (MacOS)
55+
if: runner.os == 'macOS'
56+
run: brew install hdf5-mpi ninja ${{ matrix.mpi }}
4657

4758
- uses: actions/checkout@v2
4859

@@ -82,7 +93,7 @@ jobs:
8293
- name: install hdf5
8394
run: |
8495
sudo apt update
85-
sudo apt install --no-install-recommends libhdf5-openmpi-dev hdf5-tools libopenmpi-dev openmpi-bin
96+
sudo apt install --no-install-recommends libhdf5-mpi-dev hdf5-tools mpi-default-dev mpi-default-bin
8697
8798
- name: install Gcovr
8899
run: pip install gcovr
@@ -97,47 +108,3 @@ jobs:
97108
with:
98109
name: coverage-report-html
99110
path: build-coverage/coverage/
100-
101-
102-
linux-build:
103-
needs: linux
104-
runs-on: ubuntu-latest
105-
timeout-minutes: 15
106-
107-
strategy:
108-
matrix:
109-
shared: [true, false]
110-
111-
steps:
112-
113-
- name: install MPI
114-
run: |
115-
sudo apt update
116-
sudo apt install --no-install-recommends libopenmpi-dev openmpi-bin
117-
118-
- uses: actions/checkout@v2
119-
120-
- name: Configure HDF5-MPI
121-
run: cmake -S scripts -B scripts/build -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
122-
123-
- name: Build/install HDF5
124-
run: cmake --build scripts/build --parallel
125-
126-
- name: configure h5fortran
127-
run: cmake -B build -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }} -DCMAKE_PREFIX_PATH=${{ runner.temp }}
128-
129-
- name: build h5fortran
130-
run: cmake --build build --parallel
131-
132-
- name: test h5fortran
133-
run: ctest --test-dir build --preset default
134-
135-
- name: install h5fortran
136-
run: cmake --install build
137-
138-
- name: configure examples
139-
run: cmake -S example -B example/build -DCMAKE_PREFIX_PATH:PATH=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
140-
- name: build Examples
141-
run: cmake --build example/build --parallel
142-
- name: Test Examples
143-
run: ctest --test-dir example/build -V

.github/workflows/ci_build.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: build
2+
3+
on:
4+
push:
5+
paths:
6+
- "scripts/CMakeLists.txt"
7+
- "cmake/libraries.json"
8+
- ".github/workflows/ci_build.yml"
9+
release:
10+
types: [published]
11+
12+
jobs:
13+
14+
linux:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 15
17+
18+
strategy:
19+
matrix:
20+
shared: [true, false]
21+
22+
steps:
23+
24+
- name: install MPI
25+
run: |
26+
sudo apt update
27+
sudo apt install --no-install-recommends libopenmpi-dev openmpi-bin
28+
29+
- uses: actions/checkout@v2
30+
31+
- name: Configure HDF5-MPI
32+
run: cmake -S scripts -B scripts/build -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
33+
34+
- name: Build/install HDF5
35+
run: cmake --build scripts/build --parallel
36+
37+
- name: configure h5fortran
38+
run: cmake -B build -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }} -DCMAKE_PREFIX_PATH=${{ runner.temp }}
39+
40+
- name: build h5fortran
41+
run: cmake --build build --parallel
42+
43+
- name: test h5fortran
44+
run: ctest --test-dir build --preset default
45+
46+
- name: install h5fortran
47+
run: cmake --install build
48+
49+
- name: configure examples
50+
run: cmake -S example -B example/build -DCMAKE_PREFIX_PATH:PATH=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
51+
- name: build Examples
52+
run: cmake --build example/build --parallel
53+
- name: Test Examples
54+
run: ctest --test-dir example/build -V
55+
56+
57+
58+
macos:
59+
runs-on: macos-latest
60+
timeout-minutes: 20
61+
62+
strategy:
63+
matrix:
64+
shared: [false]
65+
mpi: [mpich, open-mpi]
66+
# HDF5-MPI upstream is broken for shared MacOS builds.
67+
68+
steps:
69+
70+
- uses: actions/checkout@v2
71+
72+
- name: Install MPI
73+
run: brew install ${{ matrix.mpi }}
74+
75+
- name: Configure HDF5 with ${{ matrix.mpi }}
76+
run: cmake -S scripts -B scripts/build -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
77+
78+
- name: Build/install HDF5
79+
run: cmake --build scripts/build --parallel
80+
81+
- name: configure h5fortran with ${{ matrix.mpi }}
82+
run: cmake -B build -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }} -DCMAKE_PREFIX_PATH=${{ runner.temp }}
83+
84+
- name: build h5fortran
85+
run: cmake --build build --parallel
86+
87+
- name: test h5fortran
88+
run: ctest --test-dir build --preset default
89+
90+
- name: install h5fortran
91+
run: cmake --install build
92+
93+
- name: configure examples
94+
run: cmake -S example -B example/build -DCMAKE_PREFIX_PATH:PATH=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
95+
96+
- name: build Examples
97+
run: cmake --build example/build --parallel
98+
99+
- name: Test Examples
100+
run: ctest --test-dir example/build -V

.github/workflows/ci_macos.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
matrix:
2626
shared: [true, false]
27-
# HDF5-MPI upstream is broken for shared MacOS builds.
27+
mpi: [mpich, open-mpi]
2828

2929
steps:
3030

@@ -36,11 +36,12 @@ jobs:
3636
run: pip install h5py
3737

3838
- name: Install HDF5-MPI
39-
run: brew install hdf5-mpi ninja open-mpi
39+
run: brew install hdf5-mpi ninja ${{ matrix.mpi }}
4040

4141
- uses: actions/checkout@v2
4242

43-
- run: cmake --preset multi -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
43+
- name: configure with ${{ matrix.mpi }}
44+
run: cmake --preset multi -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
4445

4546
- run: cmake --build --preset debug
4647
- run: ctest --preset debug
@@ -66,6 +67,7 @@ jobs:
6667
strategy:
6768
matrix:
6869
shared: [false]
70+
mpi: [mpich, open-mpi]
6971
# HDF5-MPI upstream is broken for shared MacOS builds.
7072

7173
steps:
@@ -75,20 +77,29 @@ jobs:
7577
- name: Install MPI
7678
run: brew install open-mpi
7779

78-
- name: Configure HDF5
80+
- name: Configure HDF5 with ${{ matrix.mpi }}
7981
run: cmake -S scripts -B scripts/build -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
8082

8183
- name: Build/install HDF5
8284
run: cmake --build scripts/build --parallel
8385

84-
- run: cmake -B build -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }} -DCMAKE_PREFIX_PATH=${{ runner.temp }}
85-
- run: cmake --build build --parallel
86-
- run: ctest --test-dir build --preset default
87-
- run: cmake --install build
86+
- name: configure h5fortran with ${{ matrix.mpi }}
87+
run: cmake -B build -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }} -DCMAKE_PREFIX_PATH=${{ runner.temp }}
88+
89+
- name: build h5fortran
90+
run: cmake --build build --parallel
91+
92+
- name: test h5fortran
93+
run: ctest --test-dir build --preset default
94+
95+
- name: install h5fortran
96+
run: cmake --install build
8897

8998
- name: configure examples
9099
run: cmake -S example -B example/build -DCMAKE_PREFIX_PATH:PATH=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
100+
91101
- name: build Examples
92102
run: cmake --build example/build --parallel
103+
93104
- name: Test Examples
94105
run: ctest --test-dir example/build -V

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![DOI](https://zenodo.org/badge/377901005.svg)](https://zenodo.org/badge/latestdoi/377901005)
44

55
[![ci](https://github.com/geospace-code/h5fortran-mpi/actions/workflows/ci.yml/badge.svg)](https://github.com/geospace-code/h5fortran-mpi/actions/workflows/ci.yml)
6-
[![ci_macos](https://github.com/geospace-code/h5fortran-mpi/actions/workflows/ci_macos.yml/badge.svg)](https://github.com/geospace-code/h5fortran-mpi/actions/workflows/ci_macos.yml)
6+
[![ci](https://github.com/geospace-code/h5fortran-mpi/actions/workflows/ci_build.yml/badge.svg)](https://github.com/geospace-code/h5fortran-mpi/actions/workflows/ci_build.yml)
77
[![intel-oneapi](https://github.com/geospace-code/h5fortran-mpi/actions/workflows/intel-oneapi.yml/badge.svg)](https://github.com/geospace-code/h5fortran-mpi/actions/workflows/intel-oneapi.yml)
88

99
Easy to use object-oriented Fortran [parallel HDF5-MPI](https://portal.hdfgroup.org/display/HDF5/Parallel+HDF5) interface.

0 commit comments

Comments
 (0)