-
Notifications
You must be signed in to change notification settings - Fork 27
205 lines (195 loc) · 7.44 KB
/
meson.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Meson
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: SPRAL/${{ matrix.os }}/${{ matrix.compiler }}/${{ matrix.compiler_version }}/METIS ${{ matrix.metis }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-13]
compiler_version: ['12']
arch: ['x64']
metis: [32, 64]
include:
- compiler: gcc
- os: ubuntu-latest
compiler: intel
compiler_version: '2023.2'
metis: 32
allow_failure: true
- os: ubuntu-latest
compiler: intel
compiler_version: '2023.2'
metis: 64
allow_failure: true
- os: macos-latest
compiler: gcc
compiler_version: '13'
arch: 'arm64'
metis: 32
allow_failure: true
- os: macos-latest
compiler: gcc
compiler_version: '13'
arch: 'arm64'
metis: 64
allow_failure: true
# - os: ubuntu-latest
# compiler: nvidia-hpc
# compiler_version: '25.1'
# metis: 32
# allow_failure: true
runs-on: ${{ matrix.os }}
steps:
- name: Check out SPRAL
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Meson and Ninja
run: pip install meson ninja
- name: Install dependencies
shell: bash
run: |
DEPS="$GITHUB_WORKSPACE/.."
cd $DEPS
mkdir deps
if [[ "${{matrix.os}}" == "ubuntu-latest" ]]; then
DLEXT="so"
LIBDIR="lib"
PLATFORM="x86_64-linux-gnu"
fi
if [[ "${{matrix.os}}" == "macos-13" ]]; then
DLEXT="dylib"
LIBDIR="lib"
PLATFORM="x86_64-apple-darwin"
fi
if [[ "${{matrix.os}}" == "macos-latest" ]]; then
DLEXT="dylib"
LIBDIR="lib"
PLATFORM="aarch64-apple-darwin"
fi
if [[ "${{matrix.os}}" == "windows-latest" ]]; then
DLEXT="dll"
LIBDIR="bin"
PLATFORM="x86_64-w64-mingw32"
choco install wget
fi
METIS_VERSION="5.1.2"
OPENBLAS_VERSION="0.3.23"
HWLOC_VERSION="2.10.0"
MKL_VERSION="2024.0.0"
wget https://github.com/JuliaBinaryWrappers/METIS_jll.jl/releases/download/METIS-v${METIS_VERSION}%2B0/METIS.v${METIS_VERSION}.$PLATFORM.tar.gz
tar -xzvf METIS.v${METIS_VERSION}.$PLATFORM.tar.gz -C deps
if [[ "${{matrix.metis}}" == "64" ]]; then
rm deps/include/metis.h
rm deps/$LIBDIR/libmetis.$DLEXT
cp deps/$LIBDIR/metis/metis_Int64_Real32/include/metis.h deps/include/metis.h
cp deps/$LIBDIR/metis/metis_Int64_Real32/$LIBDIR/libmetis_Int64_Real32.$DLEXT deps/$LIBDIR/libmetis_Int64_Real32.$DLEXT
fi
wget https://github.com/JuliaBinaryWrappers/OpenBLAS32_jll.jl/releases/download/OpenBLAS32-v${OPENBLAS_VERSION}%2B0/OpenBLAS32.v${OPENBLAS_VERSION}.$PLATFORM-libgfortran5.tar.gz
tar -xzvf OpenBLAS32.v${OPENBLAS_VERSION}.$PLATFORM-libgfortran5.tar.gz -C deps
wget https://github.com/JuliaBinaryWrappers/Hwloc_jll.jl/releases/download/Hwloc-v${HWLOC_VERSION}%2B0/Hwloc.v${HWLOC_VERSION}.$PLATFORM.tar.gz
tar -xzvf Hwloc.v${HWLOC_VERSION}.$PLATFORM.tar.gz -C deps
if [[ "${{matrix.os}}" == "ubuntu-latest" ]]; then
wget https://github.com/JuliaBinaryWrappers/MKL_jll.jl/releases/download/MKL-v${MKL_VERSION}%2B0/MKL.v${MKL_VERSION}.$PLATFORM.tar.gz
tar -xzvf MKL.v${MKL_VERSION}.$PLATFORM.tar.gz -C deps
fi
rm *.tar.gz
- name: Install compilers
uses: fortran-lang/setup-fortran@main
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.compiler_version }}
- name: Update Intel compilers
if: matrix.compiler == 'intel'
shell: bash
run: echo "FC=ifort" >> $GITHUB_ENV
# Uncomment this section to obtain ssh access to VM
# - name: Setup tmate session
# if: matrix.os == 'windows-latest'
# uses: mxschmitt/action-tmate@v3
- name: Setup SPRAL
shell: bash
run: |
DEPS="$GITHUB_WORKSPACE/.."
LIBDIR="lib"
LIBHWLOC="hwloc"
LIBMETIS="metis"
METIS64="false"
LIBBLAS="openblas"
LIBLAPACK="openblas"
CSTD="c99"
CPPSTD="c++11"
LD_CLASSIC=""
if [[ "${{matrix.os}}" == "windows-latest" ]]; then
LIBDIR="bin"
LIBHWLOC="hwloc-15"
fi
if [[ "${{matrix.os}}" == "macos-13" || "${{matrix.os}}" == "macos-latest" ]]; then
LD_CLASSIC="-Wl,-ld_classic"
fi
if [[ "${{matrix.metis}}" == "64" ]]; then
LIBMETIS="metis_Int64_Real32"
METIS64="true"
fi
if [[ "${{matrix.compiler}}" == "intel" ]]; then
LIBBLAS="mkl_rt"
LIBLAPACK="mkl_rt"
fi
if [[ "${{matrix.compiler}}" == "nvidia-hpc" ]]; then
CSTD="none"
CPPSTD="none"
fi
meson setup builddir --prefix=$GITHUB_WORKSPACE/../meson \
--buildtype=debug \
-Dexamples=true \
-Dtests=true \
-Dlibmetis_path=$DEPS/deps/$LIBDIR \
-Dlibmetis=$LIBMETIS \
-Dmetis64=$METIS64 \
-Dlibblas_path=$DEPS/deps/$LIBDIR \
-Dlibblas=$LIBBLAS \
-Dlibblas_include=../deps/include \
-Dliblapack_path=$DEPS/deps/$LIBDIR \
-Dliblapack=$LIBLAPACK \
-Dlibhwloc_path=$DEPS/deps/$LIBDIR \
-Dlibhwloc=$LIBHWLOC \
-Dlibhwloc_include=../deps/include \
-Dc_std=$CSTD \
-Dcpp_std=$CPPSTD \
-Dfortran_link_args=${LD_CLASSIC} \
-Dcpp_link_args=${LD_CLASSIC}
- name: Build SPRAL
shell: bash
run: |
meson compile -C builddir
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.compiler_version }}_METIS_${{ matrix.metis }}_meson-log.txt
path: builddir/meson-logs/meson-log.txt
- name: Install SPRAL
shell: bash
run: |
meson install -C builddir
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.compiler_version }}_METIS_${{ matrix.metis }}_install-log.txt
path: builddir/meson-logs/install-log.txt
- name: Test SPRAL
shell: bash
run: |
meson test -C builddir
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.compiler_version }}_METIS_${{ matrix.metis }}_testlog.txt
path: builddir/meson-logs/testlog.txt