CMakeLists.txt 7.62 KB
Newer Older
1
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
dino's avatar
dino committed
2 3 4

PROJECT(femul)

5
################################################################
6
# Type of build
7
set( CMAKE_BUILD_TYPE "Release" )
dino's avatar
dino committed
8
#set( CMAKE_BUILD_TYPE "Debug" )
dino's avatar
dino committed
9

10
################################################################
11
# Where FIND_PACKAGE should search "non-distribution" FindXxxx.cmake
12 13 14 15 16 17 18 19 20
set( CMAKE_MODULE_PATH  "." )

################################################################
# Set the off-line version of the actors (no NRV_ONLINE for femul)
ADD_DEFINITIONS( -DNRV_TYPE=NRV_OFFLINE )

################################################################
# Select the threads library as THR_NONE, THR_BOOST or THR_STD
if( 1 )                     # 0 to select from command line ( e.g. cmake . -DTHR_TYPE=THR_STD )
dino's avatar
dino committed
21
  set( THR_TYPE THR_BOOST )   # default 
22 23 24 25 26 27
endif()

if( NOT DEFINED THR_TYPE )  # in case default not set and nothing given from command line
  set( THR_TYPE THR_NONE )
endif()

dino's avatar
dino committed
28 29
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")

30 31 32 33 34 35 36 37 38 39 40
if( THR_TYPE STREQUAL THR_NONE)
  message( "Not Using threads ==> ${THR_TYPE}" )
elseif(THR_TYPE STREQUAL THR_BOOST)
  message( "Using boost::thread ==> ${THR_TYPE}" )
  FIND_PACKAGE(Boost)
  MESSAGE("Boost Dirs: ${Boost_INCLUDE_DIR} ${Boost_LIBRARY_DIRS}")
  SET(BOOST_LIBRARIES "-L${Boost_LIBRARY_DIRS} -lboost_system -lboost_thread") 
  MESSAGE("Boost Libs: ${BOOST_LIBRARIES}")
elseif(THR_TYPE STREQUAL THR_STD)
  message("Using std::thread ==> ${THR_TYPE}" )
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")          # should check if compiler supports
dino's avatar
dino committed
41
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") 
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
  if( 0 ) 
    # these 3 lines needed if building on anodes at ganil using THR_STD 
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++") # because after updating to gcc 4.7.4 they have not updated libstdc
    ADD_DEFINITIONS( -D_GLIBCXX_USE_NANOSLEEP )                 # not needed in my Ubuntu 14.04 LTS whith gcc 4.8.2
    ADD_DEFINITIONS( -D_GLIBCXX_USE_SCHED_YIELD )               # not needed in my Ubuntu 14.04 LTS whith gcc 4.8.2
  endif()
else()
  set( THR_TYPE THR_NONE )
  message( "Not Using threads ==> ${THR_TYPE}" )
endif()

ADD_DEFINITIONS( -DTHR_TYPE=${THR_TYPE} )

#####################################################
# For the vectorized version of the PSA FOM-loop
if( 1 )     # 0 to disable
  ADD_DEFINITIONS(-DUSE_SSE_VERSION)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4")
endif()
dino's avatar
dino committed
61

62
################################################################
63
# Enable root
64 65 66 67 68 69
if( 1 )     # 0 to disable
  ADD_DEFINITIONS(-DTRF_ROOTTREE)
  FIND_PACKAGE(ROOT)
  MESSAGE("Root Dirs: ${ROOT_INCLUDE_DIR}  ${ROOT_LIBRARY_DIR}")
  MESSAGE("Root Libs: ${ROOT_LIBRARIES}")
endif()
dino's avatar
dino committed
70

71 72
###################################
###################################
73 74

# The sources to build femul
75
SET(AGADIR "../..")
76 77
SET(AGAPRO "..")

78
SET(ADFDIR "${AGADIR}/agaprodep/adf")
79 80 81
SET(ACTORS "${AGAPRO}")
SET(PRISMA "${AGAPRO}/PRISMA/src/lib_prisma")
SET(FEMDIR "${AGAPRO}/WinCtest")
dino's avatar
 
dino committed
82

