-
Notifications
You must be signed in to change notification settings - Fork 26
141 lines (132 loc) · 4.45 KB
/
autotools.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
# All actions have a name that will be displayed in the "Actions" page in GitHub.
name: 'Autotools'
on:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'
jobs:
build:
name: SPRAL/${{ matrix.os }}/${{ matrix.fc }}/${{ matrix.compiler_version }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
compiler_version: ['10', '11', '12']
include:
- compiler: gnu
cc: gcc
fc: gfortran
cxx: g++
allow_failure: false
#- os: ubuntu-latest
# compiler: intel-classic
# compiler_version: 2021.9
# cc: icc
# fc: ifort
# cxx: icpc
# allow_failure: true
#- os: macos-13
# compiler: intel-classic
# compiler_version: 2021.9
# cc: icc
# fc: ifort
# cxx: icpc
# allow_failure: true
# - os: ubuntu-latest
# compiler: intel-llvm
# compiler_version: 2023.2
# cc: icx
# fc: ifx
# cxx: icpx
# allow_failure: true
runs-on: ${{ matrix.os }}
env:
# Set environ for OpenMP
OMP_CANCELLATION: true
OMP_PROC_BIND: true
OMP_NUM_THREADS: 4
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# Usually this is always needed
- uses: actions/checkout@v3
- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install libhwloc-dev libudev-dev libmetis-dev libopenblas-dev
- name: Install dependencies on MacOS
if: matrix.os == 'macos-13'
run: |
brew install automake autoconf hwloc metis openblas
- name: Install GNU C and C++ compilers
if: matrix.compiler == 'gnu'
uses: fortran-lang/setup-fortran@main
with:
compiler: gcc
version: ${{matrix.compiler_version}}
- name: Install classic Intel C and C++ compilers
if: matrix.compiler == 'intel-classic'
uses: fortran-lang/setup-fortran@main
with:
compiler: intel-classic
version: ${{matrix.compiler_version}}
- name: Install nextgen Intel C and C++ compilers
if: matrix.compiler == 'intel-llvm'
uses: fortran-lang/setup-fortran@main
with:
compiler: intel
version: ${{matrix.compiler_version}}
# Uncomment this section to obtain ssh access to VM
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: 'Build'
shell: bash
run: |
./autogen.sh
PENDANTIC=""
if [[ "${{matrix.compiler}}" == "gnu" ]]; then
PENDANTIC="-pedantic"
fi
INTEL=""
if [[ "${{matrix.compiler}}" == "intel-classic" ]]; then
INTEL="-diag-disable=10441"
fi
LIB_CPP="-lstdc++"
if [[ "${{matrix.os}}" == "macos-13" ]] && [[ "${{matrix.compiler}}" == "intel-classic" ]]; then
LIB_CPP="-lc++"
fi
OPENMP="-fopenmp"
WARNING="-Wall"
INC_BLAS=""
LIB_BLAS="-lopenblas"
if [[ "${{matrix.compiler}}" == "intel-classic" ]] || [[ "${{matrix.compiler}}" == "intel-llvm" ]]; then
OPENMP="-qopenmp"
WARNING="-warn all"
LIB_BLAS="-lmkl_rt"
fi
if [[ "${{matrix.os}}" == "macos-13" ]] && [[ "${{matrix.compiler}}" == "gnu" ]]; then
INC_BLAS="-I$(brew --prefix openblas)/include"
LIB_BLAS="-L$(brew --prefix openblas)/lib -lopenblas"
LD_CLASSIC="-Wl,-ld_classic"
fi
LIB_METIS="-lmetis"
if [[ "${{matrix.os}}" == "macos-13" ]]; then
LIB_METIS="-L$(brew --prefix metis)/lib -lmetis"
fi
./configure CC=${{matrix.cc}} \
CXX=${{matrix.cxx}} \
F77=${{matrix.fc}} \
FC=${{matrix.fc}} \
LIBS=${LIB_CPP} \
CFLAGS="-g -O3 -Wall $OPENMP $INTEL ${INC_BLAS}" \
CXXFLAGS="-g -O3 -std=c++17 -Wall $OPENMP $INTEL ${INC_BLAS} ${LD_CLASSIC}" \
FCFLAGS="-g -O3 $WARNING $OPENMP $PENDANTIC ${LD_CLASSIC}" \
--with-blas="${LIB_BLAS}" \
--with-lapack="${LIB_BLAS}" \
--with-metis="${LIB_METIS}"
make
- name: 'Test'
run: |
make check