IAP GITLAB

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • AirShowerPhysics/corsika
  • rulrich/corsika
  • AAAlvesJr/corsika
  • Andre/corsika
  • arrabito/corsika
  • Nikos/corsika
  • olheiser73/corsika
  • AirShowerPhysics/papers/corsika
  • pranav/corsika
9 results
Show changes
Commits on Source (3334)
Showing
with 956 additions and 1195 deletions
---
Language: Cpp
ColumnLimit: 90 # line width, 0: respect programmer's choice
TabWidth: 8
UseTab: Never
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
......@@ -16,7 +21,6 @@ AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
......@@ -36,7 +40,7 @@ BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
# BreakInheritanceListBeforeComma: true
ColumnLimit: 90
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
......@@ -53,6 +57,7 @@ IncludeCategories:
Priority: 2
- Regex: '.*'
Priority: 3
SortIncludes: false
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
......@@ -72,7 +77,6 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
......@@ -84,6 +88,8 @@ SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 8
UseTab: Never
# If true, always break after the template<...> of a template declaration.
AlwaysBreakTemplateDeclarations: true
...
*.inl gitlab-language=c++
\ No newline at end of file
*gcov
**/*~
**/*.bak
**/*log
build/
install/
.vscode/
Framework/Particles/GeneratedParticleProperties.inc
flymd.html
flymd.md
Testing
tags
Environment/GeneratedMediaProperties.inc
CMakeUserPresets.json
corsika/framework/core/GeneratedParticleClasses.inc
corsika/framework/core/GeneratedParticleProperties.inc
corsika/framework/core/particle_db.pkl
corsika/media/GeneratedMediaProperties.inc
corsika/modules/epos/Generated.inc
corsika/modules/fluka/Generated.inc
corsika/modules/qgsjetII/Generated.inc
corsika/modules/sibyll/Generated.inc
corsika/modules/sophia/Generated.inc
conan_cmake/
corsika-cmake.sh
image: corsika/devel:u-18.04
variables:
GIT_STRATEGY: $CORSIKA8_GIT_STRATEGY # clone: fresh clone, fetch: update
GIT_SSL_NO_VERIFY: "1"
GIT_DEPTH: "2"
# to re-use clones also in different forks
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_NAME
## Runtime options for sanitizers
# (detect_leaks=0 because leak detection doesn't work in CI, but you can
# try to test with leak detection locally by using detect_leaks=1)
UBSAN_OPTIONS: "print_stacktrace=1"
LSAN_OPTIONS: "log_threads=1"
ASAN_OPTIONS: "detect_leaks=0:detect_stack_use_after_return=1"
# location of AirShowerPhysics/corsika-data
CORSIKA_DATA: "${CI_PROJECT_DIR}/modules/data" # the git submodule
corsika_DIR: "${CI_PROJECT_DIR}/build/install" # for cmake to find corsikaConfig.cmake
# _alternatively_ corsika-data can be downloaded as submodule:
GIT_SUBMODULE_STRATEGY: recursive # none: we get the submodules in before_script,
# normal: get submodules automatically
CTEST_OUTPUT_ON_FAILURE: 1
PIP_PARTICLE_VERSION: "0.25.1"
#
# multi-step pipeline for each commit
#
# Note: "Draft/WIP:" merge request, non-Draft/non-WIP merge requests and "Ready for Code Review" MR are all
# handled explicitly
#
stages:
- quality
- config
- build_test
- build_test_example
- python
- optional
##########################################
########### CODE QUALITY CHECK ###########
##########################################
build:
stage: build
##########################################################
check-copyrights:
image: corsika/devel:u-22.04
stage: quality
tags:
- corsika
script:
- mkdir build
- cd build
- cmake ..
- cmake --build . -- -j 4
- ctest -j4 -V >& test.log
after_script:
- cd build
- ls
- gzip -v -9 -S .gz test.log
- pwd
- ./do-copyright.py
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
allow_failure: true
##########################################################
check-clang-format:
image: corsika/devel:clang-8
stage: quality
tags:
- corsika
script:
- ./do-clang-format.py --all
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
allow_failure: true
check-python-quality:
image: corsika/devel:u-22.04
stage: quality
tags:
- corsika
script:
- cd ${CI_PROJECT_DIR}/python # change into the Python directory
- pip3 install --user -e '.[test]' # install the package + test deps
- python3 --version
- python3 -m black -t py37 --check corsika tests
- python3 -m flake8 -v corsika tests
- python3 -m isort --atomic --check-only corsika tests
- python3 -m mypy corsika
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
allow_failure: true
##########################################
################# CONFIG #################
##########################################
##########################################################
# the generic config template job
# job/stage to just prepare cmake
.config:
stage: config
tags:
- corsika
script:
- pip3 install conan --upgrade --user
- pip3 install particle==${PIP_PARTICLE_VERSION}
- pip3 install numpy
- mkdir -p ${CI_PROJECT_DIR}/build
- cd ${CI_PROJECT_DIR}/build
- ${CI_PROJECT_DIR}/conan-install.sh -s .. -d
- ${CI_PROJECT_DIR}/corsika-cmake.sh -c "-DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/build/install -DUSE_Pythia8_C8=C8"
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
artifacts:
expire_in: 1 week
paths:
- build/test.log.gz
when: on_failure
expire_in: 3 days
paths:
- ${CI_PROJECT_DIR}/build/CMakeFiles/CMakeOutput.log
# config for gcc
config-u-22_04:
extends: .config
image: corsika/devel:u-22.04
# config for clang
config-clang-14:
extends: .config
image: corsika/devel:clang-14
##########################################
############### BUILD-TEST ###############
##########################################
##########################################################
# the generic build_test template job
# normal pipeline for each commit
.build_test:
stage: build_test
tags:
- corsika
script:
- pip3 install conan --upgrade --user
- pip3 install particle==${PIP_PARTICLE_VERSION}
- pip3 install numpy
- mkdir -p ${CI_PROJECT_DIR}/build
- cd ${CI_PROJECT_DIR}/build
- ${CI_PROJECT_DIR}/conan-install.sh -s .. -d
- ${CI_PROJECT_DIR}/corsika-cmake.sh -c "-DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/build/install -DUSE_Pythia8_C8=C8"
- cmake --build . -- -j4
- set -o pipefail
- ctest -j4
rules:
- if: '$CI_MERGE_REQUEST_ID && ($CI_MERGE_REQUEST_TITLE =~ /^Draft:/ || $CI_MERGE_REQUEST_TITLE =~ /^WIP:/)'
allow_failure: false
- if: $CI_MERGE_REQUEST_ID
when: manual
allow_failure: true
artifacts:
when: always
expire_in: 3 days
paths:
- ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
reports:
junit:
- build/test_outputs/junit*.xml
- ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
# build_test for gcc
build_test-u-22_04:
extends: .build_test
image: corsika/devel:u-22.04
needs:
- job: config-u-22_04
artifacts: false
pages:
stage: build
# build_test for clang
build_test-clang-14:
extends: .build_test
image: corsika/devel:clang-14
needs:
- job: config-clang-14
artifacts: false
##########################################
########## BUILD-TEST-EXAMPLE ###########
##########################################
##########################################################
# generic example template job
# normal pipeline for each commit
.build_test_example:
stage: build_test_example
tags:
- corsika
script:
- mkdir build
- cd build
- cmake ..
- make doxygen
- mkdir .public
- cp -r Documentation/Doxygen/html .public/
- mv .public ../public
- pip3 install conan --upgrade --user
- pip3 install particle==${PIP_PARTICLE_VERSION}
- pip3 install numpy
- mkdir -p ${CI_PROJECT_DIR}/build
- cd ${CI_PROJECT_DIR}/build
- ${CI_PROJECT_DIR}/conan-install.sh -s .. -d
- ${CI_PROJECT_DIR}/corsika-cmake.sh -c "-DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/build/install -DUSE_Pythia8_C8=C8"
- cmake --build . -- VERBOSE=1 -j4
- set -o pipefail
- ctest -j4
- cmake --install .
- mkdir -p ${CI_PROJECT_DIR}/build/build_examples
- cd ${CI_PROJECT_DIR}/build/build_examples
- export corsika_DIR=${CI_PROJECT_DIR}/build/install
- export corsika_CONAN_DEPENDENCIES=${CI_PROJECT_DIR}/build/install/lib/cmake/dependencies
- cmake -DCMAKE_TOOLCHAIN_FILE=${corsika_CONAN_DEPENDENCIES}/conan_toolchain.cmake -DCMAKE_PREFIX_PATH=${corsika_CONAN_DEPENDENCIES} -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Debug ../install/share/corsika/examples
- cmake --build . -- -j2
- cmake --build . --target run_examples -- -j2
- export EXE=${CI_PROJECT_DIR}/build/install/bin/c8_air_shower # Run the example scripts
- export OUTPUT_DIR=${CI_PROJECT_DIR}/build/build_examples/example_outputs/
- export CMD="$EXE --seed 1234 --energy 1e3 -p 2212 --disable-interaction-histograms --compress --filename $OUTPUT_DIR/c8_air_shower_output"
- echo "Running... $CMD"
- $CMD
rules:
- if: '$CI_MERGE_REQUEST_ID && ($CI_MERGE_REQUEST_TITLE =~ /^Draft:/ || $CI_MERGE_REQUEST_TITLE =~ /^WIP:/)'
when: manual
allow_failure: true
- if: $CI_COMMIT_BRANCH
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_TAG
when: manual
allow_failure: true
artifacts:
when: always
expire_in: 2 days
reports:
junit:
- ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
paths:
- public
only:
- tags
- triggers
- schedules
# code_quality:
# image: docker:stable
# variables:
# DOCKER_DRIVER: overlay2
# allow_failure: true
# services:
# - docker:stable-dind
# script:
# - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
# - docker run
# --env SOURCE_CODE="$PWD"
# --volume "$PWD":/code
# --volume /var/run/docker.sock:/var/run/docker.sock
# "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
# artifacts:
# reports:
# codequality: gl-code-quality-report.json
- ${CI_PROJECT_DIR}/build/build_examples/example_outputs/radio_em_shower_outputs #python examples need this
- ${CI_PROJECT_DIR}/build/build_examples/example_outputs/c8_air_shower_output.tar #python examples need this
- ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
- ${CI_PROJECT_DIR}/build/CMakeCache.txt #python tests need this
- ${CI_PROJECT_DIR}/build #/bin #python tests need this
# build_test_example for gcc
build_test_example-u-22_04:
extends: .build_test_example
image: corsika/devel:u-22.04
needs:
- job: config-u-22_04
artifacts: false
# build_test_example for clang
build_test_example-clang-14:
extends: .build_test_example
image: corsika/devel:clang-14
needs:
- job: config-clang-14
artifacts: false
##########################################
################ OPTIONAL ################
##########################################
##########################################################
# generic release template job
# optional release pipeline for each commit
.release:
stage: optional
tags:
- corsika
script:
- pip3 install conan --upgrade --user
- pip3 install particle==${PIP_PARTICLE_VERSION}
- pip3 install numpy
- mkdir -p ${CI_PROJECT_DIR}/build
- cd ${CI_PROJECT_DIR}/build
- ${CI_PROJECT_DIR}/conan-install.sh -s .. -r
- ${CI_PROJECT_DIR}/corsika-cmake.sh -c "-DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/build/install -DUSE_Pythia8_C8=C8"
- cmake --build . -- -j4
- set -o pipefail
- ctest -j4
- cmake --install .
- mkdir -p ${CI_PROJECT_DIR}/build/build_examples
- cd ${CI_PROJECT_DIR}/build/build_examples
- export corsika_DIR=${CI_PROJECT_DIR}/build/install
- export corsika_CONAN_DEPENDENCIES=${CI_PROJECT_DIR}/build/install/lib/cmake/dependencies
- cmake -DCMAKE_TOOLCHAIN_FILE=${corsika_CONAN_DEPENDENCIES}/conan_toolchain.cmake -DCMAKE_PREFIX_PATH=${corsika_CONAN_DEPENDENCIES} -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release ../install/share/corsika/examples
- cmake --build . -- VERBOSE=1 -j4
- cmake --build . --target run_examples -- -j4
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /Ready for Code Review/' # run on merge requests, if label 'Ready for Code Review' is set
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
allow_failure: true
- if: $CI_MERGE_REQUEST_ID
when: manual
allow_failure: true
- if: $CI_COMMIT_TAG
when: manual
allow_failure: true
artifacts:
when: always
expire_in: 3 days
reports:
junit:
- ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
paths:
- ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
# release for gcc
release-full-u-22_04:
extends: .release
image: corsika/devel:u-22.04
needs:
- job: config-u-22_04
artifacts: false
# release for clang
release-full-clang-14:
extends: .release
image: corsika/devel:clang-14
needs:
- job: config-clang-14
artifacts: false
##########################################
################ COVERAGE ################
##########################################
##########################################################
# the coverage generation should either run when manually requested, OR always on the master
coverage:
image: corsika/devel:u-22.04
needs:
- job: config-u-22_04
artifacts: false
stage: optional
tags:
- corsika
script:
- pip3 install conan --upgrade --user
- pip3 install particle==${PIP_PARTICLE_VERSION}
- pip3 install numpy
- mkdir -p ${CI_PROJECT_DIR}/build
- cd ${CI_PROJECT_DIR}/build
- ${CI_PROJECT_DIR}/conan-install.sh -s .. -d
- ${CI_PROJECT_DIR}/corsika-cmake.sh -c "-DCOVERAGE_BUILD=True -DUSE_Pythia8_C8=C8"
- cmake --build . -- -j4
- ctest -j4
- cmake --build . --target coverage
- tar czf coverage-report.tar.gz coverage-report
coverage: '/^.*lines\.+:\s(.*\%)\s/'
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /Ready for Code Review/' # run on merge requests, if label 'Ready for Code Review' is set
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_MERGE_REQUEST_ID
when: manual
allow_failure: true
- if: $CI_COMMIT_TAG
when: manual
allow_failure: true
artifacts:
when: always
expire_in: 3 month
paths:
- ${CI_PROJECT_DIR}/build/coverage-report.tar.gz
##########################################
################# SANITY #################
##########################################
##########################################################
sanity:
image: corsika/devel:u-22.04
needs:
- job: config-u-22_04
artifacts: false
stage: optional
tags:
- corsika
script:
- pip3 install conan --upgrade --user
- pip3 install particle==${PIP_PARTICLE_VERSION}
- pip3 install numpy
- mkdir -p ${CI_PROJECT_DIR}/build
- cd ${CI_PROJECT_DIR}/build
- ${CI_PROJECT_DIR}/conan-install.sh -s .. -d
- ${CI_PROJECT_DIR}/corsika-cmake.sh -c "-DWITH_CORSIKA_SANITIZERS_ENABLED=ON -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/build/install -DUSE_Pythia8_C8=C8"
- cmake --build . -- -j4
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /Ready for Code Review/' # run on merge requests, if label 'Ready for Code Review' is set
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
allow_failure: true
- if: $CI_MERGE_REQUEST_ID
when: manual
allow_failure: true
- if: $CI_COMMIT_TAG
when: manual
allow_failure: true
##########################################
################# Python #################
##########################################
##########################################################
# template for all Python jobs
.python:
stage: python
tags:
- corsika
script:
- cd ${CI_PROJECT_DIR}/python # change into the Python directory
- pip3 install --user -e '.[test]' # install the package + test deps
- python3 --version
- python3 -m mypy corsika
- python3 -m isort --atomic --check-only corsika tests
- python3 -m black -t py37 corsika tests
- python3 -m flake8 corsika tests
- python3 -m pytest --cov=corsika tests
coverage: '/^TOTAL\s*\d+\s*\d+\s*(.*\%)/'
python-tests:
extends: .python
image: corsika/devel:u-22.04
needs:
- job: build_test_example-u-22_04
artifacts: true
artifacts:
when: always
expire_in: 1 month
paths:
- ${CI_PROJECT_DIR}/python/python-test.log
allow_failure: false
python-examples:
stage: python
tags:
- corsika
image: corsika/devel:u-22.04
needs:
- job: build_test_example-u-22_04
artifacts: true
artifacts:
when: always
expire_in: 1 month
paths:
- ${CI_PROJECT_DIR}/python/examples/example_plots
script:
- export EXAMPLE_SHOWER=${CI_PROJECT_DIR}/build/build_examples/example_outputs/c8_air_shower_output.tar
- cd ${CI_PROJECT_DIR}/python
- pip3 install --user -e '.[test,examples]'
- cd ${CI_PROJECT_DIR}/python/examples
- python3 particle_distribution.py --input-dir $EXAMPLE_SHOWER
- python3 shower_profile.py --input-dir $EXAMPLE_SHOWER
- python3 first_interactions.py --input-dir $EXAMPLE_SHOWER
- export EXAMPLE_RADIO_SHOWER_DIR=${CI_PROJECT_DIR}/build/build_examples/example_outputs/radio_em_shower_outputs
- python3 radio_emission.py --input-dir $EXAMPLE_RADIO_SHOWER_DIR
Issues: Closes #....
The code approval procedure is described in the wiki: [Code approval procedure wiki](https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/-/wikis/Code-Approval-Procedure)
- [ ] The MR is without `WIP/Draft` status
- [ ] Make sure the most recent CI jobs (config, quality, build_test_example) all run fine with no failures
- if "check clang-format" failed: the code contributor has to run `./do-clang-format.py --apply` eventually with the `--all` option
- if "check copyright" failed the code contributor has to run`./do-copyright.py --add=20xy`
- [ ] Make sure also the jobs with MR-label `ready for code review` succeed. This includes the optional jobs, in particular 'coverage', 'release-full-clang-14", "release-full-u-22_04" and make sure no problems occur. You may have to trigger a pipeline manually to check this.
- [ ] Check in the "coverage" job output that the coverage did not decrease. It should always stay, or increase. If it decreased --> ask contributor to add further needed unit tests, and check coverage report.
- On the MR page, open the "Open in Web IDE" tool
- [ ] Check if the provided solution solves the Issue, discuss on gitlab
- [ ] Check that all changes are actually related to the issue
- [ ] There are no debug statements left, not even commented out
- [ ] Check all changes for coding rules and guidelines
- When all above is done:
- **Add MR label "Code Review Finished"**
[submodule "modules/data"]
path = modules/data
url = ../../AirShowerPhysics/corsika-data.git
branch = master
shallow = true
[submodule "modules/conex"]
path = modules/conex/cxroot
url = ../../AirShowerPhysics/cxroot.git
branch = master
shallow = true
Maximilian Reininghaus, maximilian.reininghaus@kit.edu
Ralf Ulrich, ralf.ulrich@kit.edu
Felix Riehn, friehn@lip.pt
* milestone1 release: So 7. Okt 15:51:07 CEST 2018
#
# (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
#
# See file AUTHORS for a list of contributors.
#
# This software is distributed under the terms of the 3-clause BSD license.
# See file LICENSE for a full version of the license.
#
cmake_minimum_required (VERSION 3.9)
#+++++++++++++++++++++++++++++
# project name
# version is: "8.major.minor.patch"
# major: API changes
# minor: no API changes
# patch: bug fix and small improvements
#
set (c8_version 8.0.0.0)
project (
corsika
VERSION 8.0.0
DESCRIPTION "CORSIKA C++ project"
VERSION ${c8_version}
DESCRIPTION "CORSIKA C++ project (alpha status)"
LANGUAGES CXX
)
# as long as there still are modules using it:
enable_language (Fortran)
#+++++++++++++++++++++++++++++
# for pre-defined standard path
#
include (GNUInstallDirs)
#+++++++++++++++++++++++++++++
# prevent in-source builds and give warning message
#
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
message (FATAL_ERROR "In-source builds are disabled.
Please create a build-dir and use `cmake <source-dir>` inside it.
NOTE: cmake will now create CMakeCache.txt and CMakeFiles/*.
You must delete them, or cmake will refuse to work.")
endif ()
#++++++++++++++++++++++++++++
# cmake version-specific settings
#
# https://cmake.org/cmake/help/latest/policy/CMP0079.html
if (POLICY CMP0079)
cmake_policy (SET CMP0079 NEW)
endif ()
# Download timestamp for external modules
if (POLICY CMP0135)
cmake_policy (SET CMP0135 OLD)
endif ()
# AUtomatically add extensions to filenames if needed (old behaviour)
if (POLICY CMP0115)
cmake_policy (SET CMP0115 OLD)
endif ()
#+++++++++++++++++++++++++++++
# warn user if system is not UNIX
#
if (NOT UNIX)
message (FATAL_ERROR "| CORSIKA8 > This is an unsupported system.")
endif ()
#+++++++++++++++++++++++++++++
# cmake path dir, and cmake config
#
set (CORSIKA8_CMAKE_DIR "${PROJECT_SOURCE_DIR}/cmake")
set (CMAKE_MODULE_PATH "${CORSIKA8_CMAKE_DIR}" ${CMAKE_MODULE_PATH})
if(DEFINED CONAN_CMAKE_DIR)
list(APPEND CMAKE_MODULE_PATH "${CONAN_CMAKE_DIR}")
endif(DEFINED CONAN_CMAKE_DIR)
set (CMAKE_VERBOSE_MAKEFILE OFF) # this can be done with `make VERBOSE=1`
# ignore many irrelevant Up-to-date messages during install
set (CMAKE_INSTALL_MESSAGE LAZY)
# directory for local cmake modules
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
include (CorsikaUtilities) # a few cmake function
#+++++++++++++++++++++++++++++
# Extra cmake functions for registering and running tests
#
include (corsikaUtilities) # extra cmake functions
#+++++++++++++++++++++++++++++
# Setup hardware and infrastructure dependent defines, and general settings
#
include (corsikaDefines)
#+++++++++++++++++++++++++++++
# check if compiler is C++17 compliant
#
include (CheckCXXCompilerFlag)
check_CXX_compiler_flag ("-std=c++17" COMPILER_SUPPORTS_CXX17)
if (NOT COMPILER_SUPPORTS_CXX17)
message (FATAL "| CORSIKA8 > The compiler ${CMAKE_CXX_COMPILER} has no C++17 support. Please use a different C++ compiler.")
endif ()
# set CXX compile flags and options and warning settings
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_EXTENSIONS OFF)
enable_testing ()
set (CTEST_OUTPUT_ON_FAILURE 1)
# Set a default build type if none was specified
set(default_build_type "Release")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(default_build_type "Debug")
endif()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as no other 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(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
#+++++++++++++++++++++++++++++
# Compiler and linker flags, settings
#
# enable warnings and disallow non-standard language
set(CMAKE_CXX_FLAGS "-Wall -pedantic -Wextra -Wno-ignored-qualifiers")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g") # -O2 would not trade speed for size, neither O2/3 use fast-math
set(CMAKE_Fortran_FLAGS "-std=legacy")
# configure the various build types here, too
# FYI: optimizer flags: -O2 would not trade speed for size, neither O2/3 use fast-math
# debug: O0, relwithdebinfo: 02, release: O3, minsizerel: Os (all defaults)
set (CMAKE_CXX_FLAGS "-Wall -pedantic -Wextra -Wno-ignored-qualifiers")
if (CORSIKA_SCL_CXX)
add_definitions (-D_GLIBCXX_USE_CXX11_ABI=0)
endif()
# clang produces a lot of unecessary warnings without this:
add_compile_options("$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-nonportable-include-path>")
add_compile_options (
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-nonportable-include-path>
)
# COAST - interface
if (WITH_COAST)
message(STATUS "Compiling CORSIKA8 for the use with COAST/corsika7.")
add_compile_options("-fPIC")
endif()
#+++++++++++++++++++++++++++++
# Setup external dependencies.
#
###
# unit testing coverage, does not work yet
#include (CodeCoverage)
##set(COVERAGE_LCOV_EXCLUDES 'Documentation/*')
##setup_target_for_coverage(${PROJECT_NAME}_coverage ${PROJECT_TEST_NAME} coverage)
#SETUP_TARGET_FOR_COVERAGE_GCOVR_HTML (
# NAME corsika_coverage
# EXECUTABLE ctest
# #-j ${PROCESSOR_COUNT}
# # DEPENDENCIES corsika
# )
#add_custom_target (corsika_pre_build)
#add_custom_command (TARGET corsika_pre_build PRE_BUILD COMMAND "${PROJECT_SOURCE_DIR}/pre_compile.py")
find_package (Pythia8) # optional
find_package (Eigen3 REQUIRED)
#find_package (HDF5) # not yet needed
# order of subdirectories
add_subdirectory (ThirdParty)
#add_subdirectory (Utilities)
add_subdirectory (Framework)
add_subdirectory (Environment)
add_subdirectory (Stack)
add_subdirectory (Setup)
add_subdirectory (Processes)
add_subdirectory (Documentation)
add_subdirectory (Main)
add_subdirectory (Tools)
if (WITH_COAST)
add_subdirectory (COAST)
endif()
#
# add cnpy temporarily. As long as SaveBoostHistogram does not save to parquet directly
#
add_subdirectory (externals/cnpy)
#+++++++++++++++++++++++++++++
# Coverage
#
# targets and settings needed to generate coverage reports
#if (CMAKE_BUILD_TYPE STREQUAL Coverage)
SET(COVERAGE_BUILD OFF CACHE BOOL "Activate coverage build")
if( COVERAGE_BUILD AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
message(INFO "\n|==========> COVERAGE TARGET ACTIVATED.\n")
set (c8_lcov_download_url "https://github.com/linux-test-project/lcov/releases/download")
set (c8_lcov_version "1.16")
set (c8_lcov_install_dir "${CMAKE_BINARY_DIR}/lcov")
include(ExternalProject)
ExternalProject_Add(lcov
URL ${c8_lcov_download_url}/v${c8_lcov_version}/lcov-${c8_lcov_version}.tar.gz
DOWNLOAD_NO_EXTRACT 0
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND make -C <SOURCE_DIR> install PREFIX=${c8_lcov_install_dir}
)
find_package (Perl REQUIRED)
# compile coverage under -O0 to avoid any optimization, function elimation etc.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 --coverage")
# search for local lcov
find_program (c8_lcov_bin lcov)
if (NOT c8_lcov_bin)
set (c8_lcov_bin "${c8_lcov_install_dir}/bin/lcov")
message ("use C8 version of lcov ${c8_lcov_bin}")
endif ()
# search for local genhtml
find_program (c8_genhtml_bin genhtml)
if (NOT c8_genhtml_bin)
set (c8_genhtml_bin "${c8_lcov_install_dir}/bin/genhtml")
message ("use C8 version of genhtml ${c8_genhtml_bin}")
endif ()
set (GCOV gcov CACHE STRING "gcov executable" FORCE)
# collect coverage data
add_custom_command (
OUTPUT raw-coverage.info
COMMAND ${CMAKE_COMMAND} -E echo "Note: you need to run ctest at least once to generate the coverage data"
COMMAND ${c8_lcov_bin} --gcov-tool=${GCOV} --rc lcov_branch_coverage=1
--directory . --capture --output-file raw-coverage.info
)
# remove uninteresting entries
add_custom_command (
OUTPUT coverage.info
COMMAND ${c8_lcov_bin} -q --remove raw-coverage.info "*/usr/*" "/usr/*" --output-file coverage2.info
COMMAND ${c8_lcov_bin} --remove coverage2.info
"*/externals/*" "*/tests/*" "*/sibyll2.3d.cpp" "*/.conan/*"
"*/include/Pythia8/*" "*/install/*"
"${CMAKE_SOURCE_DIR}/modules/*" "${CMAKE_BINARY_DIR}/modules/*"
"*/cxroot/*" "*/.conan2/*" "/boost/*"
--output-file coverage.info
COMMAND ${CMAKE_COMMAND} -E remove coverage2.info
DEPENDS raw-coverage.info
)
# generate html report
add_custom_command (
OUTPUT coverage-report
COMMAND ${c8_genhtml_bin} --branch-coverage --show-details --title "CORSIKA 8 test coverage" --legend --demangle-cpp coverage.info -o coverage-report
DEPENDS coverage.info
)
add_custom_target (coverage DEPENDS coverage-report)
endif ()
#+++++++++++++++++++++++++++++
# CTest config
#
enable_testing ()
if (${CMAKE_VERSION} VERSION_LESS "3.12.0")
list (APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")
else (${CMAKE_VERSION} VERSION_LESS "3.12.0")
set (CTEST_OUTPUT_ON_FAILURE 1) # this is for new versions of cmake
endif (${CMAKE_VERSION} VERSION_LESS "3.12.0")
set (CTEST_CUSTOM_COVERAGE_EXCLUDE "./tests/" "./examples/" "./modules/" "test*.(hpp/cpp)$")
# include this test only if NOT run on gitlab-ci; On CI this is a dedicated job:
if (NOT DEFINED ENV{CI})
# add call to ./do-copyright.py to run as unit-test-case
add_test (NAME copyright_notices COMMAND ./do-copyright.py WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif (NOT DEFINED ENV{CI})
#+++++++++++++++++++++++++++++
# Externals
#
set (Python_ADDITIONAL_VERSIONS 3)
find_package (PythonInterp 3 REQUIRED)
#+++++++++++++++++++++++++++++++
# exporting of CMake targets
#
include (CMakePackageConfigHelpers)
# list of targets that will be INSTALLed and EXPORTed
# Important: all those targets must be individually INSTALLed with "EXPORT CORSIKA8PublicTargets"
set (public_CORSIKA8_targets CORSIKA8)
#+++++++++++++++++++++++++++++
# CORSIKA8
#
add_library (CORSIKA8 INTERFACE)
set_target_properties (
CORSIKA8
PROPERTIES
INTERFACE_CORSIKA8_MAJOR_VERSION 0
COMPATIBLE_INTERFACE_STRING CORSIKA8_MAJOR_VERSION
)
target_include_directories (
CORSIKA8
INTERFACE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
)
# since CORSIKA8 is a header only library we must specify all link dependencies here:
find_package(Boost COMPONENTS filesystem REQUIRED)
find_package(CLI11 REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(spdlog REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(Arrow REQUIRED)
find_package(PROPOSAL REQUIRED)
find_package(Catch2 REQUIRED)
target_link_libraries (
CORSIKA8
INTERFACE
BZip2::BZip2
Boost::filesystem
CLI11::CLI11
Eigen3::Eigen
spdlog::spdlog
yaml-cpp::yaml-cpp
Parquet::parquet_static
PROPOSAL::PROPOSAL
cnpy # for SaveBoostHistogram
)
# "src" is needed, since some headers (namely GeneratedParticleProperties.inc ec.) are produced by python script from e.g. ParticleData.xml
add_subdirectory (src)
add_subdirectory (documentation)
#+++++++++++++++++++++++++++++
# = Add of subdirectories =
#
#+++++++++++++++++++++++++++++
# modules
#
set (CORSIKA_DATA_WITH_TEST ON) # we want to run the corsika-data unit test
add_subdirectory (modules/data) # this is corsika-data (submodule)
add_subdirectory (modules/common)
add_subdirectory (modules/pythia8)
add_subdirectory (modules/sibyll)
add_subdirectory (modules/sophia)
add_subdirectory (modules/qgsjetII)
add_subdirectory (modules/urqmd)
add_subdirectory (modules/conex)
add_subdirectory (modules/epos)
add_subdirectory (modules/tauola)
add_subdirectory (modules/fluka)
#
#+++++++++++++++++++++++++++++++
# standard applications
#
add_subdirectory(applications)
#+++++++++++++++++++++++++++++++
# unit testing
#
add_subdirectory (tests)
#+++++++++++++++++++++++++++++++
# installation
#
install (
TARGETS CORSIKA8
EXPORT CORSIKA8PublicTargets
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_PREFIX}
)
#
# header only part, just copy entire directory tree
#
install (DIRECTORY corsika DESTINATION include)
#
# generate cmake config package version (for find_package)
#
write_basic_package_version_file (
${PROJECT_BINARY_DIR}/corsikaConfigVersion.cmake
VERSION ${c8_version}
COMPATIBILITY SameMajorVersion
)
#
# export targets in build tree (for find_package)
#
export (
EXPORT CORSIKA8PublicTargets
FILE "${CMAKE_CURRENT_BINARY_DIR}/corsikaTargets.cmake"
NAMESPACE CORSIKA8::
)
#
# export targets in install tree (for find_package)
#
install (
EXPORT CORSIKA8PublicTargets
FILE corsikaTargets.cmake
NAMESPACE CORSIKA8::
DESTINATION lib/cmake/corsika
)
if(DEFINED CONAN_CMAKE_DIR)
install (
DIRECTORY conan_cmake/
DESTINATION lib/cmake/dependencies
)
endif(DEFINED CONAN_CMAKE_DIR)
#
# config for build tree (for find_package)
#
configure_package_config_file (
cmake/corsikaConfig.cmake.in
${PROJECT_BINARY_DIR}/corsikaConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}
)
#
# corsikaDefines
#
configure_package_config_file (
cmake/corsikaDefines.cmake
${PROJECT_BINARY_DIR}/corsikaDefines.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}
)
#
# config for install tree (for find_package)
# overwrite with install locations (if it was build as part of corsika)
#
set (Pythia8_INCDIR ${Pythia8_INCDIR_INSTALL})
set (Pythia8_LIBDIR ${Pythia8_LIBDIR_INSTALL})
configure_package_config_file (
cmake/corsikaConfig.cmake.in
${PROJECT_BINARY_DIR}/corsikaConfig.cmake-install
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}
)
#
# generate "corsika/corsika.hpp" file with cmake-level details and paths
# first for build-tree
#
# the location of the "corsika-data" is of fundamental importance
set (CORSIKA_CMAKE_DATA_DIR ${CMAKE_SOURCE_DIR}/modules/data)
configure_file (
src/corsika.hpp.in
${PROJECT_BINARY_DIR}/corsika/corsika.hpp
)
#
# second also for install-tree
#
set (CORSIKA_CMAKE_DATA_DIR "${CMAKE_INSTALL_FULL_DATADIR}/corsika/data")
configure_file (
src/corsika.hpp.in
${PROJECT_BINARY_DIR}/corsika.hpp-install
)
#
# installation of cmake and config files
#
install (
FILES
${CMAKE_BINARY_DIR}/corsikaDefines.cmake
${CMAKE_BINARY_DIR}/corsikaConfigVersion.cmake
DESTINATION lib/cmake/corsika
)
#
# install and rename install-level corsikaConfig.cmake
#
install (
FILES
${CMAKE_BINARY_DIR}/corsikaConfig.cmake-install
RENAME corsikaConfig.cmake
DESTINATION lib/cmake/corsika
)
#
# also install-level config.hpp
#
install (FILES
${PROJECT_BINARY_DIR}/corsika.hpp-install
RENAME corsika.hpp
DESTINATION include/corsika
)
#
# examples
#
install (DIRECTORY examples DESTINATION ${CMAKE_INSTALL_DATADIR}/corsika)
#
# data
#
install (DIRECTORY modules/data DESTINATION ${CMAKE_INSTALL_DATADIR}/corsika)
#
# tools
#
add_subdirectory (tools)
#+++++++++++++++++++++++++++++++
#
# final summary output
#
include (FeatureSummary)
feature_summary (WHAT ALL)
#
# (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
#
# See file AUTHORS for a list of contributors.
#
# This software is distributed under the terms of the GNU General Public
# Licence version 3 (GPL Version 3). See file LICENSE for a full version of
# the license.
#
#################################################
#
# takes a list of input files and prepends a path
#
function (CORSIKA_PREPEND_PATH return prefix)
set (listVar "")
foreach (f ${ARGN})
list (APPEND listVar "${prefix}/${f}")
endforeach (f)
set (${return} "${listVar}" PARENT_SCOPE)
endfunction (CORSIKA_PREPEND_PATH)
#################################################
#
# use: CORSIKA_COPY_HEADERS_TO_NAMESPACE theLib theNamesapce header1.h header2.h ...
#
# creates a dependence of theLib on the presence of all listed header files in the
# build-directory include/theNamespace directory
#
# if needed, create symbolic links from the source files to this build-directory location
#
# any path information from input filenames is stripped, IF path was specified it is used for the link destination, if NOT the link is relative to the CMAKE_CURRENT_SOURCE_DIR
#
function (CORSIKA_COPY_HEADERS_TO_NAMESPACE for_library in_namespace)
set (HEADERS_BUILD "")
foreach (HEADER ${ARGN})
# find eventual path, and handle it specificly
get_filename_component (barename ${HEADER} NAME)
get_filename_component (baredir ${HEADER} DIRECTORY)
# remove path, prepend build-directory destination
list (APPEND HEADERS_BUILD "${PROJECT_BINARY_DIR}/include/${in_namespace}/${barename}")
# define source location, use path if specified, otherwise CMAKE_CURRENT_SOURCE_DIR
set (FROM_DIR ${CMAKE_CURRENT_SOURCE_DIR})
if (NOT "${baredir}" STREQUAL "")
set (FROM_DIR ${baredir})
endif ()
# define command to perform the symbolic linking
add_custom_command (
OUTPUT ${PROJECT_BINARY_DIR}/include/${in_namespace}/${barename}
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/include/${in_namespace}
COMMAND ${CMAKE_COMMAND} -E create_symlink ${FROM_DIR}/${barename} ${PROJECT_BINARY_DIR}/include/${in_namespace}/${barename}
COMMENT "Generate link: ${PROJECT_BINARY_DIR}/include/${in_namespace}/${barename}"
)
endforeach (HEADER)
# main target for this build step, depends on header files in build area
add_custom_target (
${for_library}_BUILD
DEPENDS ${HEADERS_BUILD}
)
# connect the _BUILD target to the main (external) target
add_dependencies (${for_library} ${for_library}_BUILD)
endfunction (CORSIKA_COPY_HEADERS_TO_NAMESPACE)
#################################################
#
# use: CORSIKA_ADD_FILES_ABSOLUTE varname
#
# add list of filenames with absolute paths (pointing to CMAKE_SOURCE_DIR) to ${varname} in PARAENT_SCOPE
#
macro (CORSIKA_ADD_FILES_ABSOLUTE varname)
file (RELATIVE_PATH _relPath "${PROJECT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
foreach (_src ${ARGN})
if (_relPath)
list (APPEND "${varname}" "${CMAKE_SOURCE_DIR}/${_relPath}/${_src}")
else()
list (APPEND "${varname}" "${CMAKE_SOURCE_DIR}/${_src}")
endif()
endforeach()
if (_relPath)
# propagate SRCS to parent directory
set ("${varname}" "${${varname}}" PARENT_SCOPE)
endif()
endmacro(CORSIKA_ADD_FILES_ABSOLUTE)
#################################################
#
# central macro to activate unit tests in cmake
#
function (CORSIKA_ADD_TEST name)
target_include_directories (${name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/test_outputs/)
add_test (NAME ${name} COMMAND ${name} -o ${PROJECT_BINARY_DIR}/test_outputs/junit-${name}.xml -r junit)
endfunction (CORSIKA_ADD_TEST)
#
# (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
#
# See file AUTHORS for a list of contributors.
#
# This software is distributed under the terms of the GNU General Public
# Licence version 3 (GPL Version 3). See file LICENSE for a full version of
# the license.
#
#################################################
#
# run pythia8-config and interpret result
#
function (_PYTHIA8_CONFIG_ option variable type doc)
execute_process(COMMAND ${PYTHIA8_CONFIG} ${option}
OUTPUT_VARIABLE _local_out_
RESULT_VARIABLE _local_res_)
string(REGEX REPLACE "\n$" "" _local_out_ "${_local_out_}")
if (NOT ${_local_res_} EQUAL 0)
message ("Error in running ${PYTHIA8_CONFIG} ${option}")
else ()
set(${variable} "${_local_out_}" CACHE ${type} ${doc})
endif ()
endfunction (_PYTHIA8_CONFIG_)
#################################################
#
# Searched PYTHIA8 on system. Expect pythia8-config in PATH, or typical installation location
#
# This module defines
# HAVE_PYTHIA8
# PYTHIA8_INCLUDE_DIR where to locate Pythia.h file
# PYTHIA8_LIBRARY where to find the libpythia8 library
# PYTHIA8_LIBRARIES (not cached) the libraries to link against to use Pythia8
# PYTHIA8_VERSION version of Pythia8 if found
#
set(_SEARCH_PYTHIA8_
${PROJECT_BINARY_DIR}/ThirdParty/pythia8-install
${PYTHIA8}
$ENV{PYTHIA8}
${PYTHIA8DIR}
$ENV{PYTHIA8DIR}
${PYTHIA8_DIR}
$ENV{PYTHIA8_DIR}
${PYTHIA8_ROOT}
$ENV{PYTHIA8_ROOT}
/opt/pythia8)
find_program(PYTHIA8_CONFIG
NAME pythia8-config
PATHS ${_SEARCH_PYTHIA8_}
PATH_SUFFIXES "/bin"
DOC "The location of the pythia8-config script")
if (PYTHIA8_CONFIG)
set(HAVE_PYTHIA8 1 CACHE BOOL "presence of pythia8, found via pythia8-config")
_PYTHIA8_CONFIG_("--prefix" PYTHIA8_PREFIX PATH "location of pythia8 installation")
_PYTHIA8_CONFIG_("--includedir" PYTHIA8_INCLUDE_DIR PATH "pythia8 include directory")
_PYTHIA8_CONFIG_("--libs" PYTHIA8_LIBRARY STRING "the pythia8 libs")
_PYTHIA8_CONFIG_("--datadir" PYTHIA8_DATA_DIR PATH "the pythia8 data dir")
_PYTHIA8_CONFIG_("--cxxflags" PYTHIA8_CXXFLAGS STRING "the pythia8 cxxflags")
endif ()
# standard cmake infrastructure:
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Pythia8 DEFAULT_MSG PYTHIA8_PREFIX PYTHIA8_INCLUDE_DIR PYTHIA8_LIBRARY)
mark_as_advanced(PYTHIA8_DATA_DIR PYTHIA8_CXXFLAGS PYTHIA8_INCLUDE_DIR PYTHIA8_LIBRARY)
set (
COAST_HEADERS
COASTProcess.h
COASTStack.h
ParticleConversion.h
)
set (
COAST_SOURCES
COASTUserLib.cc
COASTProcess.cc
ParticleConversion.cc
)
set (
COAST_NAMESPACE
corsika/coast
)
add_library (COAST SHARED ${COAST_SOURCES})
CORSIKA_COPY_HEADERS_TO_NAMESPACE (COAST ${COAST_NAMESPACE} ${COAST_HEADERS})
set_target_properties (
COAST
PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1
# PUBLIC_HEADER "${MODEL_HEADERS}"
)
target_link_libraries (
COAST
PUBLIC
CORSIKAgeometry
CORSIKAunits
CORSIKAparticles
CORSIKAgeometry
CORSIKAsetup
# SuperStupidStack
)
target_include_directories (
COAST
PUBLIC
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include/include>
)
target_include_directories (
COAST
SYSTEM
PUBLIC
$ENV{COAST_DIR}/include
)
install (
TARGETS COAST
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include/${COAST_NAMESPACE}
)
#install (
# FILES ${COAST_HEADERS}
# DESTINATION include/${COAST_NAMESPACE}
# )
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#include <corsika/coast/COASTProcess.h>
#include <corsika/coast/COASTStack.h>
#include <iostream>
using namespace std;
namespace corsika::coast {
/**
the init function is called during the start of corsika.
*/
void COASTProcess::Init() {
cout << "************* Greetings from CORSIKA8 *****************" << endl;
}
/**
the docontinous function is called for each tracking step in
corsika. Take care: you cannot modify the particle, the track or
the stack from here (docontinuous) inside corisika7. In corsika8
you will be able to do that.
*/
corsika::process::EProcessReturn COASTProcess::DoContinuous(const Particle& p,
const Track& t,
const Stack&) {
using namespace corsika::units::si;
auto const start = t.GetPosition(0).GetCoordinates();
auto const delta = t.GetPosition(1).GetCoordinates() - start;
auto const name = corsika::particles::GetName(p.GetPID());
cout << "CORSIKA8: particle=" << name << ", pos=" << start
<< " track-l=" << delta.norm() << ", track-t=" << t.GetDuration() << endl;
return corsika::process::EProcessReturn::eOk;
}
} // namespace corsika::coast
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#ifndef _include_corsika_coast_coastprocess_h_
#define _include_corsika_coast_coastprocess_h_
#include <corsika/particles/ParticleProperties.h>
#include <corsika/process/ContinuousProcess.h>
#include <corsika/setup/SetupTrajectory.h>
#include <corsika/units/PhysicalUnits.h>
#include <corsika/coast/COASTStack.h>
#include <limits>
typedef corsika::coast::COASTStack Stack;
typedef corsika::coast::COASTStack::ParticleType Particle;
typedef corsika::geometry::Trajectory<corsika::geometry::Line> Track;
namespace corsika::coast {
class COASTProcess : public corsika::process::ContinuousProcess<COASTProcess> {
public:
void Init();
corsika::process::EProcessReturn DoContinuous(const Particle&, const Track&,
const Stack&);
corsika::units::si::LengthType MaxStepLength(Particle&, Track&) {
return corsika::units::si::meter * std::numeric_limits<double>::infinity();
}
private:
};
} // namespace corsika::coast
#endif
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#ifndef _include_coaststack_h_
#define _include_coaststack_h_
#include <corsika/coast/ParticleConversion.h>
#include <corsika/particles/ParticleProperties.h>
#include <corsika/stack/ParticleBase.h>
#include <corsika/stack/Stack.h>
#include <corsika/units/PhysicalUnits.h>
#include <corsika/geometry/Point.h>
#include <corsika/geometry/RootCoordinateSystem.h> // remove
#include <corsika/geometry/Vector.h>
#include <crs/CParticle.h>
#include <crs/CorsikaTypes.h>
#include <algorithm>
#include <vector>
namespace corsika::coast {
typedef corsika::geometry::Vector<corsika::units::si::hepmomentum_d> MomentumVector;
/**
* Example of a particle object on the stack.
*/
template <typename StackIteratorInterface>
class ParticleInterface : public corsika::stack::ParticleBase<StackIteratorInterface> {
using corsika::stack::ParticleBase<StackIteratorInterface>::GetStackData;
using corsika::stack::ParticleBase<StackIteratorInterface>::GetIndex;
public:
corsika::particles::Code GetPID() const { return GetStackData().GetPID(GetIndex()); }
corsika::units::si::HEPEnergyType GetEnergy() const {
return GetStackData().GetEnergy(GetIndex());
}
MomentumVector GetMomentum(const corsika::geometry::CoordinateSystem& cs) const {
using namespace corsika::units::si;
const HEPEnergyType mass = corsika::particles::GetMass(GetPID());
const auto P = sqrt((GetEnergy() - mass) * (GetEnergy() + mass));
const auto p = GetStackData().GetDirection(cs);
return p * P;
}
corsika::geometry::Point GetPosition(
const corsika::geometry::CoordinateSystem& cs) const {
return GetStackData().GetPosition(cs, GetIndex());
}
corsika::geometry::Vector<corsika::units::si::speed_d> GetVelocity(
const corsika::geometry::CoordinateSystem& cs) const {
return GetStackData().GetVelocity(cs, GetIndex());
}
corsika::units::si::TimeType GetTime() const {
return GetStackData().GetTime(GetIndex());
}
corsika::geometry::Vector<corsika::units::si::dimensionless_d> GetDirection(
const corsika::geometry::CoordinateSystem& cs) const {
return GetStackData().GetDirection(cs);
}
corsika::units::si::TimeType GetTimeInterval() const {
return GetStackData().GetTimeInterval();
}
};
/**
*
* Memory implementation of the most simple (stupid) particle stack object.
*/
class COASTStackImpl {
const crs::CParticle* fParticle1 = 0;
const crs::CParticle* fParticle2 = 0;
public:
COASTStackImpl(const crs::CParticle* v1, const crs::CParticle* v2) {
fParticle1 = v1;
fParticle2 = v2;
}
void Init() {}
void Clear() {}
// there is one particle only
int GetSize() const { return 1; }
int GetCapacity() const { return 1; }
// you cannot modify the particle:
// there are no Set... function defined
// readout particle data, there is just one particle!
/*
double x;
double y;
double z;
double depth;
double time;
double energy;
double weight;
int particleId;
int hadronicGeneration;
*/
corsika::particles::Code GetPID(const int) const {
return ConvertFromCoast(static_cast<CoastCode>(fParticle1->particleId));
}
corsika::units::si::HEPEnergyType GetEnergy(const int) const {
using namespace corsika::units::si;
return fParticle1->energy * 1_GeV;
}
corsika::geometry::Vector<corsika::units::si::dimensionless_d> GetDirection(
const corsika::geometry::CoordinateSystem& cs) const {
using namespace corsika::units::si;
corsika::geometry::Point p1(
cs, {fParticle1->x * 1_cm, fParticle1->y * 1_cm, fParticle1->z * 1_cm});
corsika::geometry::Point p2(
cs, {fParticle2->x * 1_cm, fParticle2->y * 1_cm, fParticle2->z * 1_cm});
const corsika::geometry::Vector D = p2 - p1;
const auto magD = D.norm();
const corsika::geometry::Vector dir = D / magD;
return dir;
}
corsika::geometry::Vector<corsika::units::si::speed_d> GetVelocity(
const corsika::geometry::CoordinateSystem& cs, const int) const {
using namespace corsika::units::si;
corsika::geometry::Vector<corsika::units::si::dimensionless_d> dir =
GetDirection(cs);
corsika::geometry::Point p1(
cs, {fParticle1->x * 1_cm, fParticle1->y * 1_cm, fParticle1->z * 1_cm});
corsika::geometry::Point p2(
cs, {fParticle2->x * 1_cm, fParticle2->y * 1_cm, fParticle2->z * 1_cm});
const corsika::geometry::Vector D = p2 - p1;
const LengthType magD = D.norm();
const TimeType deltaT = GetTimeInterval();
return dir * magD / deltaT;
}
corsika::geometry::Point GetPosition(const corsika::geometry::CoordinateSystem& cs,
const int) const {
using namespace corsika::units::si;
return corsika::geometry::Point(
cs, {fParticle1->x * 1_cm, fParticle1->y * 1_cm, fParticle1->z * 1_cm});
}
corsika::units::si::TimeType GetTime(const int) const {
using namespace corsika::units::si;
return fParticle1->time * 1_s;
}
corsika::units::si::TimeType GetTimeInterval() const {
using namespace corsika::units::si;
return (fParticle2->time - fParticle1->time) * 1_s;
}
/**
* We do not allow copying!
*/
void Copy(const int, const int) {}
/**
* We do not allow swapping particles, there is just one...
*/
void Swap(const int, const int) {}
// size cannot be increased, do nothing
void IncrementSize() {}
// size cannot be decremented, do nothing
void DecrementSize() {}
}; // end class COASTStackImpl
typedef corsika::stack::Stack<COASTStackImpl, ParticleInterface> COASTStack;
} // namespace corsika::coast
#endif
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#include <interface/CorsikaInterface.h>
#include <corsika/coast/COASTProcess.h>
#include <corsika/coast/COASTStack.h>
#include <corsika/geometry/CoordinateSystem.h>
#include <corsika/geometry/Line.h>
#include <corsika/geometry/Point.h>
#include <corsika/geometry/Trajectory.h>
#include <corsika/geometry/Vector.h>
#include <corsika/units/PhysicalUnits.h>
#include <crs/CInteraction.h>
#include <crs/CParticle.h>
#include <crs/CorsikaTypes.h>
#include <crs/TSubBlock.h>
#include <iostream>
#include <sstream>
using namespace std;
using namespace corsika;
using namespace corsika::units::si;
corsika::coast::COASTProcess gCorsikaProcess;
/*
Data is one CORSIKA data-block constining of 21 SubBlocks.
A SubBlock can be:
- thinned mode: 39 (Particles) * 8 (ENTRIES) * 4 (BYTES)
- not-thinned mode: 39 (Particles) * 7 (ENTRIES) * 4 (BYTES)
*/
extern "C" void wrida_([[maybe_unused]] const CREAL* Data) {
// crs::CParticleFortranPtr p;
// const bool isF = prminfo_(p);
}
extern "C" void inida_([[maybe_unused]] const char* filename,
[[maybe_unused]] const int& thinning,
[[maybe_unused]] const int& /*curved*/,
[[maybe_unused]] const int& /*slant*/,
[[maybe_unused]] const int& /*stackinput*/,
[[maybe_unused]] const int& /*preshower*/,
[[maybe_unused]] int str_length) {
gCorsikaProcess.Init();
}
extern "C" void cloda_() {
// crs::CParticleFortranPtr pptr;
// const bool isF = prminfo_(pptr);
// gCorsikaProcess.Close();
}
void interaction_([[maybe_unused]] const crs::CInteraction& interaction) {
/*
all interactions in the shower are available in this function !
the information availabel in the CInteraction class are:
double x;
double y;
double z;
double etot; // lab energy
double sigma; // cross-section of process
double kela; // elasticity
int projId; // projectile
int targetId; // target
double time;
*/
}
extern "C" void track_([[maybe_unused]] const crs::CParticle& pre,
[[maybe_unused]] const crs::CParticle& post) {
/*
all particles in the shower are available in this function !
The pre and post objecte are the two endpoints for one single track
in the shower, where the information available in CParticle is:
double x;
double y;
double z;
double depth;
double time;
double energy;
double weight;
int particleId;
int hadronicGeneration;
*/
coast::COASTStack stack(&pre, &post);
const auto particle = stack.GetNextParticle();
const geometry::CoordinateSystem& rootCS =
geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
geometry::Line const line(particle.GetPosition(rootCS), particle.GetVelocity(rootCS));
const TimeType time = particle.GetTimeInterval();
const geometry::Trajectory<geometry::Line> track(line, time);
gCorsikaProcess.DoContinuous(particle, track, stack);
}
extern "C" void tabularizedatmosphere_([[maybe_unused]] const int& nPoints,
[[maybe_unused]] const double* height,
[[maybe_unused]] const double* refractiveIndex) {
// for special use only but should be defined because it is delcared in CORSIKA.F
}
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#include <corsika/coast/ParticleConversion.h>
#include <corsika/particles/ParticleProperties.h>
#include <exception>
#include <iostream>
#include <sstream>
using namespace std;
namespace corsika::coast {
/**
Convert particle code, and check if it does exists. Throw exeption, if not!
*/
corsika::particles::Code ConvertFromCoast(CoastCode pCode) {
if (coast2corsika.count(pCode) == 0) {
ostringstream err;
err << "corsika::coast::ConvertFromCoast CoastCode does not exists="
<< static_cast<CoastCodeIntType>(pCode) << endl;
cout << err.str() << endl;
throw std::runtime_error(err.str());
}
return coast2corsika.find(pCode)->second;
}
} // namespace corsika::coast
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#ifndef _include_processes_sibyll_particles_h_
#define _include_processes_sibyll_particles_h_
#include <corsika/particles/ParticleProperties.h>
#include <bitset2/bitset2.hpp>
#include <map>
namespace corsika::coast {
/**
Here we define the original CORSIKA particle codes, see corsika manual
*/
enum class CoastCode : int16_t {
Gamma = 1,
Positron = 2,
Electron = 3,
MuonBar = 5,
Muon = 6,
Pi0 = 7,
PiP = 8,
PiM = 9,
Klong = 10,
KP = 11,
KM = 12,
Neutron = 13,
Proton = 14,
ProtonBar = 15,
Kshort = 16,
Eta = 17,
Lambda = 18,
SigmaPlus = 19,
Sigma0 = 20,
SigmaMinus = 21,
Xi0 = 22,
XiMinus = 23,
OmegaMinus = 24,
NeutronBar = 25,
LambdaBar = 26,
SigmaMinusBar = 27,
Sigma0Bar = 28,
SigmaPlusBar = 29,
Xi0Bar = 30,
XiPlusBar = 31,
OmegaPlusBar = 32,
EtaPrime = 48,
Phi = 49,
omega = 50,
Rho0 = 51,
RhoPlus = 52,
RhoMinus = 53,
DeltaPlusPlus = 54,
DeltaPlus = 55,
Delta0 = 56,
DeltaMinus = 57,
DeltaMinusMinusBar = 58,
DeltaMinusBar = 59,
Delta0Bar = 60,
DeltaPlusBar = 61,
KStar0 = 62,
KStarPlus = 63,
KStarMinus = 64,
KStar0Bar = 65,
NeutrinoE = 66,
NeutrinoEBar = 67,
NeutrinoMu = 68,
NeutrinoMuBar = 69,
Code71 = 71,
Code72 = 72,
Code73 = 73,
Code74 = 74,
Code75 = 75,
Code76 = 76,
Code85 = 85,
Code86 = 86,
Code95 = 95,
Code96 = 96,
ProtonNucleus = 101,
Deuterium = 201,
Tritium = 301,
He3 = 302,
Helium = 402,
Lithium = 603,
Beryllium = 904,
Boron = 1005,
Carbon = 1206,
Carbon13 = 1306,
Nitrogen = 1407,
Oxygen = 1608,
Fluor = 1809,
Neon21 = 2110,
Neon = 2210,
Argon = 1838,
Iron = 5628,
Xenon = 12854,
Radon = 13888,
};
using CoastCodeIntType = std::underlying_type<CoastCode>::type;
/**
Here we convert CORSIKA7 to CORSIKA8 codes
*/
const std::map<corsika::coast::CoastCode, corsika::particles::Code> coast2corsika = {
{CoastCode::Gamma, corsika::particles::Code::Gamma},
{CoastCode::Positron, corsika::particles::Code::Positron},
{CoastCode::Electron, corsika::particles::Code::Electron},
//{CoastCode:: ,corsika::particles::Code::Unknown}, // 4
{CoastCode::MuonBar, corsika::particles::Code::MuPlus},
{CoastCode::Muon, corsika::particles::Code::MuMinus},
{CoastCode::Pi0, corsika::particles::Code::Pi0},
{CoastCode::PiP, corsika::particles::Code::PiPlus},
{CoastCode::PiM, corsika::particles::Code::PiMinus},
{CoastCode::Klong, corsika::particles::Code::K0Long}, // 10
{CoastCode::KP, corsika::particles::Code::KPlus},
{CoastCode::KM, corsika::particles::Code::KMinus},
{CoastCode::Neutron, corsika::particles::Code::Neutron},
{CoastCode::Proton, corsika::particles::Code::Proton}, // 14
{CoastCode::ProtonBar, corsika::particles::Code::AntiProton},
{CoastCode::Kshort, corsika::particles::Code::K0Short},
{CoastCode::Eta, corsika::particles::Code::Eta}, // 17
{CoastCode::Lambda, corsika::particles::Code::Lambda0},
{CoastCode::SigmaPlus, corsika::particles::Code::SigmaPlus},
{CoastCode::Sigma0, corsika::particles::Code::Sigma0}, // 20
{CoastCode::SigmaMinus, corsika::particles::Code::SigmaMinus},
{CoastCode::Xi0, corsika::particles::Code::Xi0},
{CoastCode::XiMinus, corsika::particles::Code::XiMinus},
{CoastCode::OmegaMinus, corsika::particles::Code::OmegaMinus},
{CoastCode::NeutronBar, corsika::particles::Code::AntiNeutron}, // 25
{CoastCode::LambdaBar, corsika::particles::Code::Lambda0Bar},
{CoastCode::SigmaMinusBar, corsika::particles::Code::SigmaMinusBar},
{CoastCode::Sigma0Bar, corsika::particles::Code::Sigma0Bar},
{CoastCode::SigmaPlusBar, corsika::particles::Code::SigmaPlusBar},
{CoastCode::Xi0Bar, corsika::particles::Code::Xi0Bar},
{CoastCode::XiPlusBar, corsika::particles::Code::XiPlusBar},
{CoastCode::OmegaPlusBar, corsika::particles::Code::OmegaPlusBar}, // 32
//{CoastCode:: ,corsika::particles::Code::Unknown}, // eta-prime
//{CoastCode:: ,corsika::particles::Code::Unknown}, // PHI
//{CoastCode:: ,corsika::particles::Code::Unknown}, // omega
{CoastCode::Rho0, corsika::particles::Code::Rho0}, // 51
{CoastCode::RhoPlus, corsika::particles::Code::RhoPlus},
{CoastCode::RhoMinus, corsika::particles::Code::RhoMinus},
{CoastCode::DeltaPlusPlus, corsika::particles::Code::DeltaPlusPlus},
{CoastCode::DeltaPlus, corsika::particles::Code::DeltaPlus},
{CoastCode::Delta0, corsika::particles::Code::Delta0}, // 56
//{CoastCode:: ,corsika::particles::Code::Unknown}, // DeltaMinus},
{CoastCode::DeltaMinusMinusBar, corsika::particles::Code::DeltaMinusMinusBar},
{CoastCode::DeltaMinusBar, corsika::particles::Code::DeltaMinusBar},
{CoastCode::Delta0Bar, corsika::particles::Code::Delta0Bar},
//{CoastCode:: ,corsika::particles::Code::Unknown}, // DeltaPlusBar
{CoastCode::KStar0, corsika::particles::Code::KStar0}, // 62
{CoastCode::KStarPlus, corsika::particles::Code::KStarPlus},
{CoastCode::KStarMinus, corsika::particles::Code::KStarMinus},
{CoastCode::KStar0Bar, corsika::particles::Code::KStar0Bar},
{CoastCode::NeutrinoE, corsika::particles::Code::NuE},
{CoastCode::NeutrinoEBar, corsika::particles::Code::NuEBar},
{CoastCode::NeutrinoMu, corsika::particles::Code::NuMu},
{CoastCode::NeutrinoMuBar, corsika::particles::Code::NuMuBar}, // 69
{CoastCode::Code71, corsika::particles::Code::Unknown},
{CoastCode::Code72, corsika::particles::Code::Unknown},
{CoastCode::Code73, corsika::particles::Code::Unknown},
{CoastCode::Code74, corsika::particles::Code::Unknown},
{CoastCode::Code75, corsika::particles::Code::Unknown},
{CoastCode::Code76, corsika::particles::Code::Unknown},
{CoastCode::Code85, corsika::particles::Code::Unknown},
{CoastCode::Code86, corsika::particles::Code::Unknown},
{CoastCode::Code95, corsika::particles::Code::Unknown},
{CoastCode::Code96, corsika::particles::Code::Unknown},
{CoastCode::ProtonNucleus, corsika::particles::Code::Proton}, // 101
{CoastCode::Deuterium, corsika::particles::Code::Deuterium},
{CoastCode::Tritium, corsika::particles::Code::Tritium},
{CoastCode::He3, corsika::particles::Code::Helium3},
{CoastCode::Helium, corsika::particles::Code::Helium}, // 402
//{CoastCode::Lithium, corsika::particles::Code::Lithium},
//{CoastCode::Beryllium, corsika::particles::Code::Beryllium},
//{CoastCode::Boron, corsika::particles::Code::Boron},
//{CoastCode::Carbon, corsika::particles::Code::Carbon},
//{CoastCode::Carbon13, corsika::particles::Code::Carbon13},
//{CoastCode::Nitrogen, corsika::particles::Code::Nitrogen},
//{CoastCode::Fluor, corsika::particles::Code::Fluor},
//{CoastCode::Oxygen, corsika::particles::Code::Oxygen},
//{CoastCode::Neon21, corsika::particles::Code::Neon21},
//{CoastCode::Neon, corsika::particles::Code::Neon},
//{CoastCode::Argon, corsika::particles::Code::Argon},
//{CoastCode::Xenon, corsika::particles::Code::Xenon},
//{CoastCode::Radon, corsika::particles::Code::Radon},
{CoastCode::Iron, corsika::particles::Code::Iron}, // 5628
//{CoastCode::, corsika::particles::Code::},
};
corsika::particles::Code ConvertFromCoast(CoastCode pCode);
} // namespace corsika::coast
#endif
# COAST interface {#COAST}
With the COAST interface of CORSIKA 8 you can write a CORSIKA 8
"process" class and link it to CORSIKA 7. This can be very powerful to
benchmark new CORSIKA 8 physics code in the context of "old" CORSIKA 7
simulations.
This is based on corsika7/trunk/coast/CoastOptions/example with an
additional interface to CORSIKA 8. See code in namespace corsika::coast for all details.
We provide a step-by-step example for a "COAST user library" using CORSIKA 8
technology. It explains the steps, how to use the COAST_USER_LIB
option of CORSIKA together with CORSIKA8/COAST
Step 1:
-------
Configure CORSIKA8 with 'cmake -DWITH_COAST=1' and other options you
prefer. You have to define COAST_DIR environment variable to the
location of your existing CORSIKA7 installation. Check that 'ls
$COAST_DIR/include/interface' contains the file
'CorsikaInterface.h'. If this is not the case, this is not a valid or
proper installation of CORSIKA. First compile CORSIKA, e.g. with
ROOTOUT option, or CoReas to get COAST installed!
Step 2:
-------
Compile CORSIKA8, edit COAST/COASTProcess.cc to modify/add your
physics module.
There should be a libCOAST.so as a result! This is what you need.
Step 3:
-------
Create COAST_USER_LIB environment variable to point at your current
directory, where now the 'libCOAST.so' library is located.
Add the path in $COAST_USER_LIB to your LD_LIBRARY_PATH environment
variable.
Step 4:
-------
Go back to your CORSIKA directory and re-start 'coconut'. The option
COAST_USER_LIB will now be visible. Please select it, copile CORSIKA
and start the executable. In the generated console output you will the
statements from your COAST library during Init and Close of the
simulation.
Add any kind of code now working on the CParticle or
CInteraction class to start using the full power of COAST.
Note: the default COASTProcess just prints out tons of ASCII. This is
not very useful, don't run a full MC with this...
Step 5:
-------
enjoy...
# Collaboration agreement
The CORSIKA project very much welcomes all collaboration and
contributions. The aim of the CORSIKA project is to create a
scientific software framework as a fundamental tool for research. The
collaboration agreement and the licensing model are based on the
guidelines layed out by HSF
[[1]](https://hepsoftwarefoundation.org/activities/licensing.html) or
CERN
[[2]](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=2ahUKEwiLqKG00dXdAhUOZFAKHdIwAh4QFjAAegQIARAC&url=https%3A%2F%2Findico.cern.ch%2Fcategory%2F4251%2Fattachments%2F101%2F505%2FOSL-2012-01-Open_Source_Licences_at_CERN-Short_version.pdf&usg=AOvVaw1n4S0PQCSeE6wbdfdhKDqF),
[[3]](http://legal.web.cern.ch/licensing/software), and follow the
examples of other big scientific software projects.
The CORSIKA project consists of the contributions from the scientific
community and individuals in a best effort to deliver the best
possible computing performance and physics output.
The MCnet guidelines developed by [www.montecarlonet.org](www.montecarlonet.org)
are copied in [MCNET_GUIDELINES](MCNET_GUIDELINES) -- they provide a very good
additional scope that contributors should read and consider.
All possible
liability and licensing question are only handled by the adopted
software license.
## The software license of the CORSIKA project
The license adopted for the CORSIKA project is the explicit copyleft
license GPLv3, as copied in full in the file
[LICENSE](LICENSE). Each source file of the CORSIKA project contains a
short statement of the copyright and this license. Each binary or
source code release of CORSIKA must contain the file LICENSE. The
code, documentation and content in the folder [ThirdParty](ThirdParty)
is not integral part of the CORSIKA project and can be based on, or
include, other licenses, which must be compatible with GPLv3. Check the
content of this folder for details and additional license information. It depends on the configuration of
the build system to what extend this code is used to build CORSIKA.
## Who is the "copyright holder"
For legal reasons and the ability to maintain the CORSIKA project
effectively over a very long lifespan of several decades, all
contributors are required to transfer their copyright to the CORSIKA
Project. Of course you will be duly credited and your name will appear
on the contributors page and in the [AUTHORS](AUTHORS) file shipped
with every binary and source distribution. The copyright transfer is
necessary to be able to effectively defend the project in case of
litigation. The copyright holder may change, if decided by the CORSIKA
Project. The current copyright holder is the CORSIKA Project
corsika-project@lists.kit.edu, with the current chair person
Ralf Ulrich (KIT) ralf.ulrich@kit.edu.
## Definition of a "contributor"
Contributor is a person of whom at least one merge request was
accepted for the master branch of the CORSIKA project at
[https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika](https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika).
All contributors will be co-listed and credited as (software) authors
of the CORSIKA project, as well as listed indefinitely in the
[AUTHORS](AUTHORS) file. Contributors should add their name and
contact data to the [AUTHORS](AUTHORS) file, as part of one of their
merge requests. This file is always distributed together with all
source and binary releases. If you contribute to any non-master
branch, you can add your name to the [AUTHORS](AUTHORS) file of this
particular branch, but all official releases are normally performed
via the master branch.
If you want to contribute, you need to read
[the GUIDELINES](CONTRIBUTING.md) and comply with these rules, or help to
improve them.
## The CORSIKA Project panel
The CORSIKA Project panel makes all decisions for the CORSIKA
Project. It can also change the
[COLLABORATION\_AGREEMENT](COLLABORATION\_AGREEMENT.md), the
[GUIDELINES](CONTRIBUTING.md) or any other structure or document relevant for the CORSIKA Project.
The CORSIKA Project *panel* consists (October 2018) of
* Hans Dembinski (MPG)
* Ralph Engel (KIT)
* Dieter Heck (KIT)
* Tanguy Pierog (KIT)
* Maximilian Reininghaus (KIT)
* Felix Riehn (LIP)
* Ralf Ulrich (KIT)
* Darko Veberic (KIT)
and can be contacted via corsika-project@lists.kit.edu. The chair
person of the CORSIKA Project is Ralf Ulrich (KIT). Members of the
CORSIKA Project *panel* can be *Maintainer* of the CORSIKA Project in
gitlab at
[https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika](https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika),
and have special responsibilities also for this reason.
### Changing to a different license, for parts, or the complete project
The CORSIKA Project panel can change the license for parts or the entire project in general or for individual releases.
### Planning and performing releases
The CORSIKA Project panel decides on releases of the software, and about the content of it.
### Changes to the Collaboration Agreement
The CORSIKA Project panel decides on changes to the Collaboration
agreement.