dino's avatar
dino committed
83
INCLUDE_DIRECTORIES(
84
${FEMDIR}
dino's avatar
dino committed
85 86 87
${ACTORS}/common
${ACTORS}/producers/Crystal      ${ACTORS}/producers/Crystal/includeATCA
${ACTORS}/producers/AncillaryTCP
88
${ACTORS}/filters/Preprocessing  ${ACTORS}/filters/Preprocessing/includePreprocessing
dino's avatar
dino committed
89 90
${ACTORS}/filters/Ancillary      ${ACTORS}/filters/Ancillary/includeVME
${ACTORS}/filters/PSA            ${ACTORS}/filters/PSA/includePSA
91 92
${ACTORS}/filters/PostPSA
${ACTORS}/filters/Global
dino's avatar
dino committed
93 94
${ACTORS}/filters/Tracking       ${ACTORS}/filters/Tracking/includeOFT  ${ACTORS}/filters/Tracking/includeMGT
${ACTORS}/builders
95
${AGADIR}/include
dino's avatar
dino committed
96
${PRISMA}/include
97 98
${Boost_INCLUDE_DIR}
${ROOT_INCLUDE_DIR}
99
##/usr/include/skstream-0.3  /usr/lib/skstream-0.3/include  # only for NRV_TYPE=NRV_ONLINE which we don't use in femu;
dino's avatar
dino committed
100 101 102
)

SET(actors_SRCS
dino's avatar
dino committed
103 104
${ACTORS}/common/CycleServer.cpp
${ACTORS}/common/Misc.cpp
dino's avatar
dino committed
105
${ACTORS}/common/mwdlib.cpp
106
${ACTORS}/common/adetParams.cpp
107
${ACTORS}/common/TstampFilter.cpp
108 109
${ACTORS}/common/TextReader.cpp
${ACTORS}/common/ConfReader.cpp
110
${ACTORS}/common/GaspBuffer.cpp
111
${ACTORS}/common/MixFFT.cpp
dino's avatar
dino committed
112 113 114 115 116 117 118 119 120 121 122 123 124 125
${ACTORS}/producers/Crystal/CrystalProducer.cpp
${ACTORS}/producers/Crystal/CrystalProducerATCA.cpp
${ACTORS}/producers/Crystal/includeATCA/mezzanine.cpp
${ACTORS}/producers/Crystal/includeATCA/fileATCA.cpp
${ACTORS}/producers/AncillaryTCP/AncillaryProducerTCP.cpp
${ACTORS}/filters/Preprocessing/PreprocessingFilter.cpp
${ACTORS}/filters/Preprocessing/PreprocessingFilterPSA.cpp
${ACTORS}/filters/Ancillary/AncillaryFilter.cpp
${ACTORS}/filters/Ancillary/AncillaryFilterVME.cpp
${ACTORS}/filters/Ancillary/AncillaryFilterATCA.cpp 
${ACTORS}/filters/Ancillary/includeVME/Converter.cpp
${ACTORS}/filters/PSA/PSAFilter.cpp
${ACTORS}/filters/PSA/PSAFilterGridSearch.cpp
${ACTORS}/filters/PSA/includePSA/SignalBasis.cpp
126 127
${ACTORS}/filters/PostPSA/PostPSAFilter.cpp
${ACTORS}/filters/Global/GlobalFilter.cpp
dino's avatar
dino committed
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
${ACTORS}/filters/Tracking/TrackingFilter.cpp
${ACTORS}/filters/Tracking/TrackingFilterOFT.cpp
${ACTORS}/filters/Tracking/TrackingFilterMGT.cpp
${ACTORS}/filters/Tracking/includeOFT/tracking_cluster.c
${ACTORS}/filters/Tracking/includeOFT/tracking_data_manip.c
${ACTORS}/filters/Tracking/includeOFT/tracking_events.c
${ACTORS}/filters/Tracking/includeOFT/tracking_physics.c
${ACTORS}/filters/Tracking/includeOFT/tracking_utilitaires.c
${ACTORS}/filters/Tracking/includeMGT/mgt.c
${ACTORS}/filters/Tracking/includeMGT/mgt_eclust.c
${ACTORS}/filters/Tracking/includeMGT/mgt_etrack.c
${ACTORS}/filters/Tracking/includeMGT/mgt_event.c
${ACTORS}/filters/Tracking/includeMGT/mgt_geoagata.c
${ACTORS}/filters/Tracking/includeMGT/mgt_vectorlib.c
${ACTORS}/builders/EventBuilder.cpp
143
${ACTORS}/builders/EventQueue.cpp
dino's avatar
dino committed
144
)
145
SET_SOURCE_FILES_PROPERTIES(${actors_SRCS} PROPERTIES LANGUAGE CXX)
dino's avatar
dino committed
146 147

