forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
233 lines (208 loc) · 9.41 KB
/
Copy pathCMakeLists.txt
File metadata and controls
233 lines (208 loc) · 9.41 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
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
# verbatim in the file "COPYING".
#
# See http://alice-o2.web.cern.ch/license for full licensing information.
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization or
# submit itself to any jurisdiction.
# allsim is not a real library (i.e. not something that is built) but a
# convenient bag for all the deps needed in the executables below
add_library(allsim INTERFACE)
if(ENABLE_UPGRADES)
target_link_libraries(allsim
INTERFACE O2::SimConfig
O2::Steer
O2::SimSetup
FairMQ::FairMQ
O2::CPVSimulation
O2::DetectorsPassive
O2::EMCALSimulation
O2::FDDSimulation
O2::Field
O2::HMPIDSimulation
O2::ITSSimulation
O2::ITS3Simulation
O2::ITS4Simulation
O2::MCHBase
O2::MCHSimulation
O2::MFTSimulation
O2::MIDSimulation
O2::PHOSSimulation
O2::FT0Simulation
O2::TOFSimulation
O2::TPCSimulation
O2::TRDSimulation
O2::FV0Simulation
O2::ZDCSimulation
O2::Generators)
else()
target_link_libraries(allsim
INTERFACE O2::SimConfig
O2::Steer
O2::SimSetup
FairMQ::FairMQ
O2::CPVSimulation
O2::DetectorsPassive
O2::EMCALSimulation
O2::FDDSimulation
O2::Field
O2::HMPIDSimulation
O2::ITSSimulation
O2::MCHBase
O2::MCHSimulation
O2::MFTSimulation
O2::MIDSimulation
O2::PHOSSimulation
O2::FT0Simulation
O2::TOFSimulation
O2::TPCSimulation
O2::TRDSimulation
O2::FV0Simulation
O2::ZDCSimulation
O2::Generators)
endif()
add_library(internal::allsim ALIAS allsim)
o2_add_executable(device-runner
COMPONENT_NAME sim
SOURCES O2SimDeviceRunner.cxx
PUBLIC_LINK_LIBRARIES internal::allsim)
o2_add_executable(serial
COMPONENT_NAME sim
SOURCES o2sim.cxx
PUBLIC_LINK_LIBRARIES internal::allsim)
o2_add_executable(sim
SOURCES o2sim_parallel.cxx
PUBLIC_LINK_LIBRARIES internal::allsim O2::Framework)
o2_add_executable(primary-server-device-runner
COMPONENT_NAME sim
SOURCES O2PrimaryServerDeviceRunner.cxx
PUBLIC_LINK_LIBRARIES internal::allsim
TARGETVARNAME simexe)
if(NOT APPLE)
set_property(TARGET ${simexe} PROPERTY LINK_WHAT_YOU_USE ON)
endif()
o2_add_executable(hit-merger-runner
COMPONENT_NAME sim
SOURCES O2HitMergerRunner.cxx
PUBLIC_LINK_LIBRARIES internal::allsim)
o2_data_file(COPY o2simtopology.json DESTINATION config)
# * # add a complex simulation as a unit test (if simulation was enabled)
# perform
# * # some checks on kinematics and track references
o2_name_target(sim NAME o2simExecutable IS_EXE)
o2_name_target(sim-serial NAME o2simSerialExecutable IS_EXE)
o2_add_test_wrapper(NAME o2sim_G4
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DONT_FAIL_ON_TIMEOUT
MAX_ATTEMPTS 2
TIMEOUT 400
COMMAND $<TARGET_FILE:${o2simExecutable}>
COMMAND_LINE_ARGS -n
2
-j
2
-e
TGeant4
-o
o2simG4
LABELS "g4;sim;long")
set_tests_properties(o2sim_G4
PROPERTIES PASS_REGULAR_EXPRESSION
"SIMULATION RETURNED SUCCESFULLY" FIXTURES_SETUP
G4)
set_property(TEST o2sim_G4 APPEND PROPERTY ENVIRONMENT
ALICE_O2SIM_DUMPLOG=ON
O2_ROOT=${CMAKE_BINARY_DIR}/stage
VMCWORKDIR=${CMAKE_BINARY_DIR}/stage/share)
set_property(TEST o2sim_G4 APPEND PROPERTY ENVIRONMENT ${G4ENV})
# # note that the MT is currently only supported in the non FairMQ version
o2_add_test_wrapper(NAME o2sim_G4_mt
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DONT_FAIL_ON_TIMEOUT
MAX_ATTEMPTS 2
TIMEOUT 400
COMMAND $<TARGET_FILE:${o2simSerialExecutable}>
COMMAND_LINE_ARGS -n
1
-e
TGeant4
--isMT
on
-o
o2simG4MT
LABELS "g4;sim;long")
set_tests_properties(o2sim_G4_mt
PROPERTIES PASS_REGULAR_EXPRESSION
"Macro finished succesfully")
set_property(TEST o2sim_G4_mt APPEND PROPERTY ENVIRONMENT
O2_ROOT=${CMAKE_BINARY_DIR}/stage
VMCWORKDIR=${CMAKE_BINARY_DIR}/stage/share)
set_property(TEST o2sim_G4_mt APPEND PROPERTY ENVIRONMENT ${G4ENV})
o2_add_test(CheckStackG4
SOURCES checkStack.cxx
NAME o2sim_checksimkinematics_G4
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND_LINE_ARGS o2simG4
PUBLIC_LINK_LIBRARIES O2::SimulationDataFormat
NO_BOOST_TEST
LABELS "g4;sim;long")
set_tests_properties(o2sim_checksimkinematics_G4
PROPERTIES FIXTURES_REQUIRED G4)
o2_add_test_wrapper(NAME o2sim_G3
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DONT_FAIL_ON_TIMEOUT
MAX_ATTEMPTS 3
COMMAND $<TARGET_FILE:${o2simExecutable}>
COMMAND_LINE_ARGS -n
2
-j
2
-e
TGeant3
-o
o2simG3
LABELS g3 sim long
ENVIRONMENT "O2_ROOT=${CMAKE_BINARY_DIR}/stage;VMCWORKDIR=${CMAKE_BINARY_DIR}/stage/share")
# set properties for G3 ... we use fixtures to force execution after G4 (since
# they require multiple CPUs)
set_tests_properties(o2sim_G3
PROPERTIES PASS_REGULAR_EXPRESSION
"SIMULATION RETURNED SUCCESFULLY"
FIXTURES_REQUIRED
G4
FIXTURES_SETUP
G3)
set_property(TEST o2sim_G3 APPEND PROPERTY ENVIRONMENT "ALICE_O2SIM_DUMPLOG=ON")
o2_add_test(CheckStackG3
SOURCES checkStack.cxx
NAME o2sim_checksimkinematics_G3
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND_LINE_ARGS o2simG3
PUBLIC_LINK_LIBRARIES O2::SimulationDataFormat
NO_BOOST_TEST
LABELS "g3;sim;long")
set_tests_properties(o2sim_checksimkinematics_G3
PROPERTIES FIXTURES_REQUIRED G3)
o2_add_test_wrapper(NAME o2sim_hepmc
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DONT_FAIL_ON_TIMEOUT
MAX_ATTEMPTS 2
TIMEOUT 400
COMMAND $<TARGET_FILE:${o2simExecutable}>
COMMAND_LINE_ARGS -n
2
-j
2
-g
hepmc
--HepMCFile
${CMAKE_SOURCE_DIR}/Generators/share/data/pythia.hepmc
-o
o2simhepmc
LABELS long sim hepmc3
ENVIRONMENT "O2_ROOT=${CMAKE_BINARY_DIR}/stage;VMCWORKDIR=${CMAKE_BINARY_DIR}/stage/share")
set_tests_properties(o2sim_hepmc
PROPERTIES PASS_REGULAR_EXPRESSION
"SIMULATION RETURNED SUCCESFULLY")