Converting PYTHIA8 to native cmake
authorhristov <Peter.Hristov@cern.ch>
Fri, 14 Nov 2014 15:57:58 +0000 (16:57 +0100)
committeragrigora <alina.grigoras@cern.ch>
Mon, 15 Dec 2014 12:51:56 +0000 (13:51 +0100)
CMakeLists.txt
PYTHIA8/AliPythia8/AliDecayerPythia8.cxx [moved from PYTHIA8/AliDecayerPythia8.cxx with 100% similarity]
PYTHIA8/AliPythia8/AliDecayerPythia8.h [moved from PYTHIA8/AliDecayerPythia8.h with 100% similarity]
PYTHIA8/AliPythia8/AliPythia8.cxx [moved from PYTHIA8/AliPythia8.cxx with 100% similarity]
PYTHIA8/AliPythia8/AliPythia8.h [moved from PYTHIA8/AliPythia8.h with 100% similarity]
PYTHIA8/AliPythia8/AliPythia8LinkDef.h [moved from PYTHIA8/AliPythia8LinkDef.h with 100% similarity]
PYTHIA8/AliPythia8/AliTPythia8.cxx [moved from PYTHIA8/AliTPythia8.cxx with 100% similarity]
PYTHIA8/AliPythia8/AliTPythia8.h [moved from PYTHIA8/AliTPythia8.h with 100% similarity]
PYTHIA8/AliPythia8/CMakeLists.txt [new file with mode: 0644]
PYTHIA8/CMakeLists.txt
PYTHIA8/pythia8175/CMakeLists.txt [new file with mode: 0644]

index 4875f37..6bddca4 100644 (file)
@@ -116,6 +116,7 @@ add_subdirectory(MUON)
 add_subdirectory(OADB)
 add_subdirectory(PHOS)
 add_subdirectory(PMD)
+add_subdirectory(PYTHIA8)
 add_subdirectory(STARLIGHT)
 add_subdirectory(STAT)
 add_subdirectory(STRUCT)
diff --git a/PYTHIA8/AliPythia8/CMakeLists.txt b/PYTHIA8/AliPythia8/CMakeLists.txt
new file mode 100644 (file)
index 0000000..64f1e3b
--- /dev/null
@@ -0,0 +1,70 @@
+# **************************************************************************
+# * 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
+set(MODULE AliPythia8)
+
+# Module include folder
+include_directories(${AliRoot_SOURCE_DIR}/PYTHIA8/${MODULE})
+
+# Additional include folders in alphabetical order except ROOT
+include_directories(${ROOT_INCLUDE_DIRS}
+                    ${AliRoot_SOURCE_DIR}/EVGEN
+                    ${AliRoot_SOURCE_DIR}/LHAPDF
+                    ${AliRoot_SOURCE_DIR}/PYTHIA6/AliPythia6
+                    ${AliRoot_SOURCE_DIR}/PYTHIA6/pythia6
+                    ${AliRoot_SOURCE_DIR}/PYTHIA8/pythia8175/include
+                    ${AliRoot_SOURCE_DIR}/STEER/STEER
+                    ${AliRoot_SOURCE_DIR}/STEER/STEERBase
+                   )
+
+# Sources in alphabetical order
+set(SRCS
+  AliTPythia8.cxx 
+  AliPythia8.cxx 
+  AliDecayerPythia8.cxx 
+  )
+
+# Headers from sources
+string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
+
+# Generate the dictionary
+# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
+get_directory_property(incdirs INCLUDE_DIRECTORIES)
+generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
+
+# Generate the ROOT map
+# Dependecies
+set(LIBDEPS STEERBase STEER pythia6 AliPythia6 LHAPDF EVGEN pythia8175 )
+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)
+
+# Additional compilation flags
+set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+
+# System dependent: Modify the way the library is build
+if(${CMAKE_SYSTEM} MATCHES Darwin)
+    set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+endif(${CMAKE_SYSTEM} MATCHES Darwin)
+
+# Installation
+install(TARGETS ${MODULE}
+        ARCHIVE DESTINATION lib
+        LIBRARY DESTINATION lib)
+
+install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
index d3fc797..f0a5e9e 100644 (file)
@@ -1,10 +1,20 @@
-# AliRoot Build System CMakeLists for PYTHIA8
-#
-# Author: Johny Jose m(johny.jose@cern.ch)
-#         Port of previous Makefile build to cmake
+# **************************************************************************
+# * 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.                  *
+# **************************************************************************
 
-cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
+# Include the libraries
+add_subdirectory (AliPythia8)
+add_subdirectory (pythia8175)
 
-file(GLOB PACKAGES CMake*.pkg)
-
-ALICE_BuildModule()
+message(STATUS "PYTHIA8 enabled")
diff --git a/PYTHIA8/pythia8175/CMakeLists.txt b/PYTHIA8/pythia8175/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7879e99
--- /dev/null
@@ -0,0 +1,107 @@
+# **************************************************************************
+# * 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
+set (MODULE pythia8175)
+
+# Module include folder
+include_directories(${AliRoot_SOURCE_DIR}/PYTHIA8/${MODULE})
+
+# Additional includes - alphabetical order except ROOT
+include_directories(${ROOT_INCLUDE_DIRS}
+                    ${AliRoot_SOURCE_DIR}/PYTHIA8/${MODULE}/include
+                  )
+
+# Sources - alphabetical order
+set(SRCS
+  src/Analysis.cxx 
+  src/Basics.cxx 
+  src/BeamParticle.cxx 
+  src/BeamRemnants.cxx 
+  src/BeamShape.cxx 
+  src/BoseEinstein.cxx 
+  src/Event.cxx 
+  src/FragmentationFlavZpT.cxx 
+  src/FragmentationSystems.cxx 
+  src/HadronLevel.cxx 
+  src/HadronScatter.cxx
+  src/HelicityBasics.cxx
+  src/HelicityMatrixElements.cxx
+  src/HiddenValleyFragmentation.cxx
+  src/History.cxx
+  src/Info.cxx 
+  src/LesHouches.cxx 
+  src/MergingHooks.cxx 
+  src/MiniStringFragmentation.cxx 
+  src/MultipartonInteractions.cxx 
+  src/ParticleData.cxx 
+  src/ParticleDecays.cxx 
+  src/PartonDistributions.cxx 
+  src/PartonLevel.cxx 
+  src/PartonSystems.cxx 
+  src/PhaseSpace.cxx 
+  src/ProcessContainer.cxx 
+  src/ProcessLevel.cxx 
+  src/Pythia.cxx 
+  src/PythiaStdlib.cxx
+  src/RHadrons.cxx 
+  src/ResonanceDecays.cxx 
+  src/ResonanceWidths.cxx 
+  src/Settings.cxx 
+  src/SigmaCompositeness.cxx 
+  src/SigmaEW.cxx 
+  src/SigmaExtraDim.cxx 
+  src/SigmaGeneric.cxx 
+  src/SigmaHiggs.cxx 
+  src/SigmaLeftRightSym.cxx 
+  src/SigmaLeptoquark.cxx 
+  src/SigmaNewGaugeBosons.cxx 
+  src/SigmaOnia.cxx 
+  src/SigmaProcess.cxx 
+  src/SigmaQCD.cxx 
+  src/SigmaSUSY.cxx 
+  src/SigmaTotal.cxx 
+  src/SpaceShower.cxx 
+  src/StandardModel.cxx 
+  src/StringFragmentation.cxx 
+  src/SusyCouplings.cxx 
+  src/SusyLesHouches.cxx 
+  src/TimeShower.cxx 
+  src/TauDecays.cxx              
+  src/UserHooks.cxx 
+  src/SusyResonanceWidths.cxx 
+  )
+
+# No dictionary
+
+# Add a library to the project using the specified source files
+add_library(${MODULE} SHARED ${SRCS})
+
+# Do not generate the ROOT map
+
+# Additional compilation flags
+set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+target_link_libraries(${MODULE} )
+
+# System dependent: Modify the way the library is build
+if(${CMAKE_SYSTEM} MATCHES Darwin)
+    set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+endif(${CMAKE_SYSTEM} MATCHES Darwin)
+
+# Installation
+install(TARGETS ${MODULE} 
+  ARCHIVE DESTINATION lib
+  LIBRARY DESTINATION lib)
+install(FILES ${HDRS} DESTINATION include)