PMD DAs
authoragrigora <alina.grigoras@cern.ch>
Mon, 24 Nov 2014 16:45:41 +0000 (17:45 +0100)
committeragrigora <alina.grigoras@cern.ch>
Mon, 15 Dec 2014 12:52:00 +0000 (13:52 +0100)
PMD/CMakeLists.txt
PMD/DA/CMakeLists.txt [new file with mode: 0644]
PMD/DA/PMDGAINda.cxx [moved from PMD/PMDGAINda.cxx with 100% similarity]
PMD/DA/PMDPEDESTALda.cxx [moved from PMD/PMDPEDESTALda.cxx with 100% similarity]
PMD/PMDbase/AliPMDCalibData.cxx
PMD/PMDbase/AliPMDPedestal.cxx
PMD/PMDbase/CMakeLists.txt
PMD/PMDrec/CMakeLists.txt
PMD/PMDsim/CMakeLists.txt
PMD/PMDsim/PMDsimLinkDef.h

index 60e0a30..4197ce7 100644 (file)
@@ -18,4 +18,8 @@ add_subdirectory(PMDbase)
 add_subdirectory(PMDrec)
 add_subdirectory(PMDsim)
 
+if(DA)
+    add_subdirectory(DA)
+endif(DA)
+
 message(STATUS "PMD enabled")
diff --git a/PMD/DA/CMakeLists.txt b/PMD/DA/CMakeLists.txt
new file mode 100644 (file)
index 0000000..03dd09e
--- /dev/null
@@ -0,0 +1,64 @@
+# **************************************************************************
+# * 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}/PMD/DA)
+
+# Additional include folders in alphabetical order
+include_directories(
+                    ${AliRoot_SOURCE_DIR}/PMD/PMDrec
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatasim
+                    ${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(PMDGAINda PMDGAINda.cxx) # 1
+add_executable(PMDPEDESTALda PMDPEDESTALda.cxx) # 2
+
+set(MODULE_COMPILE_FLAGS)
+set(MODULE_LINK_FLAGS)
+
+target_link_libraries(PMDGAINda CDB-static PMDrec-static RAWDatarec-static STEERBase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 1
+target_link_libraries(PMDPEDESTALda CDB-static PMDrec-static RAWDatarec-static STEERBase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 2
+
+# different flags
+set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS} ${AMORE_CFLAGS}")
+set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${AMORE_STATICLIBS}")
+
+set_target_properties(PMDGAINda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(PMDGAINda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(PMDPEDESTALda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(PMDPEDESTALda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# Installation
+install(TARGETS PMDGAINda PMDPEDESTALda RUNTIME DESTINATION bin)
\ No newline at end of file
similarity index 100%
rename from PMD/PMDGAINda.cxx
rename to PMD/DA/PMDGAINda.cxx
index 8bbcc51..627768c 100644 (file)
@@ -17,7 +17,7 @@
 //
 #include "TNamed.h"
 #include "AliCDBEntry.h"
-#include "AliPMD.h"
+//#include "AliPMD.h"
 #include "AliPMDCalibData.h"
 
 
index 1e18b12..49eed76 100644 (file)
@@ -16,7 +16,7 @@
 //
 #include "TNamed.h"
 #include "AliCDBEntry.h"
-#include "AliPMD.h"
+//#include "AliPMD.h"
 #include "AliPMDPedestal.h"
 
 
index a751c8f..2b4bbfa 100644 (file)
@@ -23,7 +23,6 @@ include_directories(${AliRoot_SOURCE_DIR}/PMD/${MODULE})
 include_directories(${ROOT_INCLUDE_DIRS}
                     ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
                     ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
-                    ${AliRoot_SOURCE_DIR}/PMD/PMDsim
                     ${AliRoot_SOURCE_DIR}/STEER/CDB
                     ${AliRoot_SOURCE_DIR}/STEER/ESD
                     ${AliRoot_SOURCE_DIR}/STEER/STEER
@@ -61,17 +60,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)
+
 # Generate the ROOT map
 # Dependecies
-set(LIBDEPS STEERBase STEER CDB ESD RAWDatabase  RAWDatarec PMDsim)
+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:PMDbase-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 +90,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:PMDbase-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)
index 8922ef7..98519f4 100644 (file)
@@ -70,17 +70,25 @@ set(HDRS
 get_directory_property(incdirs INCLUDE_DIRECTORIES)
 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 
+set(ROOT_DEPENDENCIES Core EG Geom Graf Hist MathCore RIO Tree)
+set(ALIROOT_DEPENDENCIES STEERBase STEER CDB ESD RAWDatabase RAWDatarec RAWDatasim PMDbase)
+
 # Generate the ROOT map
 # Dependecies
-set(LIBDEPS STEERBase STEER CDB ESD RAWDatabase RAWDatarec RAWDatasim PMDbase)
+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:PMDrec-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)
@@ -92,4 +100,21 @@ 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:PMDrec-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)
index bb808ca..aecf8f7 100644 (file)
@@ -31,8 +31,8 @@ include_directories(${ROOT_INCLUDE_DIRS}
 
 # Sources in alphabetical order
 set(SRCS
-    AliPMDcell.cxx
     AliPMD.cxx
+    AliPMDcell.cxx
     AliPMDDDLRawData.cxx
     AliPMDDigitizer.cxx
     AliPMDhit.cxx
index d8ba7d8..e69add3 100644 (file)
@@ -7,8 +7,8 @@
 #pragma link off all globals;
 #pragma link off all classes;
 #pragma link off all functions;
-#pragma link C++ class  AliPMD+;
+
+#pragma link C++ class  AliPMD+; 
 #pragma link C++ class  AliPMDv0+;
 #pragma link C++ class  AliPMDv1+;
 #pragma link C++ class  AliPMDv2008+;