-
Notifications
You must be signed in to change notification settings - Fork 31
430 lines (359 loc) · 14.2 KB
/
CI.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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * 0"
# Download links for the Intel MKL library & Fortran compiler from:
# https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html
# (while MKL is available through several package managers, the compiler is not and we are grouping these dependencies for simplicity)
env:
IFORT_LINUX_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18481/l_fortran-compiler_p_2022.0.2.83_offline.sh
MKL_LINUX_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18483/l_onemkl_p_2022.0.2.136_offline.sh
IFORT_MAC_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18357/m_fortran-compiler-classic_p_2022.0.0.63_offline.dmg
MKL_MAC_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18346/m_onemkl_p_2022.0.0.105_offline.dmg
IFORT_WINDOWS_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18412/w_fortran-compiler_p_2022.0.0.77_offline.exe
MKL_WINDOWS_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18495/w_onemkl_p_2022.0.2.130_offline.exe
IFORT_WINDOWS_VERSION: 2022.0.0
MKL_WINDOWS_VERSION: 2022.0.2
jobs:
linux-static:
runs-on: ubuntu-latest
steps:
- name: Check number of cores
run: |
lscpu
lscpu | grep "CPU(s): " | awk '{print $2}' > num_cores
echo "NUM_CORES=$(cat num_cores)" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies with PyPI
run: pip install numpy
- name: Configure MOPAC with CMake
run: |
cmake -B build \
-DTHREADS_KEYWORD=OFF \
-DSTATIC_BUILD=ON
- name: Build MOPAC with Make
run: |
cmake --build build -- -j$NUM_CORES
- name: Test MOPAC with CTest
run: |
cd build
ctest -V -j $NUM_CORES
- name: Save test results as an artifact (on failure)
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: coverage-test-output
path: build/tests
code-coverage:
runs-on: ubuntu-latest
steps:
- name: Check number of cores
run: |
lscpu
lscpu | grep "CPU(s): " | awk '{print $2}' > num_cores
echo "NUM_CORES=$(cat num_cores)" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install lcov with Ubuntu package manager
run: sudo apt-get install lcov
- name: Install dependencies with PyPI
run: pip install numpy
- name: Configure MOPAC with CMake
run: |
cmake -B build \
-DTHREADS_KEYWORD=OFF \
-DENABLE_COVERAGE=ON
- name: Build MOPAC with Make
run: |
cmake --build build -- -j$NUM_CORES
- name: Test MOPAC with CTest
run: |
cd build
ctest -V -j $NUM_CORES
- name: Save test results as an artifact (on failure)
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: coverage-test-output
path: build/tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
directory: build
files: coverage.info
linux-build:
# Ubuntu 22+ switched to newer glibc (2.34) that breaks the compatibility library right now
runs-on: ubuntu-20.04
steps:
- name: Check number of cores
run: |
lscpu
lscpu | grep "CPU(s): " | awk '{print $2}' > num_cores
echo "NUM_CORES=$(cat num_cores)" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
# Set up the QT installer framework
- uses: jmarrec/setup-qtifw@v1
with:
qtifw-version: '4.x'
- name: Cache Intel dependencies
id: cache-intel
uses: actions/cache@v3
with:
path: /opt/intel
key: cache-${{ env.IFORT_LINUX_URL }}-${{ env.MKL_LINUX_URL }}
- name: Download & install Intel dependencies
if: steps.cache-intel.outputs.cache-hit != 'true'
run: |
curl $IFORT_LINUX_URL --output ifort_download.sh
sudo sh ifort_download.sh -a --silent --eula accept
curl $MKL_LINUX_URL --output mkl_download.sh
sudo sh mkl_download.sh -a --silent --eula accept
- name: Clone glibc compatibility library
uses: actions/checkout@v3
with:
repository: wheybags/glibc_version_header
path: glibc
- name: Install dependencies with PyPI
run: pip install numpy
- name: Configure MOPAC with CMake
run: |
source /opt/intel/oneapi/setvars.sh
cmake -B build \
-DCMAKE_Fortran_COMPILER=ifort \
-DCMAKE_Fortran_FLAGS="-static-intel" \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_C_FLAGS="-include $GITHUB_WORKSPACE/glibc/version_headers/x64/force_link_glibc_2.17.h" \
-DAUTO_BLAS=OFF \
-DMOPAC_LINK="-Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -liomp5 -lpthread -lm -ldl"
- name: Build MOPAC with Make
run: |
source /opt/intel/oneapi/setvars.sh
cmake --build build -- -j$NUM_CORES
ldd -v build/mopac
- name: Test MOPAC with CTest
run: |
source /opt/intel/oneapi/setvars.sh
cd build
ctest -V -j $NUM_CORES
- name: Save test results as an artifact (on failure)
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: linux-test-output
path: build/tests
- name: Package MOPAC with CPack
run: |
source /opt/intel/oneapi/setvars.sh
cd build
cpack -G IFW
ls -l
- name: Local installation test & minimal packaging
run: |
cd build
sudo make install
sudo cpack -G TGZ
- name: Save executable as an artifact
uses: actions/upload-artifact@v2
with:
name: linux-dist
path: build/mopac-*-linux.*
mac-build:
runs-on: macos-latest
steps:
- name: Check number of cores
run: |
system_profiler SPHardwareDataType
system_profiler SPHardwareDataType | grep "Total Number of Cores" | awk '{print $5}' > num_cores
echo "NUM_CORES=$(cat num_cores)" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
# Set up the QT installer framework
- uses: jmarrec/setup-qtifw@v1
with:
qtifw-version: '4.x'
- name: Fix permissions for cache restore
run: |
sudo mkdir -p /opt/intel
sudo chown $USER /opt/intel
- name: Cache Intel Fortran compiler
id: cache-intel
uses: actions/cache@v3
with:
path: /opt/intel
key: cache-${{ env.IFORT_MAC_URL }}-${{ env.MKL_MAC_URL }}
- name: Download & install Intel Fortran compiler
if: steps.cache-intel.outputs.cache-hit != 'true'
run: |
curl $MKL_MAC_URL --output mkl_download.dmg
hdiutil attach mkl_download.dmg
sudo /Volumes/m_onemkl*/bootstrapper.app/Contents/MacOS/install.sh --silent --eula accept
curl $IFORT_MAC_URL --output ifort_download.dmg
hdiutil attach ifort_download.dmg
sudo /Volumes/m_fortran-compiler*/bootstrapper.app/Contents/MacOS/install.sh --silent --eula accept
- name: Install dependencies with PyPI
run: pip3 install numpy
# AUTO_BLAS=OFF because find_package(BLAS) has a bug with static BLAS libraries on Mac
- name: Configure MOPAC with CMake
run: |
source /opt/intel/oneapi/setvars.sh
cmake -B build \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.8 \
-DCMAKE_Fortran_COMPILER=ifort \
-DCMAKE_Fortran_FLAGS="-static-intel" \
-DCMAKE_C_COMPILER=gcc \
-DAUTO_BLAS=OFF \
-DMOPAC_LINK="${MKLROOT}/lib/libmkl_intel_lp64.a ${MKLROOT}/lib/libmkl_intel_thread.a ${MKLROOT}/lib/libmkl_core.a -liomp5 -lpthread -lm -ldl"
# an Intel-suggested hack is temporarily circumventing excessively slow calls to xcodebuild hidden in ifort, taken from:
# https://community.intel.com/t5/Intel-oneAPI-HPC-Toolkit/slow-execution-of-ifort-icpc-on-MacOSX-catalina/m-p/1203190
- name: Build MOPAC with Make
run: |
source /opt/intel/oneapi/setvars.sh
mkdir xcode_hack
echo -ne '#!/bin/bash\ncase "$4" in\n "")\n echo $INTEL_OSXSDK_VER;;\n *)\n echo $INTEL_OSXSDK_PATH;;\nesac\n' > xcode_hack/xcodebuild
chmod 755 xcode_hack/xcodebuild
export INTEL_OSXSDK_VER=`xcodebuild -sdk macosx -version | grep SDKVersion`
export INTEL_OSXSDK_PATH=`xcodebuild -sdk macosx -version Path`
export PATH=$GITHUB_WORKSPACE/xcode_hack:${PATH}
cmake --build build -- -j$NUM_CORES
- name: Test MOPAC with CTest
run: |
source /opt/intel/oneapi/setvars.sh
cd build
ctest -V -j $NUM_CORES
- name: Save test results as an artifact (on failure)
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: mac-test-output
path: build/tests
- name: Local installation test
run: |
cd build
make install
- name: Package MOPAC with CPack
run: |
source /opt/intel/oneapi/setvars.sh
cd build
cpack -G IFW
ls -l
- name: Local installation test & minimal packaging
run: |
cd build
sudo make install
sudo cpack -G ZIP
- name: Save executable as an artifact
uses: actions/upload-artifact@v2
with:
name: mac-dist
path: build/mopac-*-mac.*
windows-build:
# NOTE: windows-latest has been switched to Visual Studio 2022, which is not yet supported by Intel development tools
runs-on: windows-2019
steps:
- name: Check number of cores
shell: bash
run: |
WMIC CPU Get -Format:List
WMIC CPU Get NumberOfLogicalProcessors | head -2 | tail -1 > num_cores
echo "NUM_CORES=$(cat num_cores)" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
# Set up the QT installer framework
- uses: jmarrec/setup-qtifw@v1
with:
qtifw-version: '4.x'
- name: Cache Intel Fortran compiler
id: cache-intel
uses: actions/cache@v3
with:
path: C:\Program Files (x86)\Intel
key: cache-${{ env.IFORT_WINDOWS_URL }}-${{ env.MKL_WINDOWS_URL }}
- name: Download & install Intel Fortran compiler
if: steps.cache-intel.outputs.cache-hit != 'true'
shell: cmd
run: |
curl ${{ env.IFORT_WINDOWS_URL }} --output ifort_download.exe
ifort_download -s -x -f ifort_unpack
ifort_unpack\bootstrapper --silent --eula accept -p=NEED_VS2019_INTEGRATION=0
curl ${{ env.MKL_WINDOWS_URL }} --output mkl_download.exe
mkl_download -s -x -f mkl_unpack
mkl_unpack\bootstrapper --silent --eula accept -p=NEED_VS2019_INTEGRATION=0
- name: Install dependencies with PyPI
run: pip3 install numpy
# The main Intel\oneAPI\setvars.bat script is not setting up the correct version of ifort, so using component-level scripts
- name: Configure MOPAC with CMake
shell: cmd
run: |
call "C:\Program Files (x86)\Intel\oneAPI\compiler\${{ env.IFORT_WINDOWS_VERSION }}\env\vars.bat"
call "C:\Program Files (x86)\Intel\oneAPI\mkl\${{ env.MKL_WINDOWS_VERSION }}\env\vars.bat"
echo %PATH%
cmake -Bbuild ^
-GNinja ^
-DBUILD_BZ=ON ^
-DCMAKE_Fortran_COMPILER=ifort ^
-DCMAKE_Fortran_FLAGS="/libs:static" ^
-DBLA_STATIC=ON ^
-DBLA_VENDOR=Intel10_64lp
- name: Build MOPAC with Ninja
shell: cmd
run: |
call "C:\Program Files (x86)\Intel\oneAPI\compiler\${{ env.IFORT_WINDOWS_VERSION }}\env\vars.bat"
call "C:\Program Files (x86)\Intel\oneAPI\mkl\${{ env.MKL_WINDOWS_VERSION }}\env\vars.bat"
cmake --build build -- -v
- name: Test MOPAC with CTest
shell: cmd
run: |
call "C:\Program Files (x86)\Intel\oneAPI\compiler\${{ env.IFORT_WINDOWS_VERSION }}\env\vars.bat"
call "C:\Program Files (x86)\Intel\oneAPI\mkl\${{ env.MKL_WINDOWS_VERSION }}\env\vars.bat"
cd build
ctest -V -j %NUM_CORES%
- name: Save test results as an artifact (on failure)
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: windows-test-output
path: build/tests
- name: Local installation test
shell: cmd
run: |
cd build
cmake --install .
- name: Package MOPAC with CPack (in development)
shell: cmd
run: |
call "C:\Program Files (x86)\Intel\oneAPI\compiler\${{ env.IFORT_WINDOWS_VERSION }}\env\vars.bat"
call "C:\Program Files (x86)\Intel\oneAPI\mkl\${{ env.MKL_WINDOWS_VERSION }}\env\vars.bat"
cd build
cpack -G IFW
dir
- name: Local installation test & minimal packaging
shell: cmd
run: |
call "C:\Program Files (x86)\Intel\oneAPI\compiler\${{ env.IFORT_WINDOWS_VERSION }}\env\vars.bat"
call "C:\Program Files (x86)\Intel\oneAPI\mkl\${{ env.MKL_WINDOWS_VERSION }}\env\vars.bat"
cd build
make install
cpack -G ZIP
- name: Save executable as an artifact
uses: actions/upload-artifact@v2
with:
name: windows-dist
path: build/mopac-*-win.*