T0 DAs + enable optimization for ITS
authoragrigora <alina.grigoras@cern.ch>
Tue, 25 Nov 2014 08:45:58 +0000 (09:45 +0100)
committeragrigora <alina.grigoras@cern.ch>
Mon, 15 Dec 2014 12:52:00 +0000 (13:52 +0100)
ITS/DA/CMakeLists.txt
ITS/ITSbase/CMakeLists.txt
PMD/PMDbase/CMakeLists.txt
T0/CMakeLists.txt
T0/DA/CMakeLists.txt [new file with mode: 0644]
T0/DA/T0Cosmicda.cxx [moved from T0/T0Cosmicda.cxx with 100% similarity]
T0/DA/T0Laserda.cxx [moved from T0/T0Laserda.cxx with 100% similarity]
T0/DA/T0Physda.cxx [moved from T0/T0Physda.cxx with 100% similarity]
T0/T0base/CMakeLists.txt

index 2e423bb..6b7a79a 100644 (file)
@@ -62,7 +62,7 @@ target_link_libraries(ITSSPDVertexDiamondda ITSrec-static RAWDatarec-static STEE
 target_link_libraries(ITSSSDPEDda ITSbase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 8
 
 # different flags
-set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS} ${AMORE_CFLAGS}")
+set(MODULE_COMPILE_FLAGS "-O -g ${DATE_CFLAGS} ${AMORE_CFLAGS}")
 set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${AMORE_STATICLIBS}")
 
 # 1
index f51a696..f72d1a1 100644 (file)
@@ -173,7 +173,7 @@ add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
 add_library(${MODULE} SHARED $<TARGET_OBJECTS:ITSbase-object>)
 target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
 
-set(MODULE_COMPILE_FLAGS "-o -g -fPIC")
+set(MODULE_COMPILE_FLAGS "-O -g -fPIC")
 if(DATE_FOUND)
     set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS} ${MODULE_COMPILE_FLAGS}")
 endif(DATE_FOUND)
index 2b4bbfa..b107c0a 100644 (file)
@@ -60,7 +60,7 @@ string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
 get_directory_property(incdirs INCLUDE_DIRECTORIES)
 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 
-set(ROOT_DEPENDENCIES Core Hist MathCore RIO Tree)
+set(ROOT_DEPENDENCIES Core Geom Graf Hist MathCore RIO Spectrum Tree)
 set(ALIROOT_DEPENDENCIES STEERBase STEER CDB ESD RAWDatabase  RAWDatarec)
 
 # Generate the ROOT map
index ddb4197..b1c90f9 100644 (file)
@@ -19,4 +19,8 @@ add_subdirectory(T0rec)
 add_subdirectory(T0sim)
 add_subdirectory(T0shuttle)
 
+if(DA)
+    add_subdirectory(DA)
+endif(DA)
+
 message(STATUS "T0 enabled")
diff --git a/T0/DA/CMakeLists.txt b/T0/DA/CMakeLists.txt
new file mode 100644 (file)
index 0000000..bc3655c
--- /dev/null
@@ -0,0 +1,68 @@
+# **************************************************************************
+# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+# *                                                                        *
+# * Author: The ALICE Off-line Project.                                    *
+# * Contributors are mentioned in the code where appropriate.              *
+# *                                                                        *
+# * Permission to use, copy, modify and distribute this software and its   *
+# * documentation strictly for non-commercial purposes is hereby granted   *
+# * without fee, provided that the above copyright notice appears in all   *
+# * copies and that both the copyright notice and this permission notice   *
+# * appear in the supporting documentation. The authors make no claims     *
+# * about the suitability of this software for any purpose. It is          *
+# * provided "as is" without express or implied warranty.                  *
+# **************************************************************************
+
+# Module include folder
+include_directories(${AliRoot_SOURCE_DIR}/T0/DA)
+
+# Additional include folders in alphabetical order
+include_directories(
+                    ${AliRoot_SOURCE_DIR}/T0/T0base
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
+                    ${AliRoot_SOURCE_DIR}/STEER/CDB
+                    ${AliRoot_SOURCE_DIR}/STEER/ESD
+                    ${AliRoot_SOURCE_DIR}/STEER/STEER
+                    ${AliRoot_SOURCE_DIR}/STEER/STEERBase
+                   )
+
+
+# DIM
+link_directories(${DIMDIR}/${ODIR})
+
+#daqDA flags
+include_directories(${daqDA})
+link_directories(${daqDA})
+
+# AMORE definitions
+add_definitions(${AMORE_DEFINITIONS})
+include_directories(${AMORE_INCLUDE_DIR})
+
+# Generating the DA executable
+add_executable(T0Cosmicda T0Cosmicda.cxx) # 1
+add_executable(T0Laserda T0Laserda.cxx) # 2
+add_executable(T0Physda T0Physda.cxx) # 3
+
+set(MODULE_COMPILE_FLAGS)
+set(MODULE_LINK_FLAGS)
+
+target_link_libraries(T0Cosmicda RAWDatarec-static T0base-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 1
+target_link_libraries(T0Laserda RAWDatarec-static T0base-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 2
+target_link_libraries(T0Physda CDB-static RAWDatarec-static T0base-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 3
+
+# different flags
+set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS} ${AMORE_CFLAGS}")
+set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${AMORE_STATICLIBS}")
+
+set_target_properties(T0Cosmicda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(T0Cosmicda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(T0Laserda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(T0Laserda PMDPEDESTALda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(T0Physda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(T0Physda PMDPEDESTALda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# Installation
+install(TARGETS T0Cosmicda T0Laserda T0Physda RUNTIME DESTINATION bin)
\ No newline at end of file
similarity index 100%
rename from T0/T0Cosmicda.cxx
rename to T0/DA/T0Cosmicda.cxx
similarity index 100%
rename from T0/T0Laserda.cxx
rename to T0/DA/T0Laserda.cxx
similarity index 100%
rename from T0/T0Physda.cxx
rename to T0/DA/T0Physda.cxx
index b407e53..0394aa0 100644 (file)
@@ -61,17 +61,25 @@ string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
 get_directory_property(incdirs INCLUDE_DIRECTORIES)
 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 
+set(ROOT_DEPENDENCIES Core Hist MathCore RIO Tree)
+set(ALIROOT_DEPENDENCIES STEERBase STEER CDB ESD RAWDatabase RAWDatarec RAWDatasim)
+
 # Generate the ROOT map
 # Dependecies
-set(LIBDEPS STEERBase STEER CDB ESD RAWDatabase RAWDatarec RAWDatasim)
+set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
 
+# Create an object to be reused in case of static libraries 
+# Otherwise the sources will be compiled twice
+add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(${MODULE} SHARED $<TARGET_OBJECTS:T0base-object>)
 
-# Add a library to the project using the specified source files
-add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
+# Linking
+target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
 
 # Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-O -g -fPIC")
 
 # System dependent: Modify the way the library is build
 if(${CMAKE_SYSTEM} MATCHES Darwin)
@@ -83,4 +91,20 @@ install(TARGETS ${MODULE}
         ARCHIVE DESTINATION lib
         LIBRARY DESTINATION lib)
 
-install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
+install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+    add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:T0base-object>)
+    set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+
+    # list of shared dependencies / the name of the variable containing the list of static ones
+    generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
+    target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root)
+    set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+    # Installation
+    install(TARGETS ${MODULE}-static
+            ARCHIVE DESTINATION lib
+            LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)