forked from OpenGATE/Gate
-
Notifications
You must be signed in to change notification settings - Fork 0
295 lines (283 loc) · 10.8 KB
/
Copy pathmain.yml
File metadata and controls
295 lines (283 loc) · 10.8 KB
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
name: CI
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
schedule:
- cron: '0 0 * * 0,3'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
options: [none, rtk, torch, optic]
exclude:
- os: macos-latest
options: torch
env:
ROOT_VERSION: 'v6-38-00'
ITK_VERSION: 'v5.4.2'
GEANT4_VERSION: 'v11.4.0'
ROOT_DIR: $(HOME)/software/root
GEANT4_DIR: $(HOME)/software/geant4
steps:
- name: Checkout github repo
uses: actions/checkout@v3
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Cache
id: cache_gate_dependencies
uses: actions/cache@v3
with:
path: ~/software
key: ${{ matrix.os }}-geant4-${{ env.GEANT4_VERSION }}-root-${{ env.ROOT_VERSION }}-qt6-root3800
restore-keys: ${{ matrix.os }}-geant4-${{ env.GEANT4_VERSION }}-root-${{ env.ROOT_VERSION }}-qt6-root3800
- name: Install dependencies
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
sudo apt-get update -qq
sudo apt-get install -y gcc \
g++ \
make \
binutils \
libx11-dev \
libtbb-dev \
libxpm-dev \
libxft-dev \
libxext-dev \
qt6-base-dev \
qt6-base-dev-tools \
qt6-tools-dev \
qt6-tools-dev-tools \
git \
cmake \
libssl-dev \
python3.8-dev \
ccache \
libfftw3-dev
gcc -v
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
brew update || true
brew install python@3.12 || true
brew link --overwrite --force python@3.12
export Python3_EXECUTABLE="$(brew --prefix python@3.12)/bin/python3"
brew install --force --verbose --overwrite --debug cmake \
qt \
ccache \
tbb \
xrootd \
fftw
brew cleanup
#LLVM_PREFIX="$(brew --prefix llvm || true)"
#export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
cmake --version
which cmake
fi
cd $HOME/
mkdir -p software option_dependencies
cmake --version
- name: Install root
run: |
if [ "${{ steps.cache_gate_dependencies.outputs.cache-hit }}" != 'true' ] && [ "${{ matrix.options }}" == 'none' ]; then
cd $HOME/software
mkdir root
cd root
mkdir src bin install
git clone --branch $ROOT_VERSION https://github.com/root-project/root.git --depth 1 src
cd bin
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
cmake ../src -DCMAKE_CXX_STANDARD=17 \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_INSTALL_PREFIX=$HOME/software/root/install
make install -j 4
cd ..
rm -rf bin src
fi
- name: Install Geant4
run: |
if [ "${{ steps.cache_gate_dependencies.outputs.cache-hit }}" != 'true' ] && [ "${{ matrix.options }}" == 'none' ]; then
cd $HOME/software
mkdir geant4
cd geant4
mkdir src bin install data
git clone --branch $GEANT4_VERSION https://github.com/Geant4/geant4.git --depth 1 src
cd bin
cmake -DGEANT4_INSTALL_DATA=ON \
-DGEANT4_BUILD_MULTITHREADED=OFF \
-DGEANT4_USE_QT=ON \
-DGEANT4_INSTALL_DATADIR=$HOME/software/geant4/data \
-DCMAKE_INSTALL_PREFIX=$HOME/software/geant4/install \
-DQt6_DIR="$Qt6_DIR" \
../src
make -j4 install
cd ..
rm -rf src bin
fi
- name: Install option dependencies
run: |
if [ "${{ steps.cache_gate_dependencies.outputs.cache-hit }}" == 'true' ]; then
cd $HOME/option_dependencies
if [ "${{ matrix.options }}" == 'torch' ]; then
if [ "${{ matrix.os }}" == 'ubuntu-latest' ]; then
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.10.1%2Bcpu.zip
unzip libtorch-cxx11-abi-shared-with-deps-1.10.1+cpu.zip
elif [ "${{ matrix.os }}" == 'macos-latest' ]; then
wget https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.2.0.zip
unzip libtorch-macos-arm64-2.2.0.zip
fi
fi
if [ "${{ matrix.options }}" == 'rtk' ]; then
mkdir rtk
cd rtk
mkdir src bin
git clone --branch $ITK_VERSION https://github.com/InsightSoftwareConsortium/ITK.git --depth 1 src
cd bin
cmake -DCMAKE_CXX_FLAGS="-std=c++17" -DBUILD_TESTING=OFF -DITK_USE_FFTWD=ON -DITK_USE_FFTWF=ON -DITK_USE_SYSTEM_FFTW:BOOL=ON -DITK_MINIMUM_COMPLIANCE_LEVEL=3 -DModule_RTK=ON -DREMOTE_GIT_TAG_RTK=master ../src
make -j4
fi
cd $HOME/option_dependencies
ls
else
if [ "${{ matrix.options }}" != 'none' ]; then
echo "Create the cache first and run the job again"
exit 1
fi
fi
- name: Configure Gate
run: |
if [ "${{ steps.cache_gate_dependencies.outputs.cache-hit }}" == 'true' ]; then
cd $HOME
export ROOTSYS=$HOME/software/root/install
export PATH=${ROOTSYS}:${PATH}
source $HOME/software/root/install/bin/thisroot.sh
source $HOME/software/geant4/install/bin/geant4.sh
mkdir build
cd build
which cmake
cmake --version
export GATE_USE_TORCH=OFF
export GATE_USE_RTK=OFF
export GATE_USE_OPTICAL=OFF
if [ "${{ matrix.options }}" == 'torch' ]; then
export GATE_USE_TORCH=ON
fi
if [ "${{ matrix.options }}" == 'rtk' ]; then
export GATE_USE_RTK=ON
fi
if [ "${{ matrix.options }}" == 'optic' ]; then
export GATE_USE_OPTIC=ON
fi
cmake -DGATE_USE_TORCH=$GATE_USE_TORCH \
-DTorch_DIR=$HOME/option_dependencies/libtorch/share/cmake/Torch \
-DGATE_COMPILE_GATEDIGIT=ON \
-DGATE_USE_RTK=$GATE_USE_RTK \
-DITK_DIR=$HOME/option_dependencies/rtk/bin/ \
-DGATE_USE_OPTICAL=$GATE_USE_OPTICAL \
-DBUILD_TESTING=ON \
$GITHUB_WORKSPACE
fi
- name: Build Gate
run: |
if [ "${{ steps.cache_gate_dependencies.outputs.cache-hit }}" == 'true' ]; then
cd $HOME/build
export ROOTSYS=$HOME/software/root/install
export PATH=${ROOTSYS}:${PATH}
source $HOME/software/root/install/bin/thisroot.sh
source $HOME/software/geant4/install/bin/geant4.sh
make -j4
if [ ! $? -eq 0 ]; then
exit 1
fi
fi
# ssh_session:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout github repo
# uses: actions/checkout@v3
# with:
# lfs: true
# - name: Checkout LFS objects
# run: git lfs checkout
# - name: Start SSH session
# uses: luchihoratiu/debug-via-ssh@main
# with:
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
# SSH_PASS: ${{ secrets.SSH_PASS }}
benchmarks:
runs-on: ubuntu-latest
needs: [build]
strategy:
fail-fast: false
matrix:
strategy_name: [t1_edep_profiles,
t2_edep_vox,
t3_range_e+,
t4_necr,
t6_dpk,
t8_LETActor,
t10_SpectroGamma,
t11_EMField,
t12_tessellated_volume,
t13_phsp,
t15_optical,
t16_decay,
t17_extended_source,
t18_movement_benchmark,
t19_acollinearity,
t20_digi_adder,
t22_merged_actor,
t23_digi_readout,
t26_CoinSorter,
t27_Hits_2SD,
t28_Singles_2SD,
t29_optical_digi,
t30_dna,
t31_vpgTLE-tt,
t33_invert_filter,
t34_biodose_actor]
steps:
- name: Checkout github repo
uses: actions/checkout@v3
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y gcc \
g++ \
make \
binutils \
libx11-dev \
libxpm-dev \
libxft-dev \
libxext-dev \
qtbase5-dev \
qt5-qmake \
git \
cmake \
libssl-dev \
python3.8-dev \
ccache
gcc -v
cd
- name: Run the test in docker
run: |
mkdir gate_benchmarks
export GIT_SSL_NO_VERIFY=1
git clone --recursive https://github.com/OpenGATE/GateBenchmarks.git gate_benchmarks
docker run --rm -e "TEST=${{ matrix.strategy_name }}" -v $GITHUB_WORKSPACE:/src -v $GITHUB_WORKSPACE/gate_benchmarks:/home tbaudier/gatebenchmarks:9.4.1 /home/.github/workflows/runTest.sh