-
Notifications
You must be signed in to change notification settings - Fork 7
158 lines (133 loc) · 3.96 KB
/
fortran_build.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
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
155
156
157
158
name: CI
on: [push, pull_request]
env:
BUILD_DIR: _build
jobs:
gcc-meson-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
fc: [gfortran-11]
cc: [gcc-11]
include:
- os: ubuntu-latest
fc: gfortran-9
cc: gcc-9
- os: ubuntu-latest
fc: gfortran-10
cc: gcc-10
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install OpenBLAS (OSX)
if: ${{ contains(matrix.os, 'macos') }}
run: |
brew install openblas
echo "PKG_CONFIG_PATH=/usr/local/opt/openblas/lib/pkgconfig" >> $GITHUB_ENV
- name: Install meson
run: pip3 install meson==0.62.0 ninja cmake
- name: Configure build
run: >-
meson setup ${{ env.BUILD_DIR }}
--buildtype=release
${{ env.MESON_ARGS }}
env:
FC: ${{ matrix.fc }}
CC: ${{ matrix.cc }}
MESON_ARGS: ${{ contains(matrix.os, 'macos') && '-Dlapack=openblas' || '-Dlapack=netlib' }}
- name: Build project
run: meson compile -C ${{ env.BUILD_DIR }}
- name: Run unit tests
run: meson test -C ${{ env.BUILD_DIR }} --print-errorlogs --no-rebuild -t 120 --suite cpx
intel-meson-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
fc: [ifort]
cc: [icc]
env:
FC: ${{ matrix.fc }}
CC: ${{ matrix.cc }}
APT_PACKAGES: >-
intel-oneapi-compiler-fortran
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
intel-oneapi-mkl
intel-oneapi-mkl-devel
asciidoctor
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.x
- run: pip3 install meson ninja --user
- name: Add Intel repository
if: contains(matrix.os, 'ubuntu')
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install Intel oneAPI compiler
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get install ${APT_PACKAGES}
source /opt/intel/oneapi/setvars.sh
source /opt/intel/oneapi/compiler/2024.0/env/vars.sh
printenv >> $GITHUB_ENV
- name: Configure meson build
run: >-
meson setup ${{ env.BUILD_DIR }}
--prefix=/ --libdir=lib
-Dfortran_link_args="-lifcoremt -static"
-Ddefault_library=static
-Dlapack=mkl
- name: Build project
run: ninja -C ${{ env.BUILD_DIR }}
- name: Run unit tests
run: >-
meson test -C ${{ env.BUILD_DIR }}
--print-errorlogs
--num-processes 1
--no-rebuild
--suite cpx
-t 12
gcc-cmake-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
fc: [gfortran-10]
cc: [gcc-10]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install CMake
run: pip3 install ninja cmake==3.26.4
- name: Configure build
run: cmake -B ${{ env.BUILD_DIR }} -G Ninja
env:
FC: ${{ matrix.fc }}
CC: ${{ matrix.cc }}
- name: Build project
run: cmake --build ${{ env.BUILD_DIR }}
- name: Run unit tests
run: ctest --parallel --output-on-failure -R cpcmx
working-directory: ${{ env.BUILD_DIR }}
env:
OMP_NUM_THREADS: 2,1