forked from OpenFUSIONToolkit/OpenFUSIONToolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (135 loc) · 4.73 KB
/
ci_build.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: CI Build
on:
push:
branches:
- main
- ci_debug
pull_request:
types: [opened, reopened, synchronize]
jobs:
build:
name: ${{ format('{0} ({1})', matrix.config.name, matrix.parallel) }}
runs-on: ${{ matrix.config.os }}
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
FC: ${{ matrix.config.fc }}
OMP_NUM_THREADS: 2
strategy:
fail-fast: false
matrix:
parallel: ["openmp", "mpi_openmp"]
config:
- {
name: "Ubuntu 20.04 GCC 10",
os: ubuntu-20.04,
cc: "gcc-10", cxx: "g++-10", fc: "gfortran-10", python: "python"
}
- {
name: "Ubuntu 22.04 GCC 12",
os: ubuntu-22.04,
cc: "gcc-12", cxx: "g++-12", fc: "gfortran-12", python: "python3"
}
- {
name: "macOS Ventura GCC 12",
os: macos-13,
cc: "gcc-12", cxx: "g++-12", fc: "gfortran-12", python: "python3", xcode_path: "/Applications/Xcode_14.2.app/Contents/Developer"
}
- {
name: "macOS Sonoma GCC 13",
os: macos-14,
cc: "gcc-13", cxx: "g++-13", fc: "gfortran-13", python: "python3", xcode_path: "/Applications/Xcode_15.4.app/Contents/Developer"
}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Get OS version (Linux)
if: startsWith(matrix.config.os, 'ubuntu')
run: lsb_release -d
- name: Get OS version (macOS)
if: startsWith(matrix.config.os, 'macos')
run: |
sw_vers -productVersion
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
sudo xcode-select -s ${{ matrix.config.xcode_path }}
xcode-select -p
- name: Check compilers
run: |
$CC --version
$CXX --version
$FC --version
- name: Install prerequisites
if: ${{ matrix.config.os != 'macos-14' }}
run: |
${{ matrix.config.python }} -m venv ${{ github.workspace }}/oft_venv
source ${{ github.workspace }}/oft_venv/bin/activate
${{ matrix.config.python }} -m pip install pytest numpy scipy h5py triangle
- name: Install prerequisites (macos arm64)
if: ${{ matrix.config.os == 'macos-14' }}
run: |
${{ matrix.config.python }} -m venv ${{ github.workspace }}/oft_venv
source ${{ github.workspace }}/oft_venv/bin/activate
${{ matrix.config.python }} -m pip install pytest numpy scipy h5py setuptools
git clone https://github.com/drufat/triangle.git
cd triangle
git submodule init
git submodule update
${{ matrix.config.python }} setup.py build
${{ matrix.config.python }} setup.py install
- name: Cache external libraries
id: cache-ext-libs
uses: actions/cache@v4
with:
path: libs
key: ${{ matrix.config.os }}-build-${{ matrix.parallel }}-${{ hashFiles('src/utilities/build_libs.py') }}
- name: Create build dir
if: ${{ steps.cache-ext-libs.outputs.cache-hit != 'true' }}
run: mkdir libs
- name: Build external (OpenMP)
if: ${{ matrix.parallel == 'openmp' }}
shell: bash
timeout-minutes: 30
working-directory: libs
run: >
${{ matrix.config.python }} ../src/utilities/build_libs.py --no_dl_progress --nthread=2 --ref_blas
--build_umfpack=1 --build_arpack=1 --oft_build_tests=1
- name: Build external (MPI+OpenMP)
if: ${{ matrix.parallel == 'mpi_openmp' }}
shell: bash
timeout-minutes: 60
working-directory: libs
run: >
${{ matrix.config.python }} ../src/utilities/build_libs.py --no_dl_progress --nthread=2 --ref_blas
--build_mpi=1 --build_umfpack=1 --build_superlu=1 --build_superlu_dist=1
--build_arpack=1 --oft_build_tests=1
- name: Upload library failure log
uses: actions/upload-artifact@v4
if: failure()
with:
name: Library_failure_log-${{ matrix.config.os }}_${{ matrix.parallel }}
path: libs/build/build_error.log
- name: Remove external build directory
shell: bash
working-directory: libs
run: rm -rf build
- name: Configure OFT
shell: bash
working-directory: libs
run: |
source ${{ github.workspace }}/oft_venv/bin/activate
bash config_cmake.sh
- name: Build OFT
shell: bash
working-directory: libs/build_release
run: make
- name: Install OFT
shell: bash
working-directory: libs/build_release
run: make install
- name: Test OFT
shell: bash
timeout-minutes: 90
working-directory: libs/build_release
run: |
source ${{ github.workspace }}/oft_venv/bin/activate
make test