Skip to content

Commit

Permalink
Merge branch 'testing'
Browse files Browse the repository at this point in the history
* testing:
  Update changelog for 3.8 release
  Bump version numbers
  Update from Kasper develop (25cb1351)
  Update from Kasper develop (3fb2d8a6)
  Update from Kasper develop (1f46fd39)
  Update from Kasper develop (fce0771c)
  Update from Kasper develop (37c373cbfa)
  Fix Docker build issue due to putting sources in `/`
  Update from Kasper develop (20f6089daa)
  Update dependency graphs and requirements
  Update from Kasper develop (9d210e7f3c)
  • Loading branch information
zykure committed Aug 27, 2021
2 parents f012ccb + 2ba3c59 commit 114925c
Show file tree
Hide file tree
Showing 412 changed files with 16,988 additions and 20,383 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ CMakeLists.txt.user*
*.tmp
*.old
*.srctrl*
*.log

/*.vt?
/*.root
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ cmake_install.cmake
/*.sh
/*.gpl
/**/*.egg-info
/*.log

!/setup.sh
21 changes: 14 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,29 @@ When bumping a module version, also provide a date to indicate the last update.

## Current version

The current Kassiopeia version is v3.7 released on May 1, 2020.
The latest update v3.7.7 was released on January 13, 2021.
The current Kassiopeia version is v3.8 released on Aug 27, 2021.
<!--The latest update v3.8.x was released on January 13, 2021.-->

Module versions:
* **Kassiopeia** 3.7.5 (Jan 13, 2021)
* **KEMField** 3.7.5 (Jan 13, 2021)
* **KGeoBag** 3.7.5 (Jan 13, 2021)
* **Kommon** 1.4.1 (Jan 13, 2021)
* **UnitTest** 0.2.5 (Nov 30, 2020)
* **Kassiopeia** 3.8.0 (Aug 27, 2021)
* **KEMField** 3.8.0 (Aug 27, 2021)
* **KGeoBag** 3.8.0 (Aug 27, 2021)
* **Kommon** 1.5.0 (Aug 27, 2021)
* **UnitTest** 0.2.5 (Jun 2, 2021)


<!--
The changelog files can be updated by the script `gen-changelog.sh` in the `Scripts` folder.
Please update the release notes below if a new release is published. Make sure to bump any relevant version numbers.
-->

## Changes in v3.8.0

Kassiopeia v3.8.0 was released on August 27, 2021.
[Details](https://github.com/KATRIN-Experiment/Kassiopeia/releases/tag/v3.8.0)

[*View Changelog*](Changelog/changes-from-v3.7.7-to-v3.8.0.md)

## Changes in v3.7.7

Kassiopeia v3.7.7 was released on January 13, 2021.
Expand Down
145 changes: 87 additions & 58 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
set( CMAKE_MINIMUM_VERSION "3.13.0" )
set( CMAKE_MINIMUM_VERSION "3.14.0" )
cmake_minimum_required( VERSION ${CMAKE_MINIMUM_VERSION} )

# project version
set(KASPER_VERSION_MAJOR 3)
set(KASPER_VERSION_MINOR 7)
set(KASPER_VERSION_PATCH 7)
set(KASPER_VERSION_MINOR 8)
set(KASPER_VERSION_PATCH 0)
set(KASPER_VERSION "${KASPER_VERSION_MAJOR}.${KASPER_VERSION_MINOR}.${KASPER_VERSION_PATCH}")

#project( Kasper VERSION ${KASPER_VERSION} )
project( Kasper )

# Silently try to find major dependencies. This list is not be complete!
# (Somehow, CMake behaves better if this is done in the root scope before adding modules...)
#find_package(Boost COMPONENTS QUIET)
#find_package(HDF5 COMPONENTS CXX QUIET)
#find_package(ROOT QUIET)
find_package(MPI QUIET)
find_package(VTK QUIET)
#project( Kasper )
project( Kasper VERSION ${KASPER_VERSION}
DESCRIPTION "The KATRIN Analysis and Simulations Package"
LANGUAGES CXX )

set( BUILD_SHARED_LIBS ON )
set( Boost_USE_STATIC_LIBS OFF )
set( Boost_USE_MULTITHREADED ON )
set( Boost_USE_STATIC_RUNTIME OFF )

set( CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ standard whose features are requested to build this target" )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
Expand All @@ -28,18 +25,18 @@ set( CMAKE_EXPORT_COMPILE_COMMANDS ON )
# Additional compiler version checks, see https://en.cppreference.com/w/cpp/compiler_support
if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0" )
message(WARNING "Your compiler is unsupported! You need at least GCC 5.0 to build Kasper.")
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1" )
message(FATAL_ERROR "Your compiler is unsupported! You need at least GCC 6.1 to build Kasper.")
endif()
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.4" )
message(WARNING "Your compiler is unsupported! You need at least Clang 3.4 to build Kasper.")
message(FATAL_ERROR "Your compiler is unsupported! You need at least Clang 3.4 to build Kasper.")
endif()
endif()
elseif( CMAKE_SYSTEM_NAME STREQUAL "Darwin" )
if( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0" )
message(WARNING "Your compiler is unsupported! You need at least Clang 10.0 to build Kasper.")
message(FATAL_ERROR "Your compiler is unsupported! You need at least Clang 10.0 to build Kasper.")
endif()
endif()
else()
Expand All @@ -63,17 +60,12 @@ set( CMAKE_BUILD_WITH_INSTALL_RPATH FALSE )
# which point to directories outside the build tree to the install RPATH
set( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE )
if( APPLE )
set(CMAKE_INSTALL_RPATH "@executable_path/../${CMAKE_INSTALL_LIBDIR};@loader_path")
#set( CMAKE_INSTALL_RPATH "@executable_path/../${CMAKE_INSTALL_LIBDIR};@loader_path" )
set( CMAKE_MACOSX_RPATH TRUE )
elseif( UNIX )
set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
set( CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}" )
endif( APPLE )

# the RPATH to be used when installing, but only if it's not a system directory
#LIST( FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" isSystemDir )
#IF( "${isSystemDir}" STREQUAL "-1" )
# set( CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}" )
#ENDIF()


# Flags for all modules, every module should have a flag.

Expand Down Expand Up @@ -102,64 +94,72 @@ endif()
# We like the compiler to be more pedantic than usual :-P
add_compile_options( -Wall -Wextra -Werror )

# Only link in libraries that we actually need (but not for executables since it makes things slow)
set(_target_type "$<TARGET_PROPERTY:TYPE>")
add_link_options( $<IF:$<STREQUAL:"${_target_type}","SHARED_LIBRARY">,LINKER:--as-needed,LINKER:--no-as-needed> )

# Enable some advanced options depending on build type
if (CMAKE_BUILD_TYPE MATCHES Rel)
option( COMPILER_TUNE_OPTIONS "Enable additional tuning options [compiles for local CPU, use with care!]" OFF )
mark_as_advanced(COMPILER_TUNE_OPTIONS)
if( COMPILER_TUNE_OPTIONS )
# These are advanced options for GCC which might improve performance ... or break everything - use with care!
add_compile_options( -march=native -mfpmath=sse -funroll-loops )
endif( COMPILER_TUNE_OPTIONS )
endif()

if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR CMAKE_COMPILER_IS_GNUCXX )
if( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.0" )
# Use -faligned-new flag to trick gcc into using aligned allocators CL types.
# This is only used by KEMField, but required here because of include files.
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-faligned-new>)
endif()

# Enable some advanced options
option( GCC_FORCE_LINKING "Fix linker errors with some GCC versions by adding the --no-as-needed flag" ON )
if( GCC_FORCE_LINKING )
add_link_options( -Wl,--no-as-needed )
endif( GCC_FORCE_LINKING )

if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_COMPILER_IS_GNUCXX )
option( GCC_REDUCE_MEMORY "Significantly reduce GCC memory usage by setting ftrack-macro-expansion=1 (default: 2)" ON )
mark_as_advanced(GCC_REDUCE_MEMORY)
if( GCC_REDUCE_MEMORY )
add_compile_options( -ftrack-macro-expansion=1 )
endif( GCC_REDUCE_MEMORY )

option( GCC_ENABLE_PIPES "Use pipes to speed up compiling with GCC by adding the -pipe flag" ON )
mark_as_advanced(GCC_ENABLE_PIPES)
if( GCC_ENABLE_PIPES )
add_compile_options( -pipe )
endif( GCC_ENABLE_PIPES )

else( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
else( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
# Suppress warnings about unknown warning options. See https://bugs.llvm.org/show_bug.cgi?id=24979
add_compile_options( -Wno-unknown-warning-option )

endif()

# Enable some advanced options (compiler-independent)
option( ENABLE_PROFILING "Enable profiling (gperftools-based, adds '-lprofile' flag to linker calls)" OFF )
mark_as_advanced(ENABLE_PROFILING)
if( ENABLE_PROFILING )
find_library( PROFILER_LIBRARY profiler )
if ( PROFILER_LIBRARY )
add_link_options( -lprofiler )
endif( PROFILER_LIBRARY )
endif( ENABLE_PROFILING )

# Check for memory errors using clang's AddressSanitizer. See https://github.com/google/sanitizers/wiki/AddressSanitizer
option( ENABLE_SANITIZE_ADDRESSES "Enable memory error detection (asan-based, adds '-fsanitize=address' flag)" OFF )
mark_as_advanced(ENABLE_SANITIZE_ADDRESSES)
if( ENABLE_SANITIZE_ADDRESSES )
add_compile_options( -O1 -g -fno-omit-frame-pointer -fsanitize=address -fno-optimize-sibling-calls )
add_link_options( -g -fno-omit-frame-pointer -fsanitize=address )
if( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
# See https://github.com/google/sanitizers/issues/1017
add_compile_options( -mllvm -asan-use-private-alias=1 )
endif()
endif( ENABLE_SANITIZE_ADDRESSES )

# Force coloured compiler output (useful for Ninja builds)
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
option( FORCE_COLOURED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF )
if( NOT DEFINED FORCE_COLOURED_OUTPUT AND "${CMAKE_GENERATOR}" MATCHES "Ninja" )
if( NOT DEFINED FORCE_COLOURED_OUTPUT AND CMAKE_GENERATOR MATCHES "Ninja" )
message(STATUS "Building with Ninja - enabling coloured compiler output.")
set( FORCE_COLOURED_OUTPUT ON CACHE BOOL "" FORCE )
endif()
if( FORCE_COLOURED_OUTPUT )
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
add_compile_options( -fdiagnostics-color=always )
elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
add_compile_options( -fcolor-diagnostics )
endif()
endif( FORCE_COLOURED_OUTPUT )
Expand All @@ -169,19 +169,48 @@ mark_as_advanced( CLEAR CMAKE_VERBOSE_MAKEFILE )


# Global dependency options
option( KASPER_USE_BOOST "Build Boost dependent modules" ON )
option( KASPER_USE_ROOT "Build ROOT dependent modules" ON )
option( KASPER_USE_GSL "Build GSL dependent modules" OFF )
option( KASPER_USE_VTK "Build VTK dependent modules" OFF )
#find_package(Boost QUIET)
#option( KASPER_USE_BOOST "Build Boost dependent modules" ${Boost_FOUND} )
set(KASPER_USE_BOOST ON)

# Advanced options mainly for testing
option( KASPER_EXPERIMENTAL "Enable some experimental features" OFF )
if( KASPER_EXPERIMENTAL )
option( KASPER_USE_TBB "Build TBB dependent modules" OFF )
if( KASPER_USE_TBB )
message( "WARNING: Enabling TBB can produce inconsistent or wrong results in KaFit. It is strongly recommended to leave this option disabled until further investigation." )
endif()
endif( KASPER_EXPERIMENTAL )
find_package(ROOT QUIET)
if(ROOT_FOUND AND NOT DEFINED KASPER_USE_ROOT)
message("ROOT was found and enabled automatically. Set KASPER_USE_ROOT=OFF to change this.")
endif()
option( KASPER_USE_ROOT "Build ROOT dependent modules" ${ROOT_FOUND} )

find_package(GSL QUIET)
if(GSL_FOUND AND NOT DEFINED KASPER_USE_GSL)
message("GSL was found and enabled automatically. Set KASPER_USE_GSL=OFF to change this.")
endif()
option( KASPER_USE_GSL "Build GSL dependent modules" ${GSL_FOUND} )

find_package(VTK QUIET)
if(VTK_FOUND AND NOT DEFINED KASPER_USE_VTK)
message("VTK was found and enabled automatically. Set KASPER_USE_VTK=OFF to change this.")
endif()
option( KASPER_USE_VTK "Build VTK dependent modules" ${VTK_FOUND} )

option( KASPER_USE_XGBOOST"Build XGBOOST dependent modules" OFF )

# Make sure that version requirements are fulfilled
if( KASPER_USE_BOOST )
set(BOOST_MINIMUM_VERSION "1.65")
find_package(Boost ${BOOST_MINIMUM_VERSION} REQUIRED)
endif( KASPER_USE_BOOST )

if( KASPER_USE_ROOT )
set(ROOT_MINIMUM_VERSION "6.16")
find_package(ROOT ${ROOT_MINIMUM_VERSION} CONFIG REQUIRED)
endif( KASPER_USE_ROOT )

if( KASPER_USE_GSL )
find_package( GSL REQUIRED )
endif( KASPER_USE_GSL )

if( KASPER_USE_VTK )
find_package(VTK REQUIRED)
endif( KASPER_USE_VTK )

# Make sure all dependencies are being built
# Every module must be listed before its dependencies and activate ONLY its
Expand Down Expand Up @@ -210,7 +239,6 @@ if( BUILD_KGEOBAG )
message("KGeoBag requires GSL to be enabled in Kasper (activated automatically)" )
endif()
set( KASPER_USE_GSL ON CACHE BOOL "(Required)" FORCE )
set( KASPER_USE_BOOST ON CACHE BOOL "(Required)" FORCE )
endif( BUILD_KGEOBAG )

# Build modules
Expand All @@ -221,14 +249,17 @@ if( BUILD_KOMMON )
endif()

if( BUILD_KGEOBAG )
# needs Kommon
add_subdirectory( KGeoBag )
endif()

if( BUILD_KEMFIELD )
# needs Kommon, KGeoBag
add_subdirectory( KEMField )
endif()

if( BUILD_KASSIOPEIA )
# needs Kommon, KGeoBag, KEMField
add_subdirectory( Kassiopeia )
endif()

Expand Down Expand Up @@ -271,8 +302,6 @@ message("\n Build was configured. Run `${CMAKE_MAKE_PROGRAM_NAME}` to start th

# Install common project files

install( EXPORT KasperTargets DESTINATION ${CMAKE_INSTALL_DIR}/${PROJECT_NAME} )

configure_file( KasperVersion.h.in ${CMAKE_CURRENT_BINARY_DIR}/KasperVersion.h @ONLY )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/KasperVersion.h DESTINATION ${INCLUDE_INSTALL_DIR} )

Expand Down
Loading

0 comments on commit 114925c

Please sign in to comment.