FMD DAs
authoragrigora <alina.grigoras@cern.ch>
Thu, 20 Nov 2014 17:55:00 +0000 (18:55 +0100)
committeragrigora <alina.grigoras@cern.ch>
Mon, 15 Dec 2014 12:51:59 +0000 (13:51 +0100)
13 files changed:
FMD/CMakeLists.txt
FMD/DA/CMakeLists.txt [new file with mode: 0644]
FMD/DA/FMDBaseda.cxx [moved from FMD/FMDBaseda.cxx with 100% similarity]
FMD/DA/FMDGainda.cxx [moved from FMD/FMDGainda.cxx with 100% similarity]
FMD/DA/FMDPedestalda.cxx [moved from FMD/FMDPedestalda.cxx with 100% similarity]
FMD/DA/FMDUtilda.h [moved from FMD/FMDUtilda.h with 100% similarity]
FMD/FMDbase/CMakeLists.txt
FMD/FMDrec/CMakeLists.txt
FMD/FMDsim/CMakeLists.txt
FMD/FMDutil/CMakeLists.txt
ITS/ITSbase/CMakeLists.txt
cmake/CMakeALICE.cmake
cmake/FindAMORE.cmake

index f521104..4d6ae50 100644 (file)
@@ -19,6 +19,10 @@ add_subdirectory(FMDutil)
 add_subdirectory(FMDrec)
 add_subdirectory(FMDsim)
 
