CMakeLists.txt 7.52 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

9
################################################################
10
# Where FIND_PACKAGE should search "non-distribution" FindXxxx.cmake
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
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 )
  set( THR_TYPE THR_STD )   # default 
endif()

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

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
  SET(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -std=c++11") 
  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
58

59
################################################################
60
# Enable root
61 62 63 64 65 66
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
67

68 69
###################################
###################################
70 71

# The sources to build femul
72
SET(AGADIR "../..")
73 74
SET(AGAPRO "..")

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

dino's avatar
dino committed
80
INCLUDE_DIRECTORIES(
81
${FEMDIR}
dino's avatar
dino committed
82 83 84
${ACTORS}/common
${ACTORS}/producers/Crystal      ${ACTORS}/producers/Crystal/includeATCA
${ACTORS}/producers/AncillaryTCP
85
${ACTORS}/filters/Preprocessing  ${ACTORS}/filters/Preprocessing/includePreprocessing
dino's avatar
dino committed
86 87
${ACTORS}/filters/Ancillary      ${ACTORS}/filters/Ancillary/includeVME
${ACTORS}/filters/PSA            ${ACTORS}/filters/PSA/includePSA
88 89
${ACTORS}/filters/PostPSA
${ACTORS}/filters/Global
dino's avatar
dino committed
90 91
${ACTORS}/filters/Tracking       ${ACTORS}/filters/Tracking/includeOFT  ${ACTORS}/filters/Tracking/includeMGT
${ACTORS}/builders
92
${AGADIR}/include
dino's avatar
dino committed
93
${PRISMA}/include
94 95
${Boost_INCLUDE_DIR}
${ROOT_INCLUDE_DIR}
96
##/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
97 98 99
)

SET(actors_SRCS
dino's avatar
dino committed
100 101
${ACTORS}/common/CycleServer.cpp
${ACTORS}/common/Misc.cpp
dino's avatar
dino committed
102
${ACTORS}/common/mwdlib.cpp
103
${ACTORS}/common/adetParams.cpp
104
${ACTORS}/common/TstampFilter.cpp
105 106
${ACTORS}/common/TextReader.cpp
${ACTORS}/common/ConfReader.cpp
107
${ACTORS}/common/GaspBuffer.cpp
108
${ACTORS}/common/MixFFT.cpp
dino's avatar
dino committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122
${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
123 124
${ACTORS}/filters/PostPSA/PostPSAFilter.cpp
${ACTORS}/filters/Global/GlobalFilter.cpp
dino's avatar
dino committed
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
${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
140
${ACTORS}/builders/EventQueue.cpp
dino's avatar
dino committed
141
)
142
SET_SOURCE_FILES_PROPERTIES(${actors_SRCS} PROPERTIES LANGUAGE CXX)
dino's avatar
dino committed
143 144

SET(adf_SRCS
145
${ADFDIR}/ADFCentralLog.cpp
dino's avatar
dino committed
146
${ADFDIR}/ADFConfig.cpp
147 148
${ADFDIR}/ADFLogCollector.cpp
${ADFDIR}/ADFLogMessage.cpp
dino's avatar
dino committed
149 150 151 152 153 154 155 156 157 158 159 160
${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
161
${ADFDIR}/DefaultFrameFactory.cpp
dino's avatar
dino committed
162
${ADFDIR}/DefaultKeyFactory.cpp
163 164
${ADFDIR}/DFAgent.cpp
${ADFDIR}/DotConf.cpp
dino's avatar
dino committed
165 166 167 168 169 170 171 172 173 174 175
${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
176
${ADFDIR}/RunAgent.cpp
dino's avatar
dino committed
177 178 179 180
${ADFDIR}/Signals.cpp
${ADFDIR}/Trigger.cpp
${ADFDIR}/Version.cpp
${ADFDIR}/BasicAFC.cpp
181
${ADFDIR}/BasicAFP.cpp
dino's avatar
dino committed
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
)

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
)

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

207
###############################################
208

dino's avatar
dino committed
209
SET(LINK_LIBRARIES ${BOOST_LIBRARIES} ${ROOT_LIBRARIES})
210 211 212 213 214
#MESSAGE("LINK_LIBRARIES: ${LINK_LIBRARIES}")

ADD_EXECUTABLE(femul ${femul_SRCS})

TARGET_LINK_LIBRARIES(femul ${LINK_LIBRARIES})