-
Notifications
You must be signed in to change notification settings - Fork 15
227 lines (211 loc) · 8.27 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: Meson
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: GALAHAD/${{ matrix.os }}/${{ matrix.compiler }}/${{ matrix.version }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
version: ['12']
include:
- compiler: gcc
int64: false
- os: ubuntu-latest
compiler: gcc
version: '13'
int64: true
allow_failure: true
- os: windows-latest
compiler: intel-classic
version: '2021.10'
int64: false
allow_failure: true
- os: ubuntu-latest
compiler: intel-classic
version: '2021.10'
int64: false
allow_failure: true
- os: macos-latest
compiler: intel-classic
version: '2021.10'
int64: false
allow_failure: true
- os: windows-latest
compiler: intel
version: '2023.2'
int64: false
allow_failure: true
- os: ubuntu-latest
compiler: intel
version: '2023.2'
int64: false
allow_failure: true
- os: ubuntu-latest
compiler: nvidia-hpc
version: '23.11'
int64: false
allow_failure: true
runs-on: ${{ matrix.os }}
steps:
- name: Check out GALAHAD
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Meson and Ninja
run: pip install meson ninja numpy
- name: Set the environment variables GALAHAD, JULIA_GALAHAD_LIBRARY_PATH, DEPS and LIBDIR
shell: bash
run: |
echo "GALAHAD=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "JULIA_GALAHAD_LIBRARY_PATH=$GITHUB_WORKSPACE/galahad/lib" >> $GITHUB_ENV
echo "DEPS=$GITHUB_WORKSPACE/.." >> $GITHUB_ENV
if [[ "${{matrix.os}}" == "ubuntu-latest" ]]; then
echo "LIBDIR=lib" >> $GITHUB_ENV
fi
if [[ "${{matrix.os}}" == "macos-latest" ]]; then
echo "LIBDIR=lib" >> $GITHUB_ENV
fi
if [[ "${{matrix.os}}" == "windows-latest" ]]; then
echo "LIBDIR=bin" >> $GITHUB_ENV
fi
- name: Install dependencies
shell: bash
run: |
cd $DEPS
mkdir deps
PLATFORM=""
if [[ "${{matrix.os}}" == "ubuntu-latest" ]]; then
PLATFORM="x86_64-linux-gnu"
fi
if [[ "${{matrix.os}}" == "macos-latest" ]]; then
PLATFORM="x86_64-apple-darwin"
fi
if [[ "${{matrix.os}}" == "windows-latest" ]]; then
PLATFORM="x86_64-w64-mingw32"
choco install wget
fi
if [[ "${{matrix.int64}}" == "true" ]]; then
wget https://github.com/JuliaBinaryWrappers/OpenBLAS_jll.jl/releases/download/OpenBLAS-v0.3.26%2B0/OpenBLAS.v0.3.26.$PLATFORM-libgfortran5.tar.gz
tar -xzvf OpenBLAS.v0.3.26.$PLATFORM-libgfortran5.tar.gz -C deps
fi
# wget https://github.com/JuliaBinaryWrappers/OpenBLAS32_jll.jl/releases/download/OpenBLAS32-v0.3.26%2B0/OpenBLAS32.v0.3.26.$PLATFORM-libgfortran5.tar.gz
# tar -xzvf OpenBLAS32.v0.3.26.$PLATFORM-libgfortran5.tar.gz -C deps
- name: Set the environment variables LIBRARY_PATH, LD_LIBRARY_PATH and DYLD_LIBRARY_PATH
if: matrix.os != 'windows-latest'
shell: bash
run: |
if [[ "${{matrix.os}}" == "ubuntu-latest" ]]; then
echo "LIBRARY_PATH=$LIBRARY_PATH:$GITHUB_WORKSPACE/galahad/lib:$GITHUB_WORKSPACE/../deps/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/galahad/lib:$GITHUB_WORKSPACE/../deps/lib" >> $GITHUB_ENV
fi
if [[ "${{matrix.os}}" == "macos-latest" ]]; then
echo "LIBRARY_PATH=$LIBRARY_PATH:$GITHUB_WORKSPACE/galahad/lib:$GITHUB_WORKSPACE/../deps/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/galahad/lib:$GITHUB_WORKSPACE/../deps/lib" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GITHUB_WORKSPACE/galahad/lib:$GITHUB_WORKSPACE/../deps/lib" >> $GITHUB_ENV
echo "DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/opt/intel/oneapi/compiler/2023.2.0/mac/compiler/lib" >> $GITHUB_ENV
fi
# if [[ "${{matrix.os}}" == "windows-latest" ]]; then
# echo "PATH=$PATH:/d/a/GALAHAD/GALAHAD/../deps/bin" >> $GITHUB_ENV
# fi
- name: Set environment variables for OpenMP
if: matrix.os != 'windows-latest'
shell: bash
run: |
echo "OMP_CANCELLATION=TRUE" >> $GITHUB_ENV
echo "OMP_PROC_BIND=TRUE" >> $GITHUB_ENV
- name: Install compilers
uses: fortran-lang/setup-fortran@main
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.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 == 'macos-latest'
# uses: mxschmitt/action-tmate@v3
- name: Setup GALAHAD
shell: bash
run: |
CSTD="c99"
CPPSTD="c++11"
INT64="false"
SSIDS="true"
BLAS="openblas"
LAPACK="openblas"
BLAS_PATH=""
LAPACK_PATH=""
PYTHON_INTERFACE="true"
if [[ "${{matrix.compiler}}" == "nvidia-hpc" ]]; then
CSTD="none"
CPPSTD="none"
BLAS="blas_lp64"
LAPACK="lapack_lp64"
BLAS_PATH="/opt/nvidia/hpc_sdk/Linux_x86_64/23.11/compilers/lib"
LAPACK_PATH="/opt/nvidia/hpc_sdk/Linux_x86_64/23.11/compilers/lib"
fi
if [[ "${{matrix.int64}}" == "true" ]]; then
INT64="true"
BLAS="openblas64_"
LAPACK="openblas64_"
BLAS_PATH="$DEPS/deps/$LIBDIR"
LAPACK_PATH="$DEPS/deps/$LIBDIR"
fi
if [[ "${{matrix.compiler}}" == "nvidia-hpc" || "${{matrix.compiler}}" == "intel-classic" || ( "${{matrix.compiler}}" == "intel" && "${{matrix.os}}" == "windows-latest" ) ]]; then
SSIDS="false"
fi
meson setup builddir --buildtype=debug \
--prefix=$GITHUB_WORKSPACE/galahad \
-Dc_std=$CSTD \
-Dcpp_std=$CPPSTD \
-Dexamples=true \
-Dtests=true \
-Dssids=$SSIDS \
-Dpythoniface=true \
-Dgalahad_int64=$INT64 \
-Dlibblas_path=${BLAS_PATH} \
-Dliblapack_path=${LAPACK_PATH} \
-Dlibblas=$BLAS \
-Dliblapack=$LAPACK
- name: Build GALAHAD
shell: bash
run: |
meson compile -C builddir
- uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.version }}_meson-log.txt
path: builddir/meson-logs/meson-log.txt
- name: Install GALAHAD
shell: bash
run: |
meson install -C builddir
- uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.version }}_install-log.txt
path: builddir/meson-logs/install-log.txt
- name: Test GALAHAD
shell: bash
run: |
meson test -C builddir
- uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.version }}_testlog.txt
path: builddir/meson-logs/testlog.txt
- name: Install Julia
uses: julia-actions/setup-julia@v1
- name: Test GALAHAD.jl
shell: bash
run: julia --color=yes -e 'using Pkg; Pkg.develop(path="GALAHAD.jl"); Pkg.test("GALAHAD")'