+if(DA)
+    add_subdirectory(DA)
+endif()
+
 # Install files to destination
 install(DIRECTORY scripts DESTINATION FMD)
 install(FILES 
diff --git a/FMD/DA/CMakeLists.txt b/FMD/DA/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ff4b2ac
--- /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}/ACORDE/DA)
+
+# Additional include folders in alphabetical order
+include_directories(
+                    ${AliRoot_SOURCE_DIR}/FMD/
+                    ${AliRoot_SOURCE_DIR}/FMD/FMDbase
+                    ${AliRoot_SOURCE_DIR}/FMD/FMDutil
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
+                    ${AliRoot_SOURCE_DIR}/STEER/ESD
+                    ${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(FMDBaseda FMDBaseda.cxx)
+add_executable(FMDGainda FMDGainda.cxx)
+add_executable(FMDPedestalda FMDGainda.cxx)
+
+set(MODULE_COMPILE_FLAGS)
+set(MODULE_LINK_FLAGS)
+
+target_link_libraries(FMDBaseda FMDbase-static FMDutil-static RAWDatarec-static STEERBase-static ${DATE_MONLIBRARIES} daqDA Root RootExtra  ${DATE_RCPROXYLIBRARIES} )
+target_link_libraries(FMDGainda FMDbase-static FMDutil-static AmoreDA daqDA ${DATE_MONLIBRARIES}  Root RootExtra  ${DATE_RCPROXYLIBRARIES})
+target_link_libraries(FMDPedestalda FMDbase-static FMDutil-static AmoreDA daqDA ${DATE_MONLIBRARIES} Root RootExtra  ${DATE_RCPROXYLIBRARIES} )
+
+# different flags
+set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS} ${AMORE_CFLAGS}")
+set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${AMORE_STATICLIBS} ${AMORE_AUXLIBS}")
+
+set_target_properties(FMDBaseda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(FMDBaseda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(FMDGainda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(FMDGainda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(FMDPedestalda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(FMDPedestalda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# Installation
+install(TARGETS FMDBaseda FMDGainda FMDPedestalda RUNTIME DESTINATION bin)
\ No newline at end of file
similarity index 100%
rename from FMD/FMDBaseda.cxx
rename to FMD/DA/FMDBaseda.cxx
similarity index 100%
rename from FMD/FMDGainda.cxx
rename to FMD/DA/FMDGainda.cxx
similarity index 100%
rename from FMD/FMDUtilda.h
rename to FMD/DA/FMDUtilda.h
index a2d2073..606ae80 100644 (file)
@@ -64,17 +64,26 @@ set(HDRS ${HDRS} AliFMDCalibFwd.h)
 get_directory_property(incdirs INCLUDE_DIRECTORIES)
 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 
+# Dependencies
+set(ROOT_DEPENDENCIES)
+set(ALIROOT_DEPENDENCIES STEERBase STEER ESD CDB RAWDatabase FMDrec)
+
 # Generate the ROOT map
 # Dependecies
-set(LIBDEPS STEERBase STEER ESD CDB RAWDatabase FMDrec)
+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:FMDbase-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)
@@ -86,4 +95,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:FMDbase-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 381d131..e66bb4a 100644 (file)
@@ -49,16 +49,26 @@ string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
 get_directory_property(incdirs INCLUDE_DIRECTORIES)
 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 
+# Dependencies
+set(ROOT_DEPENDENCIES)
+set(ALIROOT_DEPENDENCIES STEERBase STEER ESD RAWDatabase RAWDatarec)
+
 # Generate the ROOT map
 # Dependecies
-set(LIBDEPS STEERBase STEER ESD RAWDatabase RAWDatarec)
+set(LIBDEPS ${ALIROOT_DEPENDENCIES}  ${ROOT_DEPENDENCIES})
 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
 
-# Add a library to the project using the specified source files
-add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
+# 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:FMDrec-object>)
+
+# dependecies
+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)
@@ -70,4 +80,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:FMDrec-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 ad4e636..b4455be 100644 (file)
@@ -53,16 +53,26 @@ set(HDRS ${HDRS} AliFMDEdepHitPair.h)
 get_directory_property(incdirs INCLUDE_DIRECTORIES)
 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 
+# Dependencies
+set(ROOT_DEPENDENCIES)
+set(ALIROOT_DEPENDENCIES STEERBase STEER ESD RAWDatabase RAWDatasim FMDbase FMDrec)
+
 # Generate the ROOT map
 # Dependecies
-set(LIBDEPS STEERBase STEER ESD RAWDatabase RAWDatasim FMDbase FMDrec)
+set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
 
-# Add a library to the project using the specified source files
-add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
+# 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:FMDsim-object>)
+
+# 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)
@@ -74,4 +84,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:FMDsim-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 8a9dd50..14f7d4e 100644 (file)
@@ -55,17 +55,26 @@ string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
 get_directory_property(incdirs INCLUDE_DIRECTORIES)
 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 
+# Dependencies
+set(ROOT_DEPENDENCIES Graf Gui)
+set(ALIROOT_DEPENDENCIES STEERBase STEER ESD CDB RAWDatarec RAWDatabase FMDbase FMDrec FMDsim)
+
 # Generate the ROOT map
 # Dependecies
-set(LIBDEPS STEERBase STEER ESD CDB RAWDatarec RAWDatabase FMDbase FMDrec FMDsim Graf Gui)
+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:FMDutil-object>)
 
-# Add a library to the project using the specified source files
-add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
+# dependecies 
+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)
@@ -77,4 +86,22 @@ 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:FMDutil-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 8e15972..e2347e0 100644 (file)
@@ -108,7 +108,7 @@ set(SRCS
     AliITSTriggerConditions.cxx
    )
 if (DATE_FOUND)
-    set (SRCS "${SRCS} AliITSHandleDaSSD.cxx")
+    set (SRCS ${SRCS} "AliITSHandleDaSSD.cxx")
 endif (DATE_FOUND)
 
 # Headers from sources
index 1e0e0b3..05f0a7a 100644 (file)
@@ -85,7 +85,6 @@ endmacro(generate_rootmap)
 # @ shared_list - list of shared libraries
 # @ static_list - the name of the variable that will contain the list of static libraries
 macro(generate_static_dependencies shared_list static_list)
-message(STATUS "list ${shared_list}")
     set(static_list_tmp "")
     foreach(shared_lib ${shared_list})
         set(static_list_tmp ${static_list_tmp} "${shared_lib}-static")
index 0510f78..9fe6131 100644 (file)
@@ -19,6 +19,8 @@
 #               - AMORE_STATICLIBS - libraries and linking folders for static build
 #               - AMORE_AUXLIBS - auxiliary libraries for DA 
 #               - AMORE_DEFINITIONS
+#               - AMORE_CFLAGS
+#               - AMORE_INCLUDE_DIR
 
 set(AMORE_FOUND FALSE)
 
@@ -50,6 +52,27 @@ if(AMORE_CONFIG)
     endif(error)
     string(STRIP ${AMORE_AUXLIBS} AMORE_AUXLIBS)
 
+    # Checking AMORE cflags
+    execute_process(COMMAND ${AMORE_CONFIG} --cflags OUTPUT_VARIABLE AMORE_CFLAGS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+    if(error)
+        message(FATAL_ERROR "Error retrieving AMORE cflags : ${error}")
+    endif(error)
+    
+    if(AMORE_CFLAGS)
+        string(STRIP ${AMORE_CFLAGS} AMORE_CFLAGS)
+    endif(AMORE_CFLAGS)
+
+    # Checking AMORE cflags
+    execute_process(COMMAND ${AMORE_CONFIG} --include-dir OUTPUT_VARIABLE AMORE_INCLUDE_DIR ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+    if(error)
+        message(FATAL_ERROR "Error retrieving AMORE include directory : ${error}")
+    endif(error)
+    
+    if(AMORE_INCLUDE_DIR)
+        string(STRIP ${AMORE_INCLUDE_DIR} AMORE_INCLUDE_DIR)
+    endif(AMORE_INCLUDE_DIR)
+
+
     set(AMORE_DEFINITIONS "-DALI_AMORE")
     set(AMORE_FOUND TRUE)