Skip to content

Commit

Permalink
EPOS4.0.0 original version
Browse files Browse the repository at this point in the history
  • Loading branch information
jackal1-66 committed Nov 25, 2022
0 parents commit b48f539
Show file tree
Hide file tree
Showing 1,131 changed files with 3,807,650 additions and 0 deletions.
164 changes: 164 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
#
# This file is part of EPOS4
# Copyright (C) 2022 research institutions and authors (See CREDITS file)
# This file is distributed under the terms of the GNU General Public License version 3 or later
# (See COPYING file for the text of the licence)
#

# Almost all CMake files should start with this
# You should always specify a range with the newest
# and oldest tested versions of CMake. This will ensure
# you pick up the best policies.
cmake_minimum_required(VERSION 2.8.12.2...3.17.5)

# This is your project statement. You should always list languages.
project(EPOS Fortran C CXX)


# Compilation option FULL or not FULL
set(COMPILE_OPTION $ENV{COP})

if(COMPILE_OPTION STREQUAL "FULL")
set(WITH_ROOT True)
set(WITH_FASTJET True)
set(WITH_HYDRODYNAMIC True)
set(WITH_EB False)
set(WITH_VO True)
set(WITH_CTEQ True)
set(WITH_XA True)
set(WITH_JT True)
elseif(COMPILE_OPTION STREQUAL "DEMO")
set(WITH_ROOT False)
set(WITH_FASTJET False)
set(WITH_HYDRODYNAMIC False)
set(WITH_EB False)
set(WITH_VO False)
set(WITH_CTEQ False)
set(WITH_XA False)
set(WITH_JT False)
elseif(COMPILE_OPTION STREQUAL "BASIC")
set(WITH_ROOT True)
set(WITH_FASTJET True)
set(WITH_HYDRODYNAMIC True)
set(WITH_EB False)
set(WITH_VO False)
set(WITH_CTEQ False)
set(WITH_XA False)
set(WITH_JT False)
elseif(COMPILE_OPTION STREQUAL "PHSD")
set(WITH_ROOT True)
set(WITH_FASTJET True)
set(WITH_HYDRODYNAMIC False)
set(WITH_EB True)
set(WITH_VO False)
set(WITH_CTEQ False)
set(WITH_XA False)
set(WITH_JT False)
endif()

message(STATUS "Compilation with ${COMPILE_OPTION} option")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules" CACHE PATH "Module Path" FORCE)

if(WITH_ROOT)
message(STATUS "Looking for ROOT")
find_package(ROOT)
message(STATUS "ROOT version ${ROOT_VERSION}")
message(STATUS "ROOT libraries ${ROOT_LIBRARIES}")
endif()

if(WITH_FASTJET)
message(STATUS "Looking for FastJet")
set(FASTJET_ROOT_DIR $ENV{FASTSYS})
find_package(FastJet)
message(STATUS "FASTJET version ${FASTJET_VERSION}")
message(STATUS "FASTJET libraries ${FASTJET_LIBRARIES}")
endif()

# Fortran module files are created in $LIBDIR/Mod
set(LIBRARY_DIRECTORY $ENV{LIBDIR})
set(CMAKE_Fortran_MODULE_DIRECTORY ${LIBRARY_DIRECTORY}Mod)

# Define the project's flags:
set(${PROJECT_NAME}_FORTRAN_FLAGS "-g -mcmodel=large -cpp -fbacktrace -ffpe-trap=invalid,zero -Wall -fno-automatic -fcheck=bounds -O2 -Wtabs -Wno-conversion -Wuninitialized -fno-var-tracking-assignments" CACHE STRING "${PROJECT_NAME} FORTRAN FLAGS")
# Enable this directory's flags:
set(CMAKE_Fortran_FLAGS "${${PROJECT_NAME}_FORTRAN_FLAGS}")

## Enter the subdirectories from src:
add_subdirectory(src/KW)
add_subdirectory(src/KWb)
add_subdirectory(src/KWb/HepMC)
add_subdirectory(src/TP)

## Enter the subdirectories from srcext:
add_subdirectory(srcext/CTEQ)
add_subdirectory(srcext/UR)
add_subdirectory(srcext/VO)
add_subdirectory(srcext/XA)

if(WITH_JT)
add_subdirectory(srcext/JT)
endif()

if(WITH_HYDRODYNAMIC)
add_subdirectory(src/MS)
add_subdirectory(srcext/YK)
endif()


####################################################################################
####################################################################################
# Xepos target
####################################################################################
####################################################################################
set(OBJECT_LIST
$<TARGET_OBJECTS:KW>
$<TARGET_OBJECTS:KWb>
$<TARGET_OBJECTS:HEPMC>
$<TARGET_OBJECTS:TP>
$<TARGET_OBJECTS:UR>
$<TARGET_OBJECTS:CTEQ>
$<TARGET_OBJECTS:VO>
$<TARGET_OBJECTS:XA>
)

if(WITH_JT)
list(APPEND OBJECT_LIST
$<TARGET_OBJECTS:JT>
)
endif()

if(WITH_HYDRODYNAMIC)
list(APPEND OBJECT_LIST
$<TARGET_OBJECTS:MS>
$<TARGET_OBJECTS:YK>
)
endif()

add_dependencies(XA VO)

add_executable(Xepos src/main.cpp ${OBJECT_LIST})
set_target_properties(Xepos PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(Xepos PROPERTIES LINK_FLAGS "-pthread -rdynamic -lgfortran")

set(LINK_LIBRARY_LIST "")
if(WITH_ROOT)
list(APPEND LINK_LIBRARY_LIST
${ROOT_LIBRARIES}
)
endif()
if(WITH_FASTJET)
list(APPEND LINK_LIBRARY_LIST
${FASTJET_LIBRARIES}
)
endif()

target_link_libraries(Xepos ${LINK_LIBRARY_LIST})

####################################################################################
####################################################################################
# XeposC target
####################################################################################
####################################################################################
add_executable(XeposC $<TARGET_OBJECTS:XEPOSC>)
set_target_properties(XeposC PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(XeposC PROPERTIES LINK_FLAGS "-pthread -rdynamic")
74 changes: 74 additions & 0 deletions CMakeModules/FindFastJet.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#
# This file is part of EPOS4
# Copyright (C) 2022 research institutions and authors (See CREDITS file)
# This file is distributed under the terms of the GNU General Public License version 3 or later
# (See COPYING file for the text of the licence)
#

#####################################################################################
# (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations #
# #
# This software is distributed under the terms of the Apache version 2 licence, #
# copied verbatim in the file "LICENSE". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
#####################################################################################
# - Locate FastJet library
# Defines:
#
# FASTJET_FOUND
# FASTJET_INCLUDE_DIR
# FASTJET_INCLUDE_DIRS (not cached)
# FASTJET_LIBRARY
# FASTJET_LIBRARIES (not cached)
# FASTJET_LIBRARY_DIRS (not cached)


# the following disables all default paths (either from cmake, from environment)
FIND_PATH (FASTJET_BIN_DIR fastjet-config
PATHS
${FASTJETSYS}/bin
$ENV{FASTJETSYS}/bin
$ENV{AUGER_BASE}/External/FASTJET/pro/bin
NO_DEFAULT_PATH
)

# now defaults are allowed but if nothing is found it is not overwritten
# (because it is cached)
FIND_PATH (FASTJET_BIN_DIR fastjet-config)

GET_FILENAME_COMPONENT (FASTJETSYS ${FASTJET_BIN_DIR} PATH)

IF (NOT ENV{FASTJETSYS})
SET (ENV{FASTJETSYS} ${FASTJETSYS})
ENDIF (NOT ENV{FASTJETSYS})

IF (FASTJETSYS)
# ----------------------------------------------------------------------------
# Get ROOT version, re-express in form XX.YY.ZZ, compare to requirements.
# ----------------------------------------------------------------------------
EXECUTE_PROCESS (COMMAND ${FASTJET_BIN_DIR}/fastjet-config --version
OUTPUT_VARIABLE FASTJET_VERSION
)
STRING (REGEX REPLACE "[ \t\r\n]+" "" FASTJET_VERSION "${FASTJET_VERSION}")

find_path(FASTJET_INCLUDE_DIR fastjet/version.hh
HINTS $ENV{FASTJET_ROOT_DIR}/include ${FASTJET_ROOT_DIR}/include)

find_library(FASTJET_LIBRARY NAMES fastjet
HINTS $ENV{FASTJET_ROOT_DIR}/lib ${FASTJET_ROOT_DIR}/lib)

# handle the QUIETLY and REQUIRED arguments and set FASTJET_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FastJet DEFAULT_MSG FASTJET_INCLUDE_DIR FASTJET_LIBRARY)

mark_as_advanced(FASTJET_FOUND FASTJET_INCLUDE_DIR FASTJET_LIBRARY)

set(FASTJET_INCLUDE_DIRS ${FASTJET_INCLUDE_DIR})
set(FASTJET_LIBRARIES ${FASTJET_LIBRARY})
get_filename_component(FASTJET_LIBRARY_DIRS ${FASTJET_LIBRARY} PATH)

ENDIF (FASTJETSYS)
Loading

0 comments on commit b48f539

Please sign in to comment.