-
Notifications
You must be signed in to change notification settings - Fork 494
Expand file tree
/
Copy pathO2Dependencies.cmake
More file actions
267 lines (211 loc) · 8.72 KB
/
O2Dependencies.cmake
File metadata and controls
267 lines (211 loc) · 8.72 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
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
# This software is distributed under the terms of the GNU General Public
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
#
# 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.
include_guard()
include("${CMAKE_CURRENT_LIST_DIR}/O2TestsAdapter.cmake")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
# Required packages
#
# Order is not completely irrelevant. For instance arrow must come before
# FairRoot (see FindFairRoot.cmake)
#
# Generally speaking we should prefer the CONFIG variant of the find_package. We
# explicitely don't use the CONFIG variant (i.e. we do use the MODULE variant)
# only for some packages XXX where we define our own FindXXX.cmake module (e.g.
# to complement and/or fix what's done in the package's XXXConfig.cmake file)
include(FeatureSummary)
include(FindThreads)
find_package(Arrow CONFIG)
find_package(Gandiva CONFIG)
set_package_properties(Arrow PROPERTIES TYPE REQUIRED)
set_package_properties(Gandiva PROPERTIES TYPE REQUIRED)
if (NOT TARGET Arrow::arrow_shared)
add_library(Arrow::arrow_shared ALIAS arrow_shared)
endif()
if(NOT TARGET ArrowDataset::arrow_dataset_shared)
# ArrowDataset::arrow_dataset_shared is linked for no reason to parquet
# so we cannot use it because we do not want to build parquet itself.
# For that reason at the moment we need to do the lookup by hand.
get_target_property(ARROW_SHARED_LOCATION Arrow::arrow_shared LOCATION)
get_filename_component(ARROW_SHARED_DIR ${ARROW_SHARED_LOCATION} DIRECTORY)
find_library(ARROW_DATASET_SHARED arrow_dataset
PATHS ${ARROW_SHARED_DIR}
NO_DEFAULT_PATH
)
if(ARROW_DATASET_SHARED)
message(STATUS
"Found arrow_dataset_shared library at: ${ARROW_DATASET_SHARED}")
else()
message(FATAL_ERROR
"arrow_dataset_shared library not found in ${ARROW_SHARED_DIR}")
endif()
# Step 3: Create a target for ArrowDataset::arrow_dataset_shared
add_library(ArrowDataset::arrow_dataset_shared SHARED IMPORTED)
set_target_properties(ArrowDataset::arrow_dataset_shared PROPERTIES
IMPORTED_LOCATION ${ARROW_DATASET_SHARED}
)
endif()
if(NOT TARGET ArrowAcero::arrow_acero_shared)
# ArrowAcero::arrow_acero_shared is linked for no reason to parquet
# so we cannot use it because we do not want to build parquet itself.
# For that reason at the moment we need to do the lookup by hand.
get_target_property(ARROW_SHARED_LOCATION Arrow::arrow_shared LOCATION)
get_filename_component(ARROW_SHARED_DIR ${ARROW_SHARED_LOCATION} DIRECTORY)
find_library(ARROW_ACERO_SHARED arrow_acero
PATHS ${ARROW_SHARED_DIR}
NO_DEFAULT_PATH
)
if(ARROW_ACERO_SHARED)
message(STATUS
"Found arrow_acero_shared library at: ${ARROW_ACERO_SHARED}")
else()
message(FATAL_ERROR
"arrow_acero_shared library not found in ${ARROW_SHARED_DIR}")
endif()
# Step 3: Create a target for ArrowAcero::arrow_acero_shared
add_library(ArrowAcero::arrow_acero_shared SHARED IMPORTED)
set_target_properties(ArrowAcero::arrow_acero_shared PROPERTIES
IMPORTED_LOCATION ${ARROW_ACERO_SHARED}
)
endif()
if (NOT TARGET Gandiva::gandiva_shared)
add_library(Gandiva::gandiva_shared ALIAS gandiva_shared)
endif()
find_package(onnxruntime CONFIG)
set_package_properties(onnxruntime PROPERTIES TYPE REQUIRED)
find_package(Vc)
set_package_properties(Vc PROPERTIES TYPE REQUIRED)
find_package(ROOT 6.20.02)
set_package_properties(ROOT PROPERTIES TYPE REQUIRED)
find_package(VMC MODULE)
find_package(fmt)
set_package_properties(fmt PROPERTIES TYPE REQUIRED)
find_package(nlohmann_json)
set_package_properties(nlohmann_json PROPERTIES TYPE REQUIRED)
find_package(Boost 1.70
COMPONENTS container
thread
system
timer
program_options
random
filesystem
chrono
exception
regex
serialization
log
log_setup
unit_test_framework
date_time
iostreams)
set_package_properties(Boost PROPERTIES TYPE REQUIRED)
find_package(FairLogger CONFIG)
set_package_properties(FairLogger PROPERTIES TYPE REQUIRED)
find_package(FairRoot MODULE)
set_package_properties(FairRoot PROPERTIES TYPE REQUIRED)
find_package(Microsoft.GSL CONFIG)
set_package_properties(Microsoft.GSL
PROPERTIES
TYPE REQUIRED
PURPOSE "Mainly for its span")
find_package(FairMQ CONFIG)
set_package_properties(FairMQ PROPERTIES TYPE REQUIRED)
# find_package(protobuf CONFIG)
# set_package_properties(protobuf PROPERTIES TYPE REQUIRED PURPOSE "For CCDB API")
find_package(InfoLogger CONFIG NAMES InfoLogger libInfoLogger)
set_package_properties(InfoLogger PROPERTIES TYPE REQUIRED)
find_package(Configuration CONFIG)
set_package_properties(Configuration PROPERTIES TYPE REQUIRED)
find_package(Monitoring CONFIG)
set_package_properties(Monitoring PROPERTIES TYPE REQUIRED)
find_package(BookkeepingApi CONFIG)
set_package_properties(BookeepingApi PROPERTIES TYPE REQUIRED)
find_package(Common CONFIG)
set_package_properties(Common PROPERTIES TYPE REQUIRED)
find_package(RapidJSON MODULE)
set_package_properties(RapidJSON PROPERTIES TYPE REQUIRED)
find_package(CURL)
set_package_properties(CURL PROPERTIES TYPE REQUIRED)
find_package(TBB)
set_package_properties(TBB PROPERTIES TYPE REQUIRED)
# The Ifdef is to avoid merging at the same time alidist and AliceO2 PRs.
if (ALICE_GRID_UTILS_INCLUDE_DIR)
find_package(AliceGridUtils MODULE)
set_package_properties(AliceGridUtils PROPERTIES TYPE RECOMMENDED)
endif()
find_package(JAliEnROOT MODULE)
set_package_properties(JAliEnROOT PROPERTIES TYPE RECOMMENDED)
find_package(XRootD MODULE)
set_package_properties(XRootD PROPERTIES TYPE RECOMMENDED)
find_package(libjalienO2 MODULE)
set_package_properties(libjalienO2 PROPERTIES TYPE REQUIRED PURPOSE "For CCDB API")
# MC specific packages
message(STATUS "Input BUILD_SIMULATION=${BUILD_SIMULATION}")
include("${CMAKE_CURRENT_LIST_DIR}/O2SimulationDependencies.cmake")
message(STATUS "Output BUILD_SIMULATION=${BUILD_SIMULATION}")
# Optional packages
find_package(benchmark CONFIG NAMES benchmark googlebenchmark)
set_package_properties(benchmark PROPERTIES TYPE OPTIONAL)
find_package(OpenMP)
set_package_properties(OpenMP PROPERTIES TYPE OPTIONAL)
if (NOT OpenMP_CXX_FOUND AND CMAKE_SYSTEM_NAME MATCHES Darwin)
message(STATUS "MacOS OpenMP not found, attempting workaround")
find_package(OpenMPMacOS)
endif()
find_package(LibUV MODULE)
set_package_properties(LibUV PROPERTIES TYPE REQUIRED)
find_package(GLFW MODULE)
set_package_properties(GLFW PROPERTIES TYPE RECOMMENDED)
find_package(DebugGUI CONFIG)
set_package_properties(DebugGUI PROPERTIES TYPE RECOMMENDED)
find_package(AliRoot)
set_package_properties(AliRoot
PROPERTIES
TYPE OPTIONAL
PURPOSE "For very specific use cases only")
find_package(OpenGL)
set_package_properties(OpenGL PROPERTIES TYPE OPTIONAL)
find_package(LLVM)
set_package_properties(LLVM PROPERTIES TYPE OPTIONAL)
if(LLVM_FOUND)
find_package(Clang)
set_package_properties(Clang PROPERTIES TYPE OPTIONAL)
endif()
if(CMAKE_PROJECT_NAME STREQUAL "O2")
find_package(O2GPU)
endif()
find_package(FastJet)
find_package(FFTW3f CONFIG)
set_package_properties(FFTW3f PROPERTIES TYPE REQUIRED)
find_package(absl CONFIG)
set_package_properties(absl PROPERTIES TYPE REQUIRED)
find_package(Vtune)
set_package_properties(Vtune PROPERTIES TYPE OPTIONAL)
find_package(Eigen3 QUIET)
if(NOT TARGET Eigen3::Eigen)
# The Eigen3 install only provides the header files, so 'mock' the cmake target
add_library(Eigen3::Eigen INTERFACE IMPORTED)
set_target_properties(Eigen3::Eigen PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_ROOT}/include/eigen3"
)
endif()
find_package(GBL)
set_package_properties(GBL PROPERTIES TYPE REQUIRED)
if(GBL_FOUND AND NOT TARGET GBL::GBL)
# As of now, GBL does not provide a cmake target so create a compatibility wrapper
add_library(GBL::GBL INTERFACE IMPORTED)
target_include_directories(GBL::GBL INTERFACE ${GBL_INCLUDE_DIR})
target_link_libraries(GBL::GBL INTERFACE
${GBL_LIBRARIES}
Eigen3::Eigen
)
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)