-
Notifications
You must be signed in to change notification settings - Fork 36
85 lines (75 loc) · 2.46 KB
/
build_ubuntu.yaml
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
name: Build Ubuntu
on:
pull_request:
workflow_dispatch:
jobs:
build:
env:
VERBOSE: 1
runs-on: ubuntu-20.04
strategy:
matrix:
mpi: ['openmpi', 'mpich']
steps:
- name: cache-mpi
if: matrix.mpi == 'openmpi'
id: cache-mpi
uses: actions/cache@v2
with:
path: ~/mpi
key: openmpi-4.1.1
- name: build-openmpi
if: steps.cache-mpi.outputs.cache-hit != 'true'
run: |
if [[ ${{ matrix.mpi }} == "openmpi" ]]; then
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.1.tar.gz &> /dev/null
tar -xzf openmpi-4.1.1.tar.gz
cd openmpi-4.1.1
./configure --prefix=$HOME/mpi --enable-mpi-fortran --enable-mpi-cxx
make -j2
make install
fi
- name: Install dependencies (MPICH)
if: matrix.mpi == 'mpich'
run: |
sudo apt-get update
sudo apt-get install libmpich-dev
- name: Install dependencies
run: |
if [[ ${{ matrix.mpi }} == "openmpi" ]]; then
echo "$HOME/mpi/bin" >> $GITHUB_PATH
fi
sudo apt-get install python3-pip python3-dev python3-numpy
sudo python3 -m pip install -U pip setuptools
sudo python3 -m pip install -U numpy
sudo python3 -m pip install -U netCDF4
- name: Get sources
uses: actions/checkout@v3
with:
path: ${{ matrix.mpi }}
- name: Build
run: |
cd ${{ matrix.mpi }}
prefix=$GITHUB_WORKSPACE/install-${{ matrix.mpi }}
if [[ ${{ matrix.mpi }} == "mpich" ]]; then
mpi_ver=$( mpiexec --version | grep Version | awk '{ print $2 }' )
elif [[ ${{ matrix.mpi }} == "openmpi" ]]; then
mpi_ver=$( mpiexec --version | grep OpenRTE | awk '{ print $3 }' )
fi
gnu_ver=$( gcc -dumpfullversion -dumpversion )
python_ver=$( python3 --version | cut -d " " -f2 | cut -d. -f1-2 )
export HPC_COMPILER="gnu/${gnu_ver}"
export HPC_MPI="${{ matrix.mpi }}/${mpi_ver}"
export HPC_PYTHON="python/${python_ver}"
./build_stack.sh -p $prefix -c config/config_custom.sh -y stack/stack_custom.yaml
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.mpi }}-log
path: ${{ matrix.mpi }}/log
- name: Clean disk space of downloaded packages
if: ${{ success() }}
run: |
cd ${{ matrix.mpi }}
rm -rf pkg