SET(adf_SRCS
148
${ADFDIR}/ADFCentralLog.cpp
dino's avatar
dino committed
149
${ADFDIR}/ADFConfig.cpp
150 151
${ADFDIR}/ADFLogCollector.cpp
${ADFDIR}/ADFLogMessage.cpp
dino's avatar
dino committed
152 153 154 155 156 157 158 159 160 161 162 163
${ADFDIR}/AgataConfigurationFrame.cpp
${ADFDIR}/AgataFrameFactory.cpp
${ADFDIR}/AgataKeyFactory.cpp
${ADFDIR}/AgataRawFrame.cpp
${ADFDIR}/BaseBuffer.cpp
${ADFDIR}/BufferIO.cpp
${ADFDIR}/CompositeFrame.cpp
${ADFDIR}/ConfAgent.cpp
${ADFDIR}/ConfigurationFrame.cpp
${ADFDIR}/Counter.cpp
${ADFDIR}/CrystalFrame.cpp
${ADFDIR}/DataHandling.cpp
164
${ADFDIR}/DefaultFrameFactory.cpp
dino's avatar
dino committed
165
${ADFDIR}/DefaultKeyFactory.cpp
166 167
${ADFDIR}/DFAgent.cpp
${ADFDIR}/DotConf.cpp
dino's avatar
dino committed
168 169 170 171 172 173 174 175 176 177 178
${ADFDIR}/FactoryItem.cpp
${ADFDIR}/Frame.cpp
${ADFDIR}/FrameBlock.cpp
${ADFDIR}/FrameFactory.cpp
${ADFDIR}/FrameIO.cpp
${ADFDIR}/GObject.cpp
${ADFDIR}/Hits.cpp
${ADFDIR}/Key.cpp
${ADFDIR}/KeyFactory.cpp
${ADFDIR}/MetaFrame.cpp
${ADFDIR}/NarvalInterface.cpp
179
${ADFDIR}/RunAgent.cpp
dino's avatar
dino committed
180 181 182 183
${ADFDIR}/Signals.cpp
${ADFDIR}/Trigger.cpp
${ADFDIR}/Version.cpp
${ADFDIR}/BasicAFC.cpp
184
${ADFDIR}/BasicAFP.cpp
dino's avatar
dino committed
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
)

SET(PRISMA_SRCS
${PRISMA}/src/prismaManager.cc
${PRISMA}/src/banGate.cc
${PRISMA}/src/banManager.cc
${PRISMA}/src/calCoef.cc
${PRISMA}/src/calManager.cc
${PRISMA}/src/CGaspBuffer.cc
${PRISMA}/src/ConfigurationFile.cc
${PRISMA}/src/detData.cc 
${PRISMA}/src/fastSolver.cc
${PRISMA}/src/fullEvent.cc
${PRISMA}/src/massCalculator.cc
${PRISMA}/src/prismaIonCh.cc
${PRISMA}/src/prismaMcp.cc
${PRISMA}/src/prismaPPAC.cc
${PRISMA}/src/prismaSide.cc
${PRISMA}/src/RandomGenerator.cc
${PRISMA}/src/Vectors.cc
${PRISMA}/src/zedCalculator.cc
)

208
SET(femul_SRCS  ${FEMDIR}/femul.cpp ${FEMDIR}/ChainOfActors.cpp ${adf_SRCS}  ${actors_SRCS}  ${PRISMA_SRCS} )
209

210
###############################################
211

dino's avatar
dino committed
212
SET(LINK_LIBRARIES ${BOOST_LIBRARIES} ${ROOT_LIBRARIES})
213 214 215 216 217
#MESSAGE("LINK_LIBRARIES: ${LINK_LIBRARIES}")

ADD_EXECUTABLE(femul ${femul_SRCS})

TARGET_LINK_LIBRARIES(femul ${LINK_LIBRARIES})