IAP GITLAB

Commit d7c3a493 authored by Ralf Ulrich's avatar Ralf Ulrich Committed by Maximilian Reininghaus

Resolve "WITH_HISTORY not working"

parent 59ccd241
...@@ -193,12 +193,6 @@ if (NOT DEFINED ENV{CI}) ...@@ -193,12 +193,6 @@ if (NOT DEFINED ENV{CI})
add_test (NAME copyright_notices COMMAND ./do-copyright.py WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) add_test (NAME copyright_notices COMMAND ./do-copyright.py WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif (NOT DEFINED ENV{CI}) endif (NOT DEFINED ENV{CI})
#+++++++++++++++++++++++++++++
# Options
#
# HISTORY option selection
option (WITH_HISTORY "Flag to switch on/off HISTORY" ON)
#+++++++++++++++++++++++++++++ #+++++++++++++++++++++++++++++
# Externals # Externals
# #
...@@ -346,13 +340,9 @@ install (DIRECTORY examples DESTINATION share/corsika) ...@@ -346,13 +340,9 @@ install (DIRECTORY examples DESTINATION share/corsika)
add_subdirectory (tools) add_subdirectory (tools)
#+++++++++++++++++++++++++++++++ #+++++++++++++++++++++++++++++++
# #
# final summary output # final summary output
# #
include (FeatureSummary) include (FeatureSummary)
add_feature_info (HISTORY WITH_HISTORY "Full information on cascade history for particles.")
feature_summary (WHAT ALL) feature_summary (WHAT ALL)
...@@ -2,6 +2,30 @@ set (CORSIKA8_VERSION @c8_version@) ...@@ -2,6 +2,30 @@ set (CORSIKA8_VERSION @c8_version@)
@PACKAGE_INIT@ @PACKAGE_INIT@
#+++++++++++++++++++++++++++
# Options
#
option (WITH_HISTORY "Flag to switch on/off HISTORY" ON)
#+++++++++++++++++++++++++++++
# Build types settings
#
# setup coverage build type
set (CMAKE_CXX_FLAGS_COVERAGE "-g --coverage")
set (CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage")
set (CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage")
# set a flag to inform code that we are in debug mode
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
set (ALLOWED_BUILD_TYPES Debug Release MinSizeRel RelWithDebInfo Coverage)
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${ALLOWED_BUILD_TYPES})
set (DEFAULT_BUILD_TYPE "Release")
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set (CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
STRING "Choose the type of build." FORCE)
endif (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
#++++++++++++++++++++++++++++ #++++++++++++++++++++++++++++
# General config and flags # General config and flags
# #
...@@ -37,3 +61,25 @@ message (STATUS "Pythia8 at: @Pythia8_PREFIX@") ...@@ -37,3 +61,25 @@ message (STATUS "Pythia8 at: @Pythia8_PREFIX@")
# #
include ("${CMAKE_CURRENT_LIST_DIR}/corsikaTargets.cmake") include ("${CMAKE_CURRENT_LIST_DIR}/corsikaTargets.cmake")
check_required_components (corsika) check_required_components (corsika)
#+++++++++++++++++++++++++++++++
# add further definitions / options
#
if (WITH_HISTORY)
set_property (
TARGET CORSIKA8::CORSIKA8
APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "WITH_HISTORY"
)
endif (WITH_HISTORY)
#+++++++++++++++++++++++++++++++
#
# final summary output
#
include (FeatureSummary)
add_feature_info (HISTORY WITH_HISTORY "Full information on cascade history for particles.")
feature_summary (WHAT ALL)
...@@ -18,12 +18,15 @@ namespace corsika::setup { ...@@ -18,12 +18,15 @@ namespace corsika::setup {
#ifdef WITH_HISTORY #ifdef WITH_HISTORY
#include <corsika/stack/history/HistoryStackExtension.hpp>
#include <corsika/stack/history/HistorySecondaryProducer.hpp>
/* /*
* the version with history * the version with history
*/ */
using Stack = detail::StackWithHistory; using Stack = detail::StackWithHistory;
template <typename T1, template <typename> typename M2> template <typename T1, template <typename> typename M2>
using StackViewProducer = HistorySecondaryProducer<T1, M2>; using StackViewProducer = history::HistorySecondaryProducer<T1, M2>;
#else // WITH_HISTORY #else // WITH_HISTORY
...@@ -32,7 +35,7 @@ namespace corsika::setup { ...@@ -32,7 +35,7 @@ namespace corsika::setup {
*/ */
using Stack = detail::StackWithGeometry; using Stack = detail::StackWithGeometry;
template <typename T1, template <typename> typename M2> template <typename T1, template <typename> typename M2>
using StackViewProducer = corsika::DefaultSecondaryProducer<T1, M2>; using StackViewProducer = DefaultSecondaryProducer<T1, M2>;
#endif #endif
...@@ -58,7 +61,7 @@ namespace corsika::setup { ...@@ -58,7 +61,7 @@ namespace corsika::setup {
// CHECK with CLANG: setup::Stack::MPIType>; // CHECK with CLANG: setup::Stack::MPIType>;
detail::StackWithHistoryInterface, StackViewProducer>; detail::StackWithHistoryInterface, StackViewProducer>;
#elif defined(__GNUC__) || defined(__GNUG__) #elif defined(__GNUC__) || defined(__GNUG__)
using StackView = make_view<setup::Stack, StackViewProducer>::type; using StackView = MakeView<setup::Stack, StackViewProducer>::type;
#endif #endif
#else // WITH_HISTORY #else // WITH_HISTORY
...@@ -69,7 +72,7 @@ namespace corsika::setup { ...@@ -69,7 +72,7 @@ namespace corsika::setup {
// setup::Stack::MPIType>; // setup::Stack::MPIType>;
setup::detail::StackWithGeometryInterface>; setup::detail::StackWithGeometryInterface>;
#elif defined(__GNUC__) || defined(__GNUG__) #elif defined(__GNUC__) || defined(__GNUG__)
using StackView = corsika::MakeView<setup::Stack>::type; using StackView = MakeView<setup::Stack>::type;
#endif #endif
#endif // WITH_HISTORY #endif // WITH_HISTORY
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment