-
-
Notifications
You must be signed in to change notification settings - Fork 10
207 lines (206 loc) · 8.02 KB
/
dev-all.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
name: Develop
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
jobs:
ubuntu-dev:
runs-on: ubuntu-22.04
timeout-minutes: 60
strategy:
matrix:
build: [ RelWithDebInfo, Debug ]
compiler: [ { c: gcc, cpp: g++, fortran: gfortran }, { c: icx, cpp: icpx, fortran: ifx } ]
avx: [ ON, OFF ]
vtk: [ ON, OFF ]
mkl: [ ON, OFF ]
steps:
- name: Clone
uses: actions/checkout@v4
- name: Golang
uses: actions/setup-go@v4
- name: VTK
run: |
if [ "${{ matrix.vtk }}" == "ON" ]; then
wget -q https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.6-linux.tar.gz
tar xf VTK-9.2.6-linux.tar.gz
fi
- name: MKL
run: |
if [ "${{ matrix.mkl }}" == "ON" ] || [ "${{ matrix.compiler.c }}" == "icx" ]; then
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
fi
if [ "${{ matrix.mkl }}" == "ON" ]; then
sudo apt-get update && sudo apt-get install intel-oneapi-mkl-devel
fi
if [ "${{ matrix.compiler.c }}" == "icx" ]; then
sudo apt-get update && sudo apt-get install intel-oneapi-compiler-dpcpp-cpp intel-oneapi-compiler-fortran
echo "IOMP=ON" >> "$GITHUB_ENV"
else
echo "IOMP=OFF" >> "$GITHUB_ENV"
fi
- name: Dependency
run: |
sudo apt-get update && sudo apt-get install mesa-common-dev mesa-utils freeglut3-dev libglvnd-dev dpkg-dev xz-utils
echo "COVERAGE=OFF" >> "$GITHUB_ENV"
- name: Flag
if: |
matrix.build == 'Debug' &&
matrix.compiler.c == 'gcc' &&
matrix.avx == 'OFF' &&
matrix.vtk == 'OFF'
run: |
echo "COVERAGE=ON" >> "$GITHUB_ENV"
- name: Compile
run: |
if [ "${{ matrix.compiler.c }}" == "icx" ]; then
source /opt/intel/oneapi/setvars.sh
fi
go build Checker/updater.go
mkdir build && cd build
cmake -DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} -DCMAKE_Fortran_COMPILER=${{ matrix.compiler.fortran }} -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DTEST_COVERAGE=${{ env.COVERAGE }} -DUSE_AVX=${{ matrix.avx }} -DBUILD_MULTITHREAD=ON -DUSE_HDF5=ON -DUSE_EXTERNAL_VTK=${{ matrix.vtk }} -DVTK_DIR=/home/runner/work/suanPan/suanPan/lib/cmake/vtk-9.2/ -DUSE_MKL=${{ matrix.mkl }} -DMKLROOT=/opt/intel/oneapi/mkl/latest/ -DLINK_DYNAMIC_MKL=OFF -DUSE_INTEL_OPENMP=${{ env.IOMP }} -DCMAKE_INSTALL_PREFIX=suanPan-linux ..
make install -j"$(nproc)" && make package
- name: Pack
run: |
cp updater build/suanPan-linux/bin
cd build
file_name="suanPan-linux"
if [ "${{ matrix.build }}" == "Debug" ]; then
file_name+="-debug"
else
file_name+="-release"
fi
if [ "${{ matrix.compiler.c }}" == "gcc" ]; then
file_name+="-gcc"
else
file_name+="-intel"
fi
if [ "${{ matrix.avx }}" == "ON" ]; then
file_name+="-avx"
else
file_name+="-no-avx"
fi
if [ "${{ matrix.vtk }}" == "ON" ]; then
file_name+="-vtk"
else
file_name+="-no-vtk"
fi
if [ "${{ matrix.mkl }}" == "ON" ]; then
file_name+="-mkl"
else
file_name+="-openblas"
fi
file_name+=".tar.gz"
echo "ARTIFACT=$file_name" >> "$GITHUB_ENV"
tar czf $file_name -C suanPan-linux .
- name: Upload
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT }}
path: build/${{ env.ARTIFACT }}
- name: Test
run: |
export LD_LIBRARY_PATH=/home/runner/work/suanPan/suanPan/build/suanPan-linux/lib
./build/suanPan-linux/bin/suanPan -v
- name: Coverage
if: env.COVERAGE == 'ON'
run: |
export LD_LIBRARY_PATH=/home/runner/work/suanPan/suanPan/build/suanPan-linux/lib
cd build
bash ../Script/Coverage.sh .
for SRC in `find . | egrep '\.o'`; do gcov -n $SRC > /dev/null; done
- name: Report
if: env.COVERAGE == 'ON'
uses: codecov/codecov-action@v3
with:
gcov: true
macos-dev:
runs-on: macos-11
timeout-minutes: 100
strategy:
matrix:
build: [ Debug ]
compiler: [ GCC, CLANG ]
vtk: [ ON, OFF ]
steps:
- name: Clone
uses: actions/checkout@v4
- name: Golang
uses: actions/setup-go@v4
- name: VTK
run: |
if [ "${{ matrix.vtk }}" == "ON" ]; then
wget -q https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.6-macos.tar.gz
tar xf VTK-9.2.6-macos.tar.gz
brew install glfw glew
fi
- name: Compile
run: |
go build Checker/updater.go
mkdir build && cd build
if [ "${{ matrix.compiler }}" == "CLANG" ]; then
export CC=$(brew --prefix llvm@15)/bin/clang
export CXX=$(brew --prefix llvm@15)/bin/clang++
export FC=gfortran-11
cmake -DCMAKE_C_STANDARD_INCLUDE_DIRECTORIES=$(brew --prefix libomp)/include -DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=$(brew --prefix libomp)/include -DCMAKE_Fortran_STANDARD_INCLUDE_DIRECTORIES=$(brew --prefix libomp)/include -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DUSE_EXTERNAL_VTK=${{ matrix.vtk }} -DVTK_DIR=/Users/runner/work/suanPan/suanPan/lib/cmake/vtk-9.2/ -DCMAKE_INSTALL_PREFIX=suanPan-macos ..
else
export CC=gcc-11
export CXX=g++-11
export FC=gfortran-11
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DUSE_EXTERNAL_VTK=${{ matrix.vtk }} -DVTK_DIR=/Users/runner/work/suanPan/suanPan/lib/cmake/vtk-9.2/ -DCMAKE_INSTALL_PREFIX=suanPan-macos ..
fi
make install -j4
- name: Test
run: |
export DYLD_LIBRARY_PATH=/Users/runner/work/suanPan/suanPan/suanPan-macos/lib/
./suanPan-macos/bin/suanPan -v
windows-dev:
runs-on: windows-2022
timeout-minutes: 100
strategy:
matrix:
build: [ Debug ]
vtk: [ ON, OFF ]
avx: [ ON, OFF ]
steps:
- name: Clone
uses: actions/checkout@v4
- name: Golang
uses: actions/setup-go@v4
- name: Install VTK
run: |
C:/msys64/usr/bin/wget.exe -q https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.6-win.7z
7z x VTK-9.2.6-win.7z
- name: Compile
run: |
go build Checker/updater.go
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build}} -DUSE_AVX=${{ matrix.avx }} -DBUILD_MULTITHREAD=ON -DUSE_EXTERNAL_VTK=${{ matrix.vtk }} -DVTK_DIR=D:/a/suanPan/suanPan/lib/cmake/vtk-9.2/ -DCMAKE_INSTALL_PREFIX=suanPan-win ..
cmake --build . --target INSTALL -j 4
- name: Pack
shell: bash
run: |
cp updater.exe build/suanPan-win/bin
cd build/suanPan-win/bin
file_name="suanPan-win-openblas"
if [ "${{ matrix.avx }}" == "ON" ]; then
file_name+="-avx"
else
file_name+="-no-avx"
fi
if [ "${{ matrix.vtk }}" == "ON" ]; then
file_name+="-vtk"
else
file_name+="-no-vtk"
fi
file_name+=".7z"
echo "ARTIFACT=$file_name" >> "$GITHUB_ENV"
7z a ../../../$file_name ./*
./suanPan.exe -v
- name: Upload
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT }}
path: ${{ env.ARTIFACT }}