-
Notifications
You must be signed in to change notification settings - Fork 262
236 lines (201 loc) · 7.63 KB
/
macos.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
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
228
229
230
231
232
233
234
235
name: macos
on:
workflow_dispatch:
schedule:
# Run job every Saturday at 08:20 UTC
- cron: '20 8 * * 6'
# push:
# branches-ignore:
# - '**/dev2'
# - '**/*dev2'
# pull_request:
# This workflow hangs intermittently at random places, after building a demo
# program and just before running it. Something is broken but it's not
# SuiteSparse; it's github. Tests on an M1 Mac and Intel Mac have never shown
# this behavior outside of github. As a result, this workflow has been
# relegated to a "workflow_dispatch" only. It is not run on push or pull
# requests. The hang has nothing to do with parallelism; it can hang in
# check_AMD, which does not use OpenMP.
concurrency: ci-macos-${{ github.ref }}
env:
# string with name of libraries to be built
BUILD_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:ParU:RBio:SPQR:SPEX:GraphBLAS:LAGraph"
jobs:
macos:
# For available GitHub-hosted runners, see:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
runs-on: macos-latest
steps:
- name: get runner hardware information
run: |
sysctl hw
sysctl machdep
- name: checkout repository
uses: actions/checkout@v4
- name: install dependencies
# Homebrew's Python conflicts with the Python that comes pre-installed
# on the GitHub runners. Some of SuiteSparse's dependencies depend on
# different versions of Homebrew's Python. Enforce using the ones from
# Homebrew to avoid errors on updates.
# See: https://github.com/orgs/Homebrew/discussions/3928
# It looks like "gfortran" isn't working correctly unless "gcc" is
# re-installed.
run: |
brew update
brew reinstall gcc
brew install autoconf automake ccache cmake gmp lapack libomp mpfr openblas
HOMEBREW_PREFIX=$(brew --prefix)
echo "HOMEBREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
- name: prepare ccache
# create key with human readable timestamp
# used in action/cache/restore and action/cache/save steps
id: ccache-prepare
run: |
echo "key=ccache:macos-latest:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT
- name: restore ccache
# setup the GitHub cache used to maintain the ccache from one job to the next
uses: actions/cache/restore@v4
with:
path: /Users/runner/Library/Caches/ccache
key: ${{ steps.ccache-prepare.outputs.key }}
# Prefer caches from the same branch. Fall back to caches from the dev branch.
restore-keys: |
ccache:macos-latest:${{ github.ref }}
ccache:macos-latest
- name: configure ccache
# Limit the maximum size to avoid exceeding the total cache limits.
run: |
test -d /Users/runner/Library/Preferences/ccache || mkdir /Users/runner/Library/Preferences/ccache
echo "max_size = 300M" >> /Users/runner/Library/Preferences/ccache/ccache.conf
ccache -s
- name: build
run: |
IFS=':' read -r -a libs <<< "${BUILD_LIBS}"
for lib in "${libs[@]}"; do
printf " \033[0;32m==>\033[0m Building library \033[0;32m${lib}\033[0m\n"
echo "::group::Configure $lib"
cd ${GITHUB_WORKSPACE}/${lib}/build
cmake -DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}" \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_Fortran_COMPILER_LAUNCHER="ccache" \
-DBLA_VENDOR="Apple" \
-DCMAKE_PREFIX_PATH="${HOMEBREW_PREFIX}/opt/lapack;${HOMEBREW_PREFIX}/opt/openblas;${HOMEBREW_PREFIX}/opt/libomp" \
..
echo "::endgroup::"
echo "::group::Build $lib"
cmake --build . --config Release
echo "::endgroup::"
done
- name: check Mongoose
run: |
cd ${GITHUB_WORKSPACE}/Mongoose/build
ctest .
- name: check AMD
run: |
cd ${GITHUB_WORKSPACE}/AMD
make demos
- name: check CAMD
run: |
cd ${GITHUB_WORKSPACE}/CAMD
make demos
- name: check COLAMD
run: |
cd ${GITHUB_WORKSPACE}/COLAMD
make demos
- name: check CCOLAMD
run: |
cd ${GITHUB_WORKSPACE}/CCOLAMD
make demos
- name: check CHOLMOD
run: |
cd ${GITHUB_WORKSPACE}/CHOLMOD
make demos
cd ${GITHUB_WORKSPACE}/CHOLMOD/build
ctest .
- name: check CSparse
run: |
cd ${GITHUB_WORKSPACE}/CSparse
make demos
- name: check CXSparse
run: |
cd ${GITHUB_WORKSPACE}/CXSparse
make demos
- name: check LDL
run: |
cd ${GITHUB_WORKSPACE}/LDL
make demos
- name: check KLU
run: |
cd ${GITHUB_WORKSPACE}/KLU
make demos
- name: check UMFPACK
run: |
cd ${GITHUB_WORKSPACE}/UMFPACK
make demos
- name: check RBio
run: |
cd ${GITHUB_WORKSPACE}/RBio
make demos
- name: check SPQR
run: |
cd ${GITHUB_WORKSPACE}/SPQR
make demos
- name: check SPEX
run: |
cd ${GITHUB_WORKSPACE}/SPEX
make demos
- name: check GraphBLAS
run: |
cd ${GITHUB_WORKSPACE}/GraphBLAS
make demos
- name: check LAGraph
run: |
cd ${GITHUB_WORKSPACE}/LAGraph
make demos
- name: check ParU
run: |
cd ${GITHUB_WORKSPACE}/ParU
make demos
- name: ccache status
continue-on-error: true
run: ccache -s
- name: save ccache
# Save the cache after we are done (successfully) building
# This helps to retain the ccache even if the subsequent steps are failing.
uses: actions/cache/save@v4
with:
path: /Users/runner/Library/Caches/ccache
key: ${{ steps.ccache-prepare.outputs.key }}
- name: install
run: |
IFS=':' read -r -a libs <<< "${BUILD_LIBS}"
for lib in "${libs[@]}"; do
printf "::group::\033[0;32m==>\033[0m Installing library \033[0;32m${lib}\033[0m\n"
cd ${GITHUB_WORKSPACE}/${lib}/build
cmake --install .
echo "::endgroup::"
done
- name: build example
run: |
cd ${GITHUB_WORKSPACE}/Example/build
printf "::group::\033[0;32m==>\033[0m Configuring example\n"
cmake \
-DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/lib/cmake;${HOMEBREW_PREFIX}/opt/lapack;${HOMEBREW_PREFIX}/opt/openblas;${HOMEBREW_PREFIX}/opt/libomp" \
..
echo "::endgroup::"
printf "::group::\033[0;32m==>\033[0m Building example\n"
cmake --build .
echo "::endgroup::"
printf "::group::\033[0;32m==>\033[0m Executing example\n"
printf "\033[1;35m C binary with shared libraries\033[0m\n"
./my_demo
printf "\033[1;35m C++ binary with shared libraries\033[0m\n"
./my_cxx_demo
printf "\033[1;35m C binary with statically linked libraries\033[0m\n"
./my_demo_static
printf "\033[1;35m C++ binary with statically linked libraries\033[0m\n"
./my_cxx_demo_static
echo "::endgroup::"