Skip to content

Commit a4a5a18

Browse files
authored
Merge pull request #12 from AliceO2Group/fixes-fairrot-split
Fixes for the FairRoot's split
2 parents e22de7b + cf382b8 commit a4a5a18

File tree

4 files changed

+91
-9
lines changed

4 files changed

+91
-9
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,15 @@ include_directories(
6767
${Boost_INCLUDE_DIRS}
6868
${Monitoring_INCLUDE_DIRS}
6969
${FAIRROOT_INCLUDE_DIR}
70-
${FAIRROOT_INCLUDE_DIR}/fairmq
70+
${_fairmq_incdir}
71+
${_fairlogger_incdir}
7172
${ZeroMQ_INCLUDE_DIR}
7273
${Common_INCLUDE_DIRS}
7374
${Configuration_INCLUDE_DIRS}
7475
${InfoLogger_INCLUDE_DIRS}
7576
${ReadoutCard_INCLUDE_DIRS}
7677
${DataSampling_INCLUDE_DIRS}
77-
${Numa_INCLUDE_DIRS}
78+
${Numa_INCLUDE_DIRS}
7879
)
7980

8081
add_library(

cmake/FindFairMQInFairRoot.cmake

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# DEPRECATED: Remove this file, once we require FairMQ 1.2+
2+
#
3+
# Simple check for availability of FairMQ
4+
#
5+
# The FairMQ module of FairRoot might be disabled in the built of FairRoot
6+
# due to missing dependencies, e.g ZeroMQ and boost. Those dependencies
7+
# also have to be available in the required (minimal) version.
8+
#
9+
10+
if(FairRoot_DIR)
11+
set(FAIRROOTPATH ${FairRoot_DIR})
12+
else()
13+
set(FAIRROOTPATH $ENV{FAIRROOTPATH})
14+
endif(FairRoot_DIR)
15+
16+
if(FAIRROOTPATH)
17+
if(NOT FairMQInFairRoot_FIND_QUIETLY)
18+
MESSAGE(STATUS "FairRoot ... - found ${FAIRROOTPATH}")
19+
endif(NOT FairMQInFairRoot_FIND_QUIETLY)
20+
else()
21+
if(NOT FairMQInFairRoot_FIND_QUIETLY)
22+
MESSAGE(FATAL_ERROR "FairRoot installation not found")
23+
endif(NOT FairMQInFairRoot_FIND_QUIETLY)
24+
endif(FAIRROOTPATH)
25+
26+
set(FAIRMQ_REQUIRED_HEADERS FairMQDevice.h)
27+
if(NOT FairMQInFairRoot_FIND_QUIETLY)
28+
message(STATUS "Looking for FairMQ functionality in FairRoot ...")
29+
endif(NOT FairMQInFairRoot_FIND_QUIETLY)
30+
31+
find_path(FAIRMQ_INCLUDE_DIR NAMES ${FAIRMQ_REQUIRED_HEADERS}
32+
PATHS ${FAIRROOTPATH}/include/fairmq
33+
NO_DEFAULT_PATH
34+
)
35+
36+
# search once more in the system if not yet found
37+
find_path(FAIRMQ_INCLUDE_DIR NAMES ${FAIRMQ_REQUIRED_HEADERS}
38+
)
39+
40+
if(FAIRMQ_INCLUDE_DIR)
41+
if(NOT FairMQInFairRoot_FIND_QUIETLY)
42+
message(STATUS "Looking for FairMQ functionality in FairRoot: yes")
43+
endif(NOT FairMQInFairRoot_FIND_QUIETLY)
44+
set(FAIRMQ_FOUND TRUE)
45+
set(FairMQInFairRoot_FOUND TRUE)
46+
else(FAIRMQ_INCLUDE_DIR)
47+
if(FairMQInFairRoot_FIND_REQUIRED)
48+
message(FATAL_ERROR "FairRoot is not built with FairMQ support")
49+
else(FairMQInFairRoot_FIND_REQUIRED)
50+
if(NOT FairMQInFairRoot_FIND_QUIETLY)
51+
message(STATUS "Looking for FairMQ functionality in FairRoot: no")
52+
endif(NOT FairMQInFairRoot_FIND_QUIETLY)
53+
endif(FairMQInFairRoot_FIND_REQUIRED)
54+
endif(FAIRMQ_INCLUDE_DIR)

cmake/FindMonitoring.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ include(FindPackageHandleStandardArgs)
2121

2222
# find includes
2323
find_path(MONITORING_INCLUDE_DIR Monitoring.h
24-
HINTS ${Monitoring_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/Monitoring" "../../include/Monitoring" )
24+
HINTS ${Monitoring_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/Monitoring" "../../include/Monitoring" )
2525

2626
# Remove the final "Monitoring"
2727
get_filename_component(MONITORING_INCLUDE_DIR ${MONITORING_INCLUDE_DIR} DIRECTORY)
@@ -34,7 +34,7 @@ set(Monitoring_LIBRARIES ${MONITORING_LIBRARY})
3434
# handle the QUIETLY and REQUIRED arguments and set Monitoring_FOUND to TRUE
3535
# if all listed variables are TRUE
3636
find_package_handle_standard_args(Monitoring "Monitoring could not be found. Set Monitoring_ROOT as root installation directory."
37-
MONITORING_LIBRARY MONITORING_INCLUDE_DIR)
37+
MONITORING_LIBRARY MONITORING_INCLUDE_DIR)
3838
if(${Monitoring_FOUND})
3939
set(Monitoring_DEFINITIONS "")
4040
message(STATUS "Monitoring found : ${Monitoring_LIBRARIES}")

cmake/ReadoutDependencies.cmake

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
find_package(Boost COMPONENTS unit_test_framework program_options system REQUIRED)
1+
find_package(Boost COMPONENTS unit_test_framework program_options system thread system timer program_options random filesystem regex signals REQUIRED)
22
find_package(Git QUIET)
3-
find_package(FairRoot)
43
find_package(Monitoring REQUIRED)
54
find_package(Configuration REQUIRED)
65
find_package(Common REQUIRED)
@@ -10,17 +9,45 @@ find_package(DataSampling REQUIRED)
109
find_package(ZeroMQ REQUIRED)
1110
find_package(Numa)
1211

12+
find_package(FairRoot)
1313
if (FAIRROOT_FOUND)
14+
find_package(FairMQInFairRoot) # DEPRECATED: This looks for FairMQ embedded in old FairRoot versions,
15+
# before FairMQ and FairLogger have moved to separate repos.
16+
# Remove this line, once we require FairMQ 1.2+.
17+
if(NOT FairMQInFairRoot_FOUND) # DEPRECATED: Remove this condition, once we require FairMQ 1.2+
18+
find_package(FairMQ REQUIRED)
19+
find_package(FairLogger REQUIRED)
20+
endif()
1421
# this should go away when fairrot provides a proper Find script or proper config scripts
1522
# See : http://www.cmake.org/cmake/help/v3.0/command/link_directories.html
1623
link_directories(${FAIRROOT_LIBRARY_DIR})
17-
set(FAIRROOT_LIBRARIES Base FairMQ BaseMQ Logger)
1824
ADD_DEFINITIONS(-DWITH_FAIRMQ)
25+
get_target_property(_boost_incdir Boost::boost INTERFACE_INCLUDE_DIRECTORIES)
26+
27+
if(FairMQInFairRoot_FOUND)
28+
# DEPRECATED: Remove this case, once we require FairMQ 1.2+
29+
get_target_property(_fairmq_incdir FairRoot::FairMQ INTERFACE_INCLUDE_DIRECTORIES)
30+
o2_define_bucket(NAME fairmq_bucket
31+
DEPENDENCIES FairRoot::FairMQ
32+
INCLUDE_DIRECTORIES ${_boost_incdir} ${_fairmq_incdir}
33+
)
34+
else()
35+
get_target_property(_fairmq_incdir FairMQ::FairMQ INTERFACE_INCLUDE_DIRECTORIES)
36+
get_target_property(_fairlogger_incdir FairLogger::FairLogger INTERFACE_INCLUDE_DIRECTORIES)
37+
o2_define_bucket(NAME fairmq_bucket
38+
DEPENDENCIES FairMQ::FairMQ
39+
INCLUDE_DIRECTORIES ${_boost_incdir} ${_fairmq_incdir} ${_fairlogger_incdir}
40+
)
41+
#set(_fairlogger_incdir)
42+
endif()
1943
else (FAIRROOT_FOUND)
2044
message(WARNING "FairRoot not found, corresponding classes will not be compiled.")
45+
o2_define_bucket(NAME fairmq_bucket
46+
INCLUDE_DIRECTORIES ${_boost_incdir}
47+
)
2148
endif (FAIRROOT_FOUND)
2249

23-
if (Numa_FOUND)
50+
if (Numa_FOUND)
2451
ADD_DEFINITIONS(-DWITH_NUMA)
2552
else (Numa_FOUND)
2653
message(WARNING "Numa not found, corresponding features will be disabled.")
@@ -65,8 +92,8 @@ o2_define_bucket(
6592

6693
DEPENDENCIES
6794
o2_readout_bucket
68-
${FAIRROOT_LIBRARIES}
6995
${ROOT_LIBRARIES}
96+
fairmq_bucket
7097

7198
SYSTEMINCLUDE_DIRECTORIES
7299
${FAIRROOT_INCLUDE_DIR}

0 commit comments

Comments
 (0)