forked from HDFGroup/hdf5
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (83 loc) · 3.12 KB
/
build_mpich_source.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Build MPICH from source using the latest commit on the
# 'main' branch and cache the results. The result is compressed
# into a 'mpich.tar' archive to preserve permissions and
# then is uploaded as the artifact 'mpich' which can later
# be downloaded with 'actions/download-artifact' and then
# uncompressed with 'tar xvf mpich.tar -C <directory>'
# Triggers the workflow on a call from another workflow
on:
workflow_call:
inputs:
build_mode:
description: "Release vs. Debug build"
required: true
type: string
permissions:
contents: read
jobs:
ubuntu_gcc_build_and_test:
name: "Build MPICH ${{ inputs.build_mode }} (GCC)"
runs-on: ubuntu-latest
steps:
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install build-essential libtool libtool-bin
- name: Get MPICH source
uses: actions/[email protected]
with:
repository: 'pmodels/mpich'
path: 'mpich'
submodules: recursive
- name: Get MPICH commit hash
shell: bash
id: get-sha
run: |
cd $GITHUB_WORKSPACE/mpich
export MPICH_SHA=$(git rev-parse HEAD)
echo "MPICH_SHA=$MPICH_SHA" >> $GITHUB_ENV
echo "sha=$MPICH_SHA" >> $GITHUB_OUTPUT
# Output SHA for debugging
echo "MPICH_SHA=$MPICH_SHA"
- name: Cache MPICH (GCC) installation
id: cache-mpich-ubuntu-gcc
uses: actions/cache@v4
with:
path: ${{ runner.workspace }}/mpich
key: ${{ runner.os }}-${{ runner.arch }}-gcc-mpich-${{ steps.get-sha.outputs.sha }}-${{ inputs.build_mode }}
# Enable threads=multiple for testing with Subfiling and
# VOL connectors that require MPI_THREAD_MULTIPLE
- name: Install MPICH (GCC) (Release)
if: ${{ steps.cache-mpich-ubuntu-gcc.outputs.cache-hit != 'true' && (inputs.build_mode == 'Release') }}
run: |
cd $GITHUB_WORKSPACE/mpich
./autogen.sh
./configure \
CC=gcc \
--prefix=${{ runner.workspace }}/mpich \
--enable-threads=multiple
make -j2
make install
# Enable threads=multiple for testing with Subfiling and
# VOL connectors that require MPI_THREAD_MULTIPLE
- name: Install MPICH (GCC) (Debug)
if: ${{ steps.cache-mpich-ubuntu-gcc.outputs.cache-hit != 'true' && (inputs.build_mode == 'Debug') }}
run: |
cd $GITHUB_WORKSPACE/mpich
./autogen.sh
./configure \
CC=gcc \
--prefix=${{ runner.workspace }}/mpich \
--enable-g=most \
--enable-debuginfo \
--enable-threads=multiple
make -j2
make install
- name: Tar MPICH installation to preserve permissions for artifact
run: tar -cvf mpich.tar -C ${{ runner.workspace }} mpich
- name: Save MPICH installation artifact
uses: actions/upload-artifact@v4
with:
name: mpich
path: mpich.tar
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`