Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8724265
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
15 KB
Subscribers
None
View Options
diff --git a/FixedOrderGen/CMakeLists.txt b/FixedOrderGen/CMakeLists.txt
index f12bc17..9abb7bd 100644
--- a/FixedOrderGen/CMakeLists.txt
+++ b/FixedOrderGen/CMakeLists.txt
@@ -1,121 +1,121 @@
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project("HEJ Fixed Order Generation" VERSION 2.0.4 LANGUAGES C CXX)
# Set a default build type if none was specified
set(default_build_type "RelWithDebInfo")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
## Flags for the compiler. No warning allowed.
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
elseif (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /EHsc")
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 14)
## Create Version
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_GIT_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Templates/Version.hh.in
${PROJECT_BINARY_DIR}/include/Version.hh @ONLY )
## Add directories and find dependences
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../cmake/Modules/")
find_package(HEJ 2 REQUIRED)
include_directories(${HEJ_INCLUDE_DIR})
find_package(fastjet REQUIRED)
include_directories(${fastjet_INCLUDE_DIRS})
find_package(clhep 2.3 REQUIRED)
include_directories(${CLHEP_INCLUDE_DIRS})
find_package(LHAPDF REQUIRED)
include_directories(${LHAPDF_INCLUDE_DIRS})
## Amend unintuitive behaviour of FindBoost.cmake
## Priority of BOOST_ROOT over BOOSTROOT matches FindBoost.cmake
## at least for cmake 3.12
if(DEFINED BOOST_ROOT)
message("BOOST_ROOT set - only looking for Boost in ${BOOST_ROOT}")
set(Boost_NO_BOOST_CMAKE ON)
elseif(DEFINED BOOSTROOT)
message("BOOSTROOT set - only looking for Boost in ${BOOSTROOT}")
set(Boost_NO_BOOST_CMAKE ON)
endif()
find_package(Boost REQUIRED COMPONENTS iostreams)
include_directories(${Boost_INCLUDE_DIRS})
find_package(yaml-cpp)
include_directories(${YAML_CPP_INCLUDE_DIR})
find_package(QCDloop 2)
if(${QCDloop_FOUND})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHEJ_BUILD_WITH_QCDLOOP")
include_directories(SYSTEM ${QCDloop_INCLUDE_DIRS})
endif()
## define executable
file(GLOB HEJFOG_source ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc)
list(REMOVE_ITEM HEJFOG_source ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cc)
add_library(hejfog STATIC ${HEJFOG_source})
add_executable(HEJFOG ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cc)
## link libraries
set(libraries ${CMAKE_DL_LIBS} ${LHAPDF_LIBRARIES} ${CLHEP_LIBRARIES}
- ${FASTJET_LIBRARIES} ${Boost_LIBRARIES} ${YAML_CPP_LIBRARIES} ${HEJ_LIBRARIES})
+ ${fastjet_LIBRARIES} ${Boost_LIBRARIES} ${YAML_CPP_LIBRARIES} ${HEJ_LIBRARIES})
if(${QCDloop_FOUND})
list(APPEND libraries ${QCDloop_LIBRARIES} quadmath)
endif()
target_link_libraries(hejfog ${libraries})
target_link_libraries(HEJFOG hejfog)
install(TARGETS HEJFOG DESTINATION bin)
## tests
enable_testing()
set(tst_dir "${CMAKE_CURRENT_SOURCE_DIR}/t")
foreach(tst h_2j h_3j h_5j h_3j_uno1 h_3j_uno2 h_2j_decay 2j 4j)
add_executable(test_${tst} ${tst_dir}/${tst}.cc)
target_link_libraries(test_${tst} hejfog)
add_test(NAME t_${tst} COMMAND test_${tst} WORKING_DIRECTORY ${tst_dir})
endforeach()
add_test(
NAME t_main_2j
COMMAND HEJFOG ${tst_dir}/config_2j.yml
)
add_test(
NAME t_main_h2j
COMMAND HEJFOG ${tst_dir}/config_h_2j.yml
)
add_test(
NAME t_main_h2j_decay
COMMAND HEJFOG ${tst_dir}/config_h_2j_decay.yml
)
diff --git a/cmake/Modules/Findfastjet.cmake b/cmake/Modules/Findfastjet.cmake
index cac2faf..64918ed 100644
--- a/cmake/Modules/Findfastjet.cmake
+++ b/cmake/Modules/Findfastjet.cmake
@@ -1,26 +1,216 @@
-include (FindPackageMessage)
-
-message (STATUS "Detecting FastJet installation")
-execute_process (COMMAND fastjet-config --prefix
- OUTPUT_VARIABLE fastjet_PREFIX
- )
-if (fastjet_PREFIX)
- string (STRIP ${fastjet_PREFIX} fastjet_PREFIX)
- message (STATUS "FastJet installation found: ${fastjet_PREFIX}")
- EXECUTE_PROCESS(COMMAND fastjet-config --libs OUTPUT_VARIABLE
- FASTJET_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
- # set (fastjet_LIBRARIES ${fastjet_LIBRARIES} )
- set (fastjet_INCLUDE_DIRS ${fastjet_PREFIX}/include)
- set (fastjet_FOUND TRUE)
-else (fastjet_PREFIX)
- set (fastjet_FOUND FALSE)
-endif (fastjet_PREFIX)
-
-if (NOT fastjet_FOUND)
- message(FATAL_ERROR "FastJet installation not found!")
-endif (NOT fastjet_FOUND)
-
-mark_as_advanced(
- fastjet_INCLUDE_DIRS
- fastjet_LIBRARIES
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+# This is a slightly modified version of FindGSL.cmake taken from cmake 3.7
+
+#.rst:
+# Findfastjet
+# --------
+#
+# Find the native fastjet includes and libraries.
+#
+# fastjet package is an object oriented, C++ event record for High Energy
+# Physics Monte Carlo generators and simulation. It is free software
+# under the GNU General Public License.
+#
+# Imported Targets
+# ^^^^^^^^^^^^^^^^
+#
+# If fastjet is found, this module defines the following
+# :prop_tgt:`IMPORTED` target::
+#
+# fastjet::fastjet - The main fastjet library.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module will set the following variables in your project::
+#
+# fastjet_FOUND - True if fastjet found on the local system
+# fastjet_INCLUDE_DIRS - Location of fastjet header files.
+# fastjet_LIBRARIES - The fastjet libraries.
+# fastjet_VERSION - The version of the discovered fastjet install.
+#
+# Hints
+# ^^^^^
+#
+# Set ``fastjet_ROOT_DIR`` to a directory that contains a fastjet installation.
+#
+# This script expects to find libraries at ``$fastjet_ROOT_DIR/lib`` and the fastjet
+# headers at ``$fastjet_ROOT_DIR/include/fastjet``. The library directory may
+# optionally provide Release and Debug folders. For Unix-like systems, this
+# script will use ``$fastjet_ROOT_DIR/bin/fastjet-config`` (if found) to aid in the
+# discovery fastjet.
+#
+# Cache Variables
+# ^^^^^^^^^^^^^^^
+#
+# This module may set the following variables depending on platform and type
+# of fastjet installation discovered. These variables may optionally be set to
+# help this module find the correct files::
+#
+# fastjet_CONFIG_EXECUTABLE - Location of the ``fastjet-config`` script (if any).
+# fastjet_LIBRARY - Location of the fastjet library.
+# fastjet_LIBRARY_DEBUG - Location of the debug fastjet library (if any).
+#
+
+# Include these modules to handle the QUIETLY and REQUIRED arguments.
+include(FindPackageHandleStandardArgs)
+
+#=============================================================================
+# If the user has provided ``fastjet_ROOT_DIR``, use it! Choose items found
+# at this location over system locations.
+if( EXISTS "$ENV{fastjet_ROOT_DIR}" )
+ file( TO_CMAKE_PATH "$ENV{fastjet_ROOT_DIR}" fastjet_ROOT_DIR )
+ set( fastjet_ROOT_DIR "${fastjet_ROOT_DIR}" CACHE PATH "Prefix for fastjet installation." )
+endif()
+if( NOT EXISTS "${fastjet_ROOT_DIR}" )
+ set( fastjet_USE_PKGCONFIG ON )
+endif()
+
+#=============================================================================
+# As a first try, use the PkgConfig module. This will work on many
+# *NIX systems. See :module:`findpkgconfig`
+# This will return ``fastjet_INCLUDEDIR`` and ``fastjet_LIBDIR`` used below.
+if( fastjet_USE_PKGCONFIG )
+ find_package(PkgConfig)
+ pkg_check_modules( fastjet QUIET fastjet )
+
+ if( EXISTS "${fastjet_INCLUDEDIR}" )
+ get_filename_component( fastjet_ROOT_DIR "${fastjet_INCLUDEDIR}" DIRECTORY CACHE)
+ endif()
+endif()
+
+#=============================================================================
+# Set fastjet_INCLUDE_DIRS and fastjet_LIBRARIES. If we skipped the PkgConfig step, try
+# to find the libraries at $fastjet_ROOT_DIR (if provided), in the directory
+# suggested by fastjet-config (if available), or in standard system
+# locations. These find_library and find_path calls will prefer custom
+# locations over standard locations (HINTS). If the requested file is found
+# neither at the HINTS location nor via fastjet-config, standard system locations
+# will be still be searched (/usr/lib64 (Redhat), lib/i386-linux-gnu (Debian)).
+
+# If we didn't use PkgConfig, try to find the version via fastjet-config
+if( NOT fastjet_VERSION )
+ find_program( fastjet_CONFIG_EXECUTABLE
+ NAMES fastjet-config
+ HINTS "${fastjet_ROOT_DIR}/bin"
+ )
+ if( EXISTS "${fastjet_CONFIG_EXECUTABLE}" )
+ execute_process(
+ COMMAND "${fastjet_CONFIG_EXECUTABLE}" --version
+ OUTPUT_VARIABLE fastjet_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE )
+ execute_process(
+ COMMAND "${fastjet_CONFIG_EXECUTABLE}" --prefix
+ OUTPUT_VARIABLE fastjet_CONFIG_ROOT_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE )
+ set(fastjet_CONFIG_INCLUDEDIR ${fastjet_CONFIG_ROOT_DIR}/include)
+ set(fastjet_CONFIG_LIBDIR ${fastjet_CONFIG_ROOT_DIR}/lib)
+ endif()
+endif()
+find_path( fastjet_INCLUDE_DIR
+ NAMES fastjet/config_auto.h fastjet/version.hh
+ HINTS ${fastjet_ROOT_DIR}/include ${fastjet_INCLUDEDIR} ${fastjet_CONFIG_INCLUDEDIR}
+)
+find_library( fastjet_LIBRARY
+ NAMES fastjet
+ HINTS ${fastjet_ROOT_DIR}/lib ${fastjet_LIBDIR} ${fastjet_CONFIG_LIBDIR}
+ PATH_SUFFIXES Release Debug
)
+# Do we also have debug versions?
+find_library( fastjet_LIBRARY_DEBUG
+ NAMES fastjet
+ HINTS ${fastjet_ROOT_DIR}/lib ${fastjet_LIBDIR} ${fastjet_CONFIG_LIBDIR}
+ PATH_SUFFIXES Debug
+)
+set( fastjet_INCLUDE_DIRS ${fastjet_INCLUDE_DIR} )
+set( fastjet_LIBRARIES ${fastjet_LIBRARY} )
+
+if( NOT fastjet_VERSION )
+ if(IS_DIRECTORY ${fastjet_INCLUDE_DIR})
+ file(STRINGS "${fastjet_INCLUDE_DIR}/fastjet/config_auto.h" _fastjet_DEFS)
+ file(STRINGS "${fastjet_INCLUDE_DIR}/fastjet/version.hh" _fastjet_VERS)
+ string(
+ REGEX MATCH
+ "#define *FASTJET_VERSION *\"[^\"]*\""
+ _fastjet_VERSION_STR "${_fastjet_VERS} ${_fastjet_DEFS}"
+ )
+ string(
+ REGEX MATCH
+ "[0-9]*\\.[0-9]*\\.[0-9]*"
+ fastjet_VERSION ${_fastjet_VERSION_STR}
+ )
+ endif()
+endif()
+if( fastjet_VERSION )
+ string(REPLACE "." ";" t_list ${fastjet_VERSION})
+ list(APPEND t_list 0 0) # add a buffer in case supversion not set
+ list(GET t_list 0 fastjet_VERSION_MAJOR)
+ list(GET t_list 1 fastjet_VERSION_MINOR)
+ list(GET t_list 2 fastjet_VERSION_PATCH)
+endif()
+#=============================================================================
+# handle the QUIETLY and REQUIRED arguments and set fastjet_FOUND to TRUE if all
+# listed variables are TRUE
+find_package_handle_standard_args( fastjet
+ FOUND_VAR
+ fastjet_FOUND
+ REQUIRED_VARS
+ fastjet_INCLUDE_DIR
+ fastjet_LIBRARY
+ VERSION_VAR
+ fastjet_VERSION
+ )
+
+mark_as_advanced( fastjet_ROOT_DIR fastjet_VERSION fastjet_LIBRARY fastjet_INCLUDE_DIR
+ fastjet_LIBRARY_DEBUG fastjet_USE_PKGCONFIG fastjet_CONFIG )
+
+#=============================================================================
+# Register imported libraries:
+# 1. If we can find a Windows .dll file (or if we can find both Debug and
+# Release libraries), we will set appropriate target properties for these.
+# 2. However, for most systems, we will only register the import location and
+# include directory.
+
+# Look for dlls, or Release and Debug libraries.
+if(WIN32)
+ string( REPLACE ".lib" ".dll" fastjet_LIBRARY_DLL "${fastjet_LIBRARY}" )
+ string( REPLACE ".lib" ".dll" fastjet_LIBRARY_DEBUG_DLL "${fastjet_LIBRARY_DEBUG}" )
+endif()
+
+if( fastjet_FOUND AND NOT TARGET fastjet::fastjet )
+ if( EXISTS "${fastjet_LIBRARY_DLL}")
+
+ # Windows systems with dll libraries.
+ add_library( fastjet::fastjet SHARED IMPORTED )
+ add_library( fastjet::fastjetcblas SHARED IMPORTED )
+
+ # Windows with dlls, but only Release libraries.
+ set_target_properties( fastjet::fastjet PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${fastjet_LIBRARY_DLL}"
+ IMPORTED_IMPLIB "${fastjet_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${fastjet_INCLUDE_DIRS}"
+ IMPORTED_CONFIGURATIONS Release
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ )
+
+ # If we have both Debug and Release libraries
+ if( EXISTS "${fastjet_LIBRARY_DEBUG_DLL}")
+ set_property( TARGET fastjet::fastjet APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
+ set_target_properties( fastjet::fastjet PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${fastjet_LIBRARY_DEBUG_DLL}"
+ IMPORTED_IMPLIB_DEBUG "${fastjet_LIBRARY_DEBUG}" )
+ endif()
+
+ else()
+
+ # For all other environments (ones without dll libraries), create
+ # the imported library targets.
+ add_library( fastjet::fastjet UNKNOWN IMPORTED )
+ set_target_properties( fastjet::fastjet PROPERTIES
+ IMPORTED_LOCATION "${fastjet_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${fastjet_INCLUDE_DIRS}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ )
+ endif()
+endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b369c4c..fd53f37 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,28 +1,28 @@
file(GLOB src_files *.cc)
add_library(hejlib SHARED ${src_files})
set_target_properties(hejlib PROPERTIES OUTPUT_NAME "HEJ")
message(STATUS "LHAPDF_LIBRARIES ${LHAPDF_LIBRARIES}")
message(STATUS "CLHEP_LIBRARIES ${CLHEP_LIBRARIES}")
-message(STATUS "FASTJET_LIBRARIES ${FASTJET_LIBRARIES}")
+message(STATUS "fastjet_LIBRARIES ${fastjet_LIBRARIES}")
message(STATUS "Boost_LIBRARIES ${Boost_LIBRARIES}")
message(STATUS "YAML_CPP_LIBRARIES ${YAML_CPP_LIBRARIES}")
message(STATUS "QCDloop_LIBRARIES ${QCDloop_LIBRARIES}")
message(STATUS "HepMC_LIBRARIES ${HepMC_LIBRARIES}")
message(STATUS "rivet_LIBRARIES ${rivet_LIBRARIES}")
set(libraries ${CMAKE_DL_LIBS} ${LHAPDF_LIBRARIES} ${CLHEP_LIBRARIES}
- ${FASTJET_LIBRARIES} ${Boost_LIBRARIES} ${YAML_CPP_LIBRARIES} yaml-cpp)
+ ${fastjet_LIBRARIES} ${Boost_LIBRARIES} ${YAML_CPP_LIBRARIES} yaml-cpp)
if(${QCDloop_FOUND})
list(APPEND libraries ${QCDloop_LIBRARIES} quadmath)
endif()
if(${HepMC_FOUND})
list(APPEND libraries ${HepMC_LIBRARIES})
if(${rivet_FOUND})
list(APPEND libraries ${rivet_LIBRARIES})
endif()
endif()
target_link_libraries(hejlib ${libraries})
install(TARGETS hejlib DESTINATION ${INSTALL_LIB_DIR})
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Jan 20, 10:58 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4242748
Default Alt Text
(15 KB)
Attached To
rHEJ HEJ
Event Timeline
Log In to Comment