-
Notifications
You must be signed in to change notification settings - Fork 8
81 lines (70 loc) · 2.32 KB
/
MacOS.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
# This is a GitHub CI workflow for the NCEPLIBS-ncio project.
#
# This workflow runs the build on MacOS.
#
# Ed Hartnett 1/12/23
name: MacOS
on:
push:
branches:
- develop
pull_request:
branches:
- develop
jobs:
MacOS:
runs-on: macos-latest
env:
FC: mpifort
CC: mpicc
HOMEBREW_NO_INSTALL_CLEANUP: 1
steps:
- uses: actions/checkout@v4
- name: install-dependencies
run: |
brew install --verbose mpich
sudo ln -sf /usr/local/bin/gfortran-11 /usr/local/bin/gfortran
- name: cache-netcdf
id: cache-netcdf
uses: actions/cache@v4
with:
path: ~/netcdf
key: netcdf-c-4.7.4-${{ runner.os }}1
- name: build-hdf5
if: steps.cache-netcdf.outputs.cache-hit != 'true'
run: |
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.7/src/hdf5-1.10.7.tar.gz &> /dev/null
tar -xzf hdf5-1.10.7.tar.gz
pushd hdf5-1.10.7
./configure --prefix=${HOME}/netcdf --enable-parallel --disable-tools --disable-fortran --disable-cxx --enable-parallel-tests
make -j2
make install
- name: build-netcdf-c
if: steps.cache-netcdf.outputs.cache-hit != 'true'
run: |
export CPPFLAGS=-I${HOME}/netcdf/include
export LDFLAGS=-L${HOME}/netcdf/lib
wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.7.4.tar.gz
tar -xzf v4.7.4.tar.gz
cd netcdf-c-4.7.4
./configure --prefix=${HOME}/netcdf --disable-dap --disable-utilities
make -j2
make install
- name: build-netcdf-fortran
if: steps.cache-netcdf.outputs.cache-hit != 'true'
run: |
export PATH="${HOME}/netcdf/bin:$PATH"
export CPPFLAGS=-I${HOME}/netcdf/include
export LDFLAGS=-L${HOME}/netcdf/lib
wget https://github.com/Unidata/netcdf-fortran/archive/v4.5.3.tar.gz &> /dev/null
tar -xzf v4.5.3.tar.gz
pushd netcdf-fortran-4.5.3
./configure --prefix=${HOME}/netcdf
make -j2
make install
- name: build and test
run: |
mkdir build && cd build
cmake .. -DCMAKE_PREFIX_PATH='~;~/netcdf' -DCMAKE_Fortran_FLAGS="-g -fprofile-arcs -ftest-coverage -fprofile-abs-path -O0"
make -j2 VERBOSE=1
ctest --output-on-failure