-
Notifications
You must be signed in to change notification settings - Fork 9
213 lines (201 loc) · 6.78 KB
/
c-cpp.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
name: TAMM_CI
on:
push:
paths-ignore:
- docs
pull_request:
branches:
- main
- develop
repository_dispatch:
types: [backend_automation]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
backend:
- ga
- upcxx
mpi_impl:
- openmpi
cxx:
- g++-10
cc:
- gcc-10
fc:
- gfortran-10
include:
- os: ubuntu-22.04
mpi_impl: openmpi
cxx: g++-10
cc: gcc-10
fc: gfortran-10
backend: ga
- os: ubuntu-22.04
mpi_impl: openmpi
cxx: g++-11
cc: gcc-11
fc: gfortran-11
backend: ga
- os: ubuntu-22.04
mpi_impl: openmpi
cxx: clang++-11
cc: clang-11
fc: gfortran-10
backend: ga
- os: ubuntu-22.04
mpi_impl: openmpi
cxx: g++-11
cc: gcc-11
fc: gfortran-11
backend: upcxx
exclude:
- os: ubuntu-22.04
mpi_impl: openmpi
cxx: g++-9
cc: gcc-9
fc: gfortran-9
backend: upcxx
- os: ubuntu-22.04
mpi_impl: openmpi
cxx: g++-10
cc: gcc-10
fc: gfortran-10
backend: upcxx
fail-fast: true
env:
MPI_IMPL: ${{ matrix.mpi_impl }}
CXX: ${{ matrix.cxx }}
CC: ${{ matrix.cc }}
FC: ${{ matrix.fc }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Check SIMD
id: get-simd
run: |
chmod +x ${GITHUB_WORKSPACE}/.github/workflows/scripts/check_simd.sh
echo "simd=$(${GITHUB_WORKSPACE}/.github/workflows/scripts/check_simd.sh)" >> $GITHUB_ENV
shell: bash
- name: Cache install steps (backend = ga)
if: ${{ matrix.backend == 'ga' }}
id: tamm-cache-install
uses: actions/cache@v4
with:
path: |
~/tamm_cache
key: ${{ runner.os }}-${{ matrix.mpi_impl }}-${{ matrix.cc }}-${{ matrix.cxx }}-simd${{ env.simd }}-tamm
- name: Cache install steps (backend = upcxx)
if: ${{ matrix.backend == 'upcxx' }}
id: tamm-upcxx-cache-install
uses: actions/cache@v4
with:
path: |
~/tamm_cache
key: ${{ runner.os }}-${{ matrix.mpi_impl }}-${{ matrix.cc }}-${{ matrix.cxx }}-simd${{ env.simd }}-tamm-upcxx
- name: install compilers
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get -y install $CC $CXX $FC
$CC --version
$CXX --version
$FC --version
gcov --version
git --version
python --version
shell: bash
- name: get-misc
run: sudo apt-get install make wget curl rsync tree software-properties-common libxml2-dev libxslt-dev
- name: get-blas-lapack
run: sudo apt-get install libopenblas-base libopenblas-dev libgslcblas0 libgsl-dev liblapacke liblapacke-dev
- name: get-openmpi
run: |
sudo apt-get install openmpi-bin libopenmpi-dev
mpicc -show
mpifort -show
mpicxx -show
mpiexec --version
- name: get-gcovr
run: pip install gcovr
- name: get-cmake
run: |
wget https://github.com/Kitware/CMake/releases/download/v3.22.6/cmake-3.22.6-linux-x86_64.sh
yes | /bin/sh cmake-3.22.6-linux-x86_64.sh
- name: build upcxx
if: ${{ matrix.backend == 'upcxx' && steps.tamm-upcxx-cache-install.outputs.cache-hit != 'true' }}
shell: bash
run: |
mkdir -p $GITHUB_WORKSPACE/external_deps
cd $GITHUB_WORKSPACE/external_deps
wget https://bitbucket.org/berkeleylab/upcxx/downloads/upcxx-2023.3.0.tar.gz
tar xf upcxx-2023.3.0.tar.gz
cd upcxx-2023.3.0
export INSTALL_PATH=$GITHUB_WORKSPACE/install
./configure --prefix=${INSTALL_PATH} --with-cxx=mpicxx --with-cc=mpicc --with-default-network=smp
make -j2 all
make install
- name: find cache
id: find_cache
if: ${{ steps.tamm-cache-install.outputs.cache-hit == 'true' || steps.tamm-upcxx-cache-install.outputs.cache-hit == 'true' }}
run: |
export INSTALL_PATH=$GITHUB_WORKSPACE/install
pwd
ls -lart
mkdir -p ${INSTALL_PATH} ~/tamm_cache || true
export TIP=~/tamm_cache/
rm -rf $TIP/share/cmake/tamm $TIP/lib/libtamm* $TIP/include/tamm $TIP/share/cmake/CMakeBuild
rsync -av ~/tamm_cache/* ${INSTALL_PATH}/.
ls -lrt ${INSTALL_PATH} || true
- name: enable coverage
if: ${{ matrix.backend == 'ga' && matrix.cc != 'clang-11' && matrix.cc != 'gcc-11' }}
run: |
echo "CI_COVERAGE=ON" >> $GITHUB_ENV
- name: build tamm (backend = ga)
if: ${{ matrix.backend == 'ga' }}
id: build_tamm
run: |
export INSTALL_PATH=$GITHUB_WORKSPACE/install
export CPATH=$CPATH:$INSTALL_PATH/include/eigen3
$GITHUB_WORKSPACE/cmake-3.22.6-linux-x86_64/bin/cmake -H. -Bbuild -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH -DENABLE_COVERAGE=${{ env.CI_COVERAGE }}
cd build
make -j2
make install
mkdir -p ~/tamm_cache || true
rsync -av --exclude="*tamm*" ${INSTALL_PATH}/* ~/tamm_cache/.
- name: build tamm (backend = upcxx)
if: ${{ matrix.backend == 'upcxx' }}
id: build_tamm_upcxx
run: |
export INSTALL_PATH=$GITHUB_WORKSPACE/install
export PATH=$PATH:$GITHUB_WORKSPACE/install/bin
upcxx --version
export CPATH=$CPATH:/usr/lib/x86_64-linux-gnu/openmpi/include
export CPATH=$CPATH:$INSTALL_PATH/include/eigen3
echo "UPCXX_SHARED_HEAP_SIZE=MAX" >> $GITHUB_ENV
UPCXX_CODEMODE=O3 CXX=upcxx $GITHUB_WORKSPACE/cmake-3.22.6-linux-x86_64/bin/cmake -H. -Bbuild -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH -DUSE_UPCXX=ON -DJOB_LAUNCH_CMD="upcxx-run"
cd build
UPCXX_CODEMODE=O3 make -j2
UPCXX_CODEMODE=O3 make install
mkdir -p ~/tamm_cache || true
rsync -av --exclude="*tamm*" ${INSTALL_PATH}/* ~/tamm_cache/.
- name: ctest
run: |
cd $GITHUB_WORKSPACE/build
export PATH=$PATH:$GITHUB_WORKSPACE/install/bin
$GITHUB_WORKSPACE/cmake-3.22.6-linux-x86_64/bin/ctest -VV
- name: gcovr
if: ${{ matrix.backend == 'ga' && matrix.cc != 'clang-11' && matrix.cc != 'gcc-11' }}
run: |
cd $GITHUB_WORKSPACE/build
gcovr --root ./stage/$INSTALL_PATH . --xml ../coverage.xml
ls -al .
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml