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 (1031)
Showing
with 1307 additions and 1269 deletions
......@@ -10,3 +10,15 @@ 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
variables:
GIT_STRATEGY: $CORSIKA8_GIT_STRATEGY # clone: fresh clone, fetch: update
GIT_SSL_NO_VERIFY: "1"
GIT_DEPTH: "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
......@@ -14,9 +14,10 @@ variables:
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: normal # none: we get the submodules in before_script,
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"
#
......@@ -35,11 +36,14 @@ stages:
####### CODE QUALITY CHECK ##############
##########################################
########### CODE QUALITY CHECK ###########
##########################################
##########################################################
check-copyrights:
image: corsika/devel:u-18.04
image: corsika/devel:u-22.04
stage: quality
tags:
- corsika
......@@ -65,20 +69,31 @@ check-clang-format:
- if: $CI_COMMIT_BRANCH
allow_failure: true
### CodeQuality tool ####
#include:
# - template: Code-Quality.gitlab-ci.yml
#
#code_quality:
# stage: quality
# rules:
# - if: '$CODE_QUALITY_DISABLED'
# when: never
# - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' # Run code quality job in merge request pipelines
# - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' # Run code quality job in pipelines on the master branch (but not in other branch pipelines)
# - if: '$CI_COMMIT_TAG' # Run code quality job in pipelines for tags
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 ##############
##########################################
################# CONFIG #################
##########################################
##########################################################
# the generic config template job
......@@ -88,9 +103,13 @@ check-clang-format:
tags:
- corsika
script:
- mkdir -p build
- cd build
- cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_Pythia8_C8=C8
- 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
......@@ -102,18 +121,21 @@ check-clang-format:
- ${CI_PROJECT_DIR}/build/CMakeFiles/CMakeOutput.log
# config for gcc
config-u-18_04:
config-u-22_04:
extends: .config
image: corsika/devel:u-18.04
image: corsika/devel:u-22.04
# config for clang
config-clang-8:
config-clang-14:
extends: .config
image: corsika/devel:clang-8
image: corsika/devel:clang-14
####### BUILD-TEST (all builds <= Draft/WIP, default) ##############
##########################################
############### BUILD-TEST ###############
##########################################
##########################################################
# the generic build_test template job
......@@ -123,9 +145,13 @@ config-clang-8:
tags:
- corsika
script:
- mkdir -p build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Debug -DUSE_Pythia8_C8=C8
- 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
......@@ -144,47 +170,61 @@ config-clang-8:
junit:
- ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
# build_test for gcc
build_test-u-18_04:
build_test-u-22_04:
extends: .build_test
image: corsika/devel:u-18.04
image: corsika/devel:u-22.04
needs:
- job: config-u-18_04
- job: config-u-22_04
artifacts: false
# build_test for clang
build_test-clang-8:
build_test-clang-14:
extends: .build_test
image: corsika/devel:clang-8
image: corsika/devel:clang-14
needs:
- job: config-clang-8
- job: config-clang-14
artifacts: false
####### BUILD-TEST-EXAMPLE (only non-Draft/non-WIP) ##############
##########################################
########## BUILD-TEST-EXAMPLE ###########
##########################################
##########################################################
# generic example template job
# normal pipeline for each commit
# artefacts are needed as input for python jobs
.build_test_example:
stage: build_test_example
tags:
- corsika
script:
- mkdir -p build
- cd build
- cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_Pythia8_C8=C8
- 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 build_examples
- cd build_examples
- cmake -DCMAKE_BUILD_TYPE=Debug ../install/share/corsika/examples
- 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
- 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
......@@ -196,36 +236,40 @@ build_test-clang-8:
allow_failure: true
artifacts:
when: always
expire_in: 3 days
expire_in: 2 days
reports:
junit:
- ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
paths:
- ${CI_PROJECT_DIR}/build/build_examples/example_outputs
- ${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-18_04:
build_test_example-u-22_04:
extends: .build_test_example
image: corsika/devel:u-18.04
image: corsika/devel:u-22.04
needs:
- job: config-u-18_04
- job: config-u-22_04
artifacts: false
# build_test_example for clang
build_test_example-clang-8:
build_test_example-clang-14:
extends: .build_test_example
image: corsika/devel:clang-8
image: corsika/devel:clang-14
needs:
- job: config-clang-8
- job: config-clang-14
artifacts: false
####### OPTIONAL ##############
##########################################
################ OPTIONAL ################
##########################################
##########################################################
# generic release template job
......@@ -235,18 +279,24 @@ build_test_example-clang-8:
tags:
- corsika
script:
- mkdir -p build
- cd build
- cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Release -DUSE_Pythia8_C8=C8
- 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 build_examples
- cd build_examples
- cmake -DCMAKE_BUILD_TYPE=Release ../install/share/corsika/examples
- cmake --build . -- VERBOSE=1 -j2
- cmake --build . --target run_examples -- -j2
- 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
......@@ -267,40 +317,49 @@ build_test_example-clang-8:
paths:
- ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
# release for gcc
release-full-u-18_04:
release-full-u-22_04:
extends: .release
image: corsika/devel:u-18.04
image: corsika/devel:u-22.04
needs:
- job: config-u-18_04
- job: config-u-22_04
artifacts: false
# release for clang
release-full-clang-8:
release-full-clang-14:
extends: .release
image: corsika/devel:clang-8
image: corsika/devel:clang-14
needs:
- job: config-clang-8
- 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-18.04
image: corsika/devel:u-22.04
needs:
- job: config-u-18_04
- job: config-u-22_04
artifacts: false
stage: optional
tags:
- corsika
script:
- mkdir -p build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Coverage -DUSE_Pythia8_C8=C8
- 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
......@@ -325,22 +384,28 @@ coverage:
##########################################
################# SANITY #################
##########################################
##########################################################
sanity:
image: corsika/devel:u-18.04
image: corsika/devel:u-22.04
needs:
- job: config-u-18_04
- job: config-u-22_04
artifacts: false
stage: optional
tags:
- corsika
script:
- mkdir -p build
- cd build
- cmake .. -DWITH_CORSIKA_SANITIZERS_ENABLED=ON -DCMAKE_BUILD_TYPE=Debug -DUSE_Pythia8_C8=C8
- 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
......@@ -355,7 +420,9 @@ sanity:
allow_failure: true
###### Python ##########
##########################################
################# Python #################
##########################################
##########################################################
# template for all Python jobs
......@@ -372,19 +439,42 @@ sanity:
- python3 -m black -t py37 corsika tests
- python3 -m flake8 corsika tests
- python3 -m pytest --cov=corsika tests
- cd ${CI_PROJECT_DIR} # reset the directory
coverage: '/^TOTAL\s*\d+\s*\d+\s*(.*\%)/'
# the default Python version Ubuntu 18.04 is Python3.8
python-3.8:
python-tests:
extends: .python
image: corsika/analysis:python-3.9.5
image: corsika/devel:u-22.04
needs:
- job: build_test_example-u-18_04
- job: build_test_example-u-22_04
artifacts: true
artifacts:
when: always
expire_in: 3 month
expire_in: 1 month
paths:
- ${CI_PROJECT_DIR}/Python/python-test.log
allow_failure: true
- ${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
......@@ -6,7 +6,7 @@ The code approval procedure is described in the wiki: [Code approval procedure w
- [ ] 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-clang-8", "release-u-18.04" and make sure no problems occur. You may have to trigger a pipeline manually to check this.
- [ ] 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
......
[submodule "modules/data"]
path = modules/data
url = ../../AirShowerPhysics/corsika-data.git
branch = master
shallow = true
[submodule "modules/conex"]
path = modules/conex
path = modules/conex/cxroot
url = ../../AirShowerPhysics/cxroot.git
branch = master
shallow = true
......@@ -3,26 +3,20 @@
#
# 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.
# 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)
#+++++++++++++++++++++++++++++
# for pre-defined standard path
#
include (GNUInstallDirs)
#+++++++++++++++++++++++++++++
# project name
# version is: "8.major.minor.patch"
# major: API changes
# minor: no API changes
# patch: bug fix and small improvements
# patch: bug fix and small improvements
#
set (c8_version 8.0.0.0)
set (c8_version 8.0.0.0)
project (
corsika
VERSION ${c8_version}
......@@ -30,6 +24,11 @@ project (
LANGUAGES CXX
)
#+++++++++++++++++++++++++++++
# for pre-defined standard path
#
include (GNUInstallDirs)
#+++++++++++++++++++++++++++++
# prevent in-source builds and give warning message
#
......@@ -44,12 +43,17 @@ endif ()
# cmake version-specific settings
#
# https://cmake.org/cmake/help/latest/policy/CMP0079.html
if (${CMAKE_VERSION} VERSION_GREATER "3.13.0")
cmake_policy (SET CMP0079 NEW)
endif ()
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
......@@ -62,7 +66,13 @@ 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)
......@@ -81,7 +91,7 @@ include (corsikaDefines)
# check if compiler is C++17 compliant
#
include (CheckCXXCompilerFlag)
check_CXX_compiler_flag ("--std=c++17" COMPILER_SUPPORTS_CXX17)
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 ()
......@@ -111,22 +121,8 @@ add_compile_options (
# Setup external dependencies.
#
###
include (conan) # self-provided in 'cmake' directory
#
# download and build all dependencies
message (STATUS "Installing dependencies from Conan (this may take some time)...")
if (APPLE)
# compiler.libcxx is not available on MacOS
set(SETTINGS compiler.cppstd=17)
else (APPLE)
set(SETTINGS compiler.libcxx=libstdc++11 compiler.cppstd=17)
endif (APPLE)
#
conan_cmake_run (CONANFILE conanfile.txt
BASIC_SETUP CMAKE_TARGETS
BUILD missing
BUILD_TYPE "Release"
SETTINGS ${SETTINGS})
#
# add cnpy temporarily. As long as SaveBoostHistogram does not save to parquet directly
#
......@@ -136,44 +132,66 @@ add_subdirectory (externals/cnpy)
# Coverage
#
# targets and settings needed to generate coverage reports
if (CMAKE_BUILD_TYPE STREQUAL Coverage)
#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.
add_compile_options ("-O0")
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 "${PROJECT_SOURCE_DIR}/externals/lcov/bin/lcov")
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 "${PROJECT_SOURCE_DIR}/externals/lcov/bin/genhtml")
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
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/*"
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
......@@ -185,6 +203,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Coverage)
DEPENDS coverage.info
)
add_custom_target (coverage DEPENDS coverage-report)
endif ()
#+++++++++++++++++++++++++++++
......@@ -223,13 +242,14 @@ 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
......@@ -237,17 +257,29 @@ target_include_directories (
$<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
CONAN_PKG::proposal
CONAN_PKG::eigen
CONAN_PKG::spdlog
CONAN_PKG::boost
CONAN_PKG::yaml-cpp
CONAN_PKG::arrow
CONAN_PKG::cli11
BZip2::BZip2
Boost::filesystem
CLI11::CLI11
Eigen3::Eigen
spdlog::spdlog
yaml-cpp::yaml-cpp
Parquet::parquet_static
PROPOSAL::PROPOSAL
cnpy # for SaveBoostHistogram
)
......@@ -264,12 +296,23 @@ add_subdirectory (documentation)
#
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
......@@ -313,6 +356,12 @@ install (
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)
#
......@@ -322,7 +371,7 @@ configure_package_config_file (
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}
)
#
# corsikaDefines
# corsikaDefines
#
configure_package_config_file (
cmake/corsikaDefines.cmake
......@@ -352,7 +401,7 @@ configure_file (
)
#
# second also for install-tree
#
#
set (CORSIKA_CMAKE_DATA_DIR "${CMAKE_INSTALL_FULL_DATADIR}/corsika/data")
configure_file (
src/corsika.hpp.in
......@@ -363,8 +412,6 @@ configure_file (
#
install (
FILES
${CMAKE_BINARY_DIR}/conanbuildinfo.cmake
${CMAKE_BINARY_DIR}/conaninfo.txt
${CMAKE_BINARY_DIR}/corsikaDefines.cmake
${CMAKE_BINARY_DIR}/corsikaConfigVersion.cmake
DESTINATION lib/cmake/corsika
......@@ -380,8 +427,8 @@ install (
)
#
# also install-level config.hpp
#
install (FILES
#
install (FILES
${PROJECT_BINARY_DIR}/corsika.hpp-install
RENAME corsika.hpp
DESTINATION include/corsika
......
# 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 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.
## 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 contains the file LICENSE. The
code, documentation and content in the folder [./externals](./externals)
is not integral part of the CORSIKA project and can be based on, or
include, other licenses, which must be compatible with GPLv3.
The folder [./modules](./modules) contains the code of several
external physics models for your convenience. Please consult the
original model authors and honor their policies and licenses.
Of course, we have their consent to
distribute their code together with CORSIKA 8.
Check the content of these folders carefully 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.
## Contributing
If you want to contribute, you need to read
[the GUIDELINES](CONTRIBUTING.md) and comply with these rules, or help to
improve them.
# Guidelines for code development, structure, formating etc.
The CORSIKA Project very much welcomes contributions. Here we outlined
The CORSIKA Project very much welcomes contributions. Here we outline
how you can find the right place to contribute, and how to do that.
Connect to https://gitlab.iap.kit.edu and corsika-devel@lists.kit.edu (self-register at https://www.lists.kit.edu/sympa/subscribe/corsika-devel) to get in touch with the project.
The CORSIKA Project decides on the [GUIDELINES](CONTRIBUTING.md) and can decide to
The CORSIKA Project decides on the [contributing guidelines](CONTRIBUTING.md) and can decide to
change/improve them.
# How to contribute
......@@ -53,15 +53,14 @@ Please read the [Coding wiki page](https://gitlab.iap.kit.edu/AirShowerPhysics/c
## Release versioning scheme
Releases of CORSIKA 8 are thought to be the baseline for larger scale
validation, and full production. The releases are numbered as x.y.z,
starting with x=8, which will not be changed for CORSIKA 8. The y index is
updated for new releases that normally contain improved or
validation, and full production. The releases are numbered as CORSIKA 8 vx.y.z,
starting with x=1. The x index is updated for new releases that normally contain improved or
enhanced physics performance, and also interface
changes to accomodate improvements. The z index can be updated more
changes to accomodate improvements. The y and z indices can be updated more
frequently for bug fixes or new features. Changes in z will not
contain interface changes, thus, production code will remain
fully compatible within changes of z. Special releases of CORSIKA will
also have a release names.
fully compatible within changes of z. Special releases of CORSIKA might
also have a release name.
# How to become scientific author of the CORSIKA Project
......@@ -70,9 +69,9 @@ The CORSIKA Project decides on who becomes scientific author. The
following conditions are sufficient, but not all of them are
required all the time:
- responsibility for a particular functionality or software/management part
- have read and follow these [GUIDELINES](CONTRIBUTING.md)
- have read and follow our [contributing guidelines](CONTRIBUTING.md)
- active in the CORSIKA Project, that means responsive to
discussions and problems in corsika-devel@list.kit.edu or on https//gitlab.iap.kit.edu,
of relevant *Issues*, or in (phone) meetings
- agreement to the [COLLABORATION_AGREEMENT](COLLABORATION_AGREEMENT.md)
of relevant *Issues*, in (phone) meetings or our Mattermost workspace
- agreement to the [using and collaborating agreement](USING_COLLABORATING.md)
- the members of the CORSIKA Project must agree
This diff is collapsed.
Maintainers of the CORSIKA8 project are collaborators actively taking
care of code contributions, quality control, development, and related
discussions.
General and infrastructure:
- Ralf Ulrich <ralf.ulrich@kit.edu>, KIT
- Maximilian Reininghaus <maximilian.reininghaus@kit.edu>, KIT
- Antonio Augusto Alves Junior <antonio.junior@kit.edu>, KIT
High performance, GPU:
- Dominik Baack <dominik.baack@tu-dortmund.de>, Dortmund
- Antonio Augusto Alves Junior <antonio.junior@kit.edu>, KIT
- Luisa Arrabito <arrabito@in2p3.fr>, Montpellier
Electromagnetic models:
- Jean-Marco Alameddine <jean-marco.alameddine@udo.edu>, Dortmund
- Jan Soedingrekso <jan.soedingrekso@tu-dortmund.de>, Dortmund
- Maximilian Sackel <maximilian.sackel@udo.edu>, Dortmund
Hadron models:
- Felix Riehn <friehn@lip.pt>, Santiago/Lisbon
- Anatoli Fedynitch <anatoli.fedynitch@icecube.wisc.edu> ICRR Tokyo
Output formats and infrastructure:
- Remy Prechelt <prechelt@hawaii.edu>, UHM
- Ralf Ulrich <ralf.ulrich@kit.edu>, KIT
Python library:
- Remy Prechelt <prechelt@hawaii.edu>, UHM
Radio:
- Remy Prechelt <prechelt@hawaii.edu>
- Tim Huege <tim.huege@kit.edu>, KIT
Testing, containers:
- Lukas Nellen <lukas@nucleares.unam.mx>
# CORSIKA 8 Framework for Particle Cascades in Astroparticle Physics
# CORSIKA 8 Framework for Particle Cascades in Astroparticle Physics
The purpose of CORSIKA is to simulate any particle cascades in
astroparticle physics or astrophysical context. A lot of emphasis is
The purpose of CORSIKA 8 is to simulate any particle cascades in
astroparticle physics or astrophysical context. A lot of emphasis has been
put on modularity, flexibility, completeness, validation and
correctness. To boost computational efficiency different techniques
correctness. To boost computational efficiency, different techniques
are provided, like thinning or cascade equations. The aim is that
CORSIKA remains the most comprehensive framework for simulating
CORSIKA 8 remains the most comprehensive framework for simulating
particle cascades with stochastic and continuous processes.
The software makes extensive use of static design patterns and
compiler optimization. Thus, the most fundamental configuration
decision of the user must be performed at compile time. At run time
decisions of the user must be performed at compile time. At run time,
model parameters can still be changed.
CORSIKA 8 is by default released under the GPLv3 license. See [license
CORSIKA 8 is by default released under the BSD 3-Clause License. See [license
file](https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/blob/master/LICENSE)
which is part of every release and the source code.
If you use, or want to refer to, CORSIKA 8 please cite ["Towards a Next
Generation of CORSIKA: A Framework for the Simulation of Particle
Cascades in Astroparticle Physics", Comput.Softw.Big Sci. 3 (2019)
2](https://doi.org/10.1007/s41781-018-0013-0). We kindly ask (and
require) any relevant improvement or addition to be offered or
Cascades in Astroparticle Physics", Comput. Softw. Big Sci. 3 (2019)
2](https://doi.org/10.1007/s41781-018-0013-0) as well as
["Simulating radio emission from particle cascades with CORSIKA 8", Astropart. Phys. 166 (2025)
103072](https://doi.org/10.1016/j.astropartphys.2024.103072).
We kindly ask (and require) any relevant improvement or addition to be offered or
contributed to the main CORSIKA 8 repository for the benefit of the
whole community.
When you plan to contribute to CORSIKA 8 check the guidelines outlined here:
CORSIKA 8 makes use of various third-party code, in particular interaction
models. Please check the [using and collaborating
agreement](https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/blob/master/USING_COLLABORATING.md)
for further information on this topic.
If you plan to contribute to CORSIKA 8, please check the guidelines outlined here:
[coding
guidelines](https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/blob/master/CONTRIBUTING.md). Code
that fails the review by the CORSIKA author group must be improved
that fails the review by the CORSIKA 8 author group must be improved
before it can be merged in the official code base. After your code has
been accepted and merged, you become a contributor of the CORSIKA 8
project (code author).
project (code author).
IMPORTANT: Before you contribute, you need to read and agree to the
[collaboration
agreement](https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/blob/master/COLLABORATION_AGREEMENT.md). The agreement can be discussed, and eventually improved.
We also want to point you to the [MCnet
guidelines](https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/blob/master/MCNET_GUIDELINES), which are very useful also for us.
IMPORTANT: Before you contribute, you need to read and agree to the conditions set out in the
[using and collaborating
agreement](https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/blob/master/USING_COLLABORATING.md).
The agreement can be discussed, and eventually improved if necessary.
## Get in contact
* Connect to https://gitlab.iap.kit.edu register yourself and join the "Air Shower Physics" group. Write to me (ralf.ulrich@kit.edu) only in case there are problems with that.
* Join our chat threads using Mattermost via this [invite link](https://mattermost.hzdr.de/signup_user_complete/?id=xtdd8jyt6trbiezt71gaz3z4ge&md=link&sbr=su). Click the `GitLab` button, then `Sign in with Helmholtz ID`. You will be able to make an account by either finding your institution, or using your e.g. ORCID, GitHub, or Google account.
* Connect to https://gitlab.iap.kit.edu, register yourself and join the "Air Shower Physics" group. Write to us on Mattermost (in the User Questions channel), or directly contact one of the [steering comittee members](https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/-/wikis/Steering-Committee) in case there are problems with that.
* Connect to corsika-devel@lists.kit.edu (self-register at
https://www.lists.kit.edu/sympa/subscribe/corsika-devel) to get in
touch with the project.
* Register on the corsika slack channel.
## Installation
CORSIKA 8 is tested regularly at least on gcc7.3.0 and clang-8.0.0.
CORSIKA 8 is tested regularly at least on `gcc11.0.0` and `clang-14.0.0`.
### Prerequisites
You will also need:
- Python 3 (supported versions are Python >= 3.6), with pip
- conan (via pip)
- cmake
- cmake > 3.4
- git
- g++, gfortran, binutils, make
- optional: FLUKA (see below)
On a bare Ubuntu 20.04, just add:
On a bare Ubuntu machine, just add:
``` shell
sudo apt-get install python3 python3-pip cmake g++ gfortran git doxygen graphviz
```
On a bare CentOS 7 install python3, pip3 (pip from python3) and cmake3. Any of the devtools 7, 8, 9 should work (at least).
Also initialize devtools, before building CORSIKA 8:
### Creating a virtual environment and Conan
It is recommended that you install CORSIKA 8 and its dependencies within a python3 virtual environment.
To do so, you can run the following.
``` shell
source /opt/rh/devtoolset-9/enable
# Create the environment using your native python3 binary
python3 -m venv /path/to/new/virtual/environment/corsika-8
# Load the environment (should be run each time you open a new terminal)
source /path/to/new/virtual/environment/corsika-8/bin/activate
```
You will need to load the environment each time that you open a new terminal.
CORSIKA 8 uses the [conan](https://conan.io/) package manager to
manage our dependencies. If you do not have Conan installed, it can be
installed with:
manage our dependencies. Currently, version 2.50.0 or higher is required.
**Note**: if you are NOT using a virtual environment, you may want to use the `pip install --user` flag.
``` shell
pip install --user conan
pip install conan particle==0.25.1 numpy
```
### Compiling
### Enabling FLUKA support
For legal reasons we do not distribute/bundle FLUKA together with CORSIKA 8.
As FLUKA is the standard low-energy hadronic interaction model for CORSIKA 8, you have to download
it separately from (http://www.fluka.org/), which requires registering there as FLUKA user.
The following should be done *before* compiling CORSIKA 8:
Once Conan is installed, follow these steps to download and install CORSIKA 8:
1. Note your system's version of gfortran (`gfortran --version`) and glibc (`ldd --version`)
2. Download the FLUKA __binary__, ensuring that it matches the versions you found above
3. Download the FLUKA __data file__ (will be named something similar to __fluka20xy.z-data.tar.gz__).
4. Un-tar the files that you downloaded using `tar -xf <filename>`
5. Set environmental variables `export FLUFOR=gfortran` and `export FLUPRO=<path to where you unzipped the files>`. Note that the `FLUPRO` directory should contain __libflukahp.a__. Both of these variables will have to be set every time you open a new terminal.
6. Go to the `FLUPRO` directory and run `make`. This will compile an exe, __flukahp__, in your current directory.
7. Follow the normal steps to compile CORSIKA 8 (see below).
When you later install CORSIKA 8, you should see a message during the __cmake__ step indicating the FLUKA was correctly found.
``` shell
libflukahp.a found in directory <some location here> via FLUPRO environment variable
FLUKA support is enabled.
```
### Compiling CORSIKA 8
Once Conan is installed and FLUKA provided, follow these steps to download and install CORSIKA 8:
``` shell
cd ./top/directory/for/corsika/installation
git clone --recursive git@gitlab.iap.kit.edu:AirShowerPhysics/corsika.git
# Or for https: git clone --recursive https://gitlab.iap.kit.edu/AirShowerPhysics/corsika.git
mkdir corsika-build
cd corsika-build
cmake ../corsika -DCMAKE_INSTALL_PREFIX=../corsika-install
make -j8
../corsika/conan-install.sh --source-directory ../corsika --release-with-debug
# conan-install.sh takes required options from command line to install dependencies for 'Debug', 'Release' and 'RelWithDebInfo' builds.
../corsika/corsika-cmake.sh -c "-DCMAKE_BUILD_TYPE="RelWithDebInfo" -DWITH_FLUKA=ON -DCMAKE_INSTALL_PREFIX=../corsika-install"
make -j4 #The number should match the number of available cores on your machine
make install
```
## Alternate installation using docker containers
## Installation (using docker containers)
There are docker containers prepared that bring all the environment and packages you need to run CORSIKA. See [docker hub](https://hub.docker.com/repository/docker/corsika/devel) for a complete overview.
There are docker containers prepared that bring all the environment and packages you need to run CORSIKA. See [docker hub](https://hub.docker.com/repository/docker/corsika/devel) for a complete overview.
### Prerequisites
You only need docker, e.g. on Ubunut: `sudo apt-get install docker` and of course root access.
You only need docker, e.g. on Ubuntu: `sudo apt-get install docker` and of course root access.
## Compiling
### Compiling
Follow these steps to download and install CORSIKA 8, master development version
```shell
git clone --recursive https://gitlab.iap.kit.edu/AirShowerPhysics/corsika.git
cd ./top/directory/for/corsika/installation
git clone --recursive git@gitlab.iap.kit.edu:AirShowerPhysics/corsika.git
sudo docker run -v $PWD:/corsika -it corsika/devel:clang-8 /bin/bash
mkdir build
cd build
cmake ../corsika -DCMAKE_INSTALL_PREFIX=../corsika-install
make -j8
mkdir corsika-build
cd corsika-build
../corsika/conan-install.sh --source-directory ../corsika --release-with-debug
# conan-install.sh takes required options from command line to install dependencies for 'Debug', 'Release' and 'RelWithDebInfo' builds.
../corsika/corsika-cmake.sh -c "-DCMAKE_BUILD_TYPE="RelWithDebInfo" -DWITH_FLUKA=ON -DCMAKE_INSTALL_PREFIX=../corsika-install"
make -j4 #The number should match the number of available cores on your machine
make install
```
## Runing Unit Tests
## Running Unit Tests
To run the Unit Tests, just type `ctest` in your build area.
To run the unit tests, do the following.
```shell
cd ./corsika-build
ctest -j4 #The number should match the number of available cores on your machine
```
## Running applications and examples
## Running examples
### Standard applications
To see how a relatively simple hadron cascade develops,
see `examples/cascade_example.cpp` for a starting point.
Applications for standard use-cases are located in the `applications` directory.
These are example scripts that can be used directly or slightly modified for your use case.
See [applications/README.md] for more.
The applications are compiled automatically after running `make` and will appear your `corsika-build/bin` directory.
After running `make install` the binaries will also be copied into your `corsika-install/bin` directory as well.
To run the cascade_example, or any other CORSIKA 8 application, you
must first compile it wrt. to the CORSIKA 8 header-only framework. This
can be done best by copying
e.g. `corsika-install/share/corsika/examples/` to your working place
(e.g. `corsika-work`).
Next, you need to define the environment variable `corsika_DIR` to point to, either,
your build, or your install area. Thus, e.g.
For example, from inside your `corsika-install/bin` directory, run
```shell
export corsika_DIR=<dir where you installed CORSIKA 8 to, or where you build it>
c8_air_shower --pdg 2212 -E 1e5 -f my_shower
```
This will run a vertical 100 TeV proton shower and will create and put the output into `./my_shower`.
Then compile your example/application with
### Building the examples
Unlike the applications, the examples must be compiled as a second step.
From your top corsika directory, (the one that includes `corsika-build` and `corsika-install`) run
```shell
cd corsika-work
cmake .
make
bin/cascade_example
export CONAN_DEPENDENCIES=$PWD/corsika-install/lib/cmake/dependencies
cmake -DCMAKE_TOOLCHAIN_FILE=${CONAN_DEPENDENCIES}/conan_toolchain.cmake -DCMAKE_PREFIX_PATH=${CONAN_DEPENDENCIES} -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=RelWithDebInfo -Dcorsika_DIR=$PWD/corsika-build -DWITH_FLUKA=ON -S $PWD/corsika/examples -B $PWD/corsika-build-examples
cd corsika-build-examples
make -j4 #The number should match the number of available cores on your machine
```
Visualize output (needs gnuplot installed):
You can run the examples by using the binaries in `corsika-build-examples/bin/`.
For example:
```shell
bash $corsika_DIR/share/corsika/tools/plot_tracks.sh tracks.dat
firefox tracks.dat.gif
corsika-build-examples/bin/known_particles
```
(note, if you use the corsika_DIR to point to the build area: the script `plot_tracks.sh` is
not copied to the build area, it is only part of the source tree at `tools/plot_tracks.sh`)
Or also consider the `vertical_EAS` example in the same directory,
which can be configured with command line options.
Run `bin/vertical_EAS` to get basic help.
This will print out all of the particles that are known by CORSIKA.
### Generating doxygen documentation
To generate the documentation, you need doxygen and graphviz. If you work with
the docker corsika/devel containers this is already included.
Otherwise, e.g. on Ubuntu 18.04, do:
To generate the documentation, you need doxygen and graphviz. If you work with
the docker corsika/devel containers this is already included.
Otherwise, e.g. on Ubuntu machines, do:
```shell
sudo apt-get install doxygen graphviz
```
Switch to the corsika build directory and do
Switch to the `corsika-build` directory and do
```shell
make docs
make install
......@@ -178,4 +223,3 @@ open with firefox:
```shell
firefox ../corsika-install/share/corsika/doc/html/index.html
```
CORSIKA 8 Framework for Particle Cascades in Astroparticle Physics
===================================================================
The purpose of CORSIKA is to simulate any particle cascades in
astroparticle physics or astrophysical context. A lot of emphasis is
put on modularity, flexibility, completeness, validation and
correctness. To boost computational efficiency different techniques
are provided, like thinning or cascade equations. The aim is that
CORSIKA remains the most comprehensive framework for simulating
particle cascades with stochastic and continuous processes.
The software makes extensive use of static design patterns and
compiler optimization. Thus, the most fundamental configuration
decision of the user must be performed at compile time. At run time
model parameters can still be changed.
CORSIKA 8 is by default released under the GPLv3 license. See `license
file <https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/blob/master/LICENSE>`_
which is part of every release and the source code.
If you use, or want to refer to, CORSIKA 8 please cite `"Towards a Next
Generation of CORSIKA: A Framework for the Simulation of Particle
Cascades in Astroparticle Physics", Comput.Softw.Big Sci. 3 (2019)
2 <https://doi.org/10.1007/s41781-018-0013-0>`_. We kindly ask (and
require) any relevant improvement or addition to be offered or
contributed to the main CORSIKA 8 repository for the benefit of the
whole community.
When you plan to contribute to CORSIKA 8 check the guidelines outlined here:
`coding
guidelines <https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/blob/master/CONTRIBUTING.md>`_. Code
that fails the review by the CORSIKA author group must be improved
before it can be merged in the official code base. After your code has
been accepted and merged, you become a contributor of the CORSIKA 8
project (code author).
IMPORTANT: Before you contribute, you need to read and agree to the
`collaboration agreement
<https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/blob/master/COLLABORATION_AGREEMENT.md>`_. The
agreement can be discussed, and eventually improved.
We also want to point you to the `MCnet guidelines
<https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/blob/master/MCNET_GUIDELINES>`_,
which are very useful also for us.
Get in contact
--------------
* Connect to https://gitlab.iap.kit.edu register yourself and join the "Air Shower Physics" group. Write to me (ralf.ulrich@kit.edu) only in case there are problems with that.
* Connect to corsika-devel@lists.kit.edu (self-register at
https://www.lists.kit.edu/sympa/subscribe/corsika-devel) to get in
touch with the project.
* Register on the corsika slack channel.
Installation
------------
CORSIKA 8 is tested regularly at least on gcc7.3.0 and clang-8.0.0.
Prerequisites
~~~~~~~~~~~~~
You will also need:
* Python 3 (supported versions are Python >= 3.6), with pip
* conan (via pip)
* cmake
* git
* g++, gfortran, binutils, make
On a bare Ubuntu 20.04, just add:
::
sudo apt-get install python3 python3-pip cmake g++ gfortran git doxygen graphviz
On a bare CentOS 7 install python3, pip3 (pip from python3) and cmake3. Any of the devtools 7, 8, 9 should work (at least).
Also initialize devtools, before building CORSIKA 8:
::
source /opt/rh/devtoolset-9/enable
CORSIKA 8 uses the `conan <https://conan.io/>`_ package manager to
manage our dependencies. If you do not have Conan installed, it can be
installed with:
::
pip install --user conan
Compiling
~~~~~~~~~
Once Conan is installed, follow these steps to download and install CORSIKA 8:
::
git clone --recursive git@gitlab.iap.kit.edu:AirShowerPhysics/corsika.git
mkdir corsika-build
cd corsika-build
cmake ../corsika -DCMAKE_INSTALL_PREFIX=../corsika-install
make -j8
make install
Installation (using docker containers)
--------------------------------------
There are docker containers prepared that bring all the environment and packages you need to run CORSIKA. See `docker hub <https://hub.docker.com/repository/docker/corsika/devel>`_ for a complete overview.
Prerequisites
~~~~~~~~~~~~~
You only need docker, e.g. on Ubuntu: :code:`sudo apt-get install docker` and of course root access.
Compiling
---------
Follow these steps to download and install CORSIKA 8, master development version
::
git clone --recursive https://gitlab.iap.kit.edu/AirShowerPhysics/corsika.git
sudo docker run -v $PWD:/corsika -it corsika/devel:clang-8 /bin/bash
mkdir build
cd build
cmake ../corsika -DCMAKE_INSTALL_PREFIX=../corsika-install
make -j8
make install
Runing Unit Tests
-----------------
To run the Unit Tests, just type :code:`ctest` in your build area.
Running examples
----------------
To see how a relatively simple hadron cascade develops,
see :code:`examples/cascade_example.cpp` for a starting point.
To run the cascade_example, or any other CORSIKA 8 application, you
must first compile it wrt. to the CORSIKA 8 header-only framework. This
can be done best by copying
e.g. :code:`corsika-install/share/corsika/examples/` to your working place
(e.g. :code:`corsika-work`).
Next, you need to define the environment variable :code:`corsika_DIR` to point to, either,
your build, or your install area. Thus, e.g.
::
export corsika_DIR=<dir where you installed CORSIKA 8 to, or where you build it>
Then compile your example/application with
::
cd corsika-work
cmake .
make
bin/cascade_example
Visualize output (needs gnuplot installed):
::
bash $corsika_DIR/share/corsika/tools/plot_tracks.sh tracks.dat
firefox tracks.dat.gif
(note, if you use the corsika_DIR to point to the build area: the script :code:`plot_tracks.sh` is
not copied to the build area, it is only part of the source tree at :code:`tools/plot_tracks.sh`)
Or also consider the :code:`vertical_EAS` example in the same directory,
which can be configured with command line options.
Run :code:`bin/vertical_EAS` to get basic help.
Generating doxygen documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To generate the documentation, you need doxygen and graphviz. If you work with
the docker corsika/devel containers this is already included.
Otherwise, e.g. on Ubuntu 18.04, do:
::
sudo apt-get install doxygen graphviz
Switch to the corsika build directory and do
::
make docs
make install
open with firefox:
::
firefox ../corsika-install/share/corsika/doc/html/index.html
These guidelines are copied from: http://www.montecarlonet.org/
---------------------------------------------------------------
# Usage and collaboration agreement
The CORSIKA 8 project very much welcomes all collaboration and
contributions. The aim of the project is to create a
scientific software framework as a fundamental tool for research.
MCNET GUIDELINES
The project consists of the contributions from the scientific
community and individuals in a best effort to deliver the best
possible performance and physics output.
for Event Generator Authors and Users
## The software license of the CORSIKA project
PREAMBLE
CORSIKA 8 is by default released under the BSD 3-Clause License, 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 contains the file LICENSE.
This generator has been developed as part of an academic research
project and is the result of many years of work by the authors.
Proper academic recognition is a requirement for its continued
development.
The code, documentation and content in the folder [./externals](./externals)
is not integral part of the CORSIKA project and can be based on, or
include, other licenses, which must be compatible with the CORSIKA 8 license.
The components of the program have been developed to work together
as a coherent physics framework. We believe that the creation of
separately maintained forks or piecewise distribution of individual
parts would diminish their scientific value.
The folder [./modules](./modules) contains the code of several
external physics models for your convenience. They each come with
their own license which we ask you to honor. Please also make sure to cite the
adequate reference papers when using their models in scientific work
and publications.
The authors are convinced that software development in a scientific
context requires full availability of all source code, to further
progress and to allow local modifications to meet the specific
requirements of the individual user.
Of course, we have the authors' consent to
distribute their code together with CORSIKA 8.
Therefore we have decided to release this program under the GNU
General Public License (GPL) version 2 (with the option to instead
follow the terms and conditions of any later version of GPL). This
ensures that the source code will be available to you and grants you
the freedom to use and modify the program. You can redistribute your
modified versions as long as you retain the GPL and respect existing
copyright notices (see the file 'COPYING' for details).
Check the content of these folders carefully for details and additional
license information. It depends on the configuration of
the build system to what extent this code is used to build CORSIKA.
By using the GPL, we entrust you with considerable freedom and expect
you to use it wisely, since the GPL does not address the issues in
the first two paragraphs. To remedy this shortcoming, we have
formulated the following guidelines relevant for the distribution
and usage of event generator software in an academic setting.
## Contributing
GUIDELINES
If you want to contribute, you need to read
[the contributing GUIDELINES](CONTRIBUTING.md) and comply with these rules, or help to
improve them.
## General guidelines
We reproduce below some guidelines copied from http://www.montecarlonet.org/ that we also ask you to follow in the spirit of academic collaboration.
1) The integrity of the program should be respected.
-------------------------------------------------
......@@ -90,23 +94,7 @@ and usage of event generator software in an academic setting.
modifications should be spelled out.
POSTSCRIPT
The copyright license of the software is the GPL v2 alone, therefore
the above guidelines are not legally binding. However, we reserve the
right to criticize offenders. The guidelines should always be combined
with common sense, for interpretation and for issues not covered.
Enquiries regarding the guidelines and related issues are encouraged
and should be directed to the authors of the program.
Please note that the program, including all its code and documentation,
is intended for academic use and is delivered "as is" to be used at
your own risk, without any guarantees.
----------------------------------------------------------------------
These guidelines were edited by Nils Lavesson and David Grellscheid
(These guidelines were originally edited by Nils Lavesson and David Grellscheid
for the MCnet collaboration, which has approved and agreed to respect
them. MCnet is a Marie Curie Research Training Network funded under
Framework Programme 6 contract MRTN-CT-2006-035606.
Framework Programme 6 contract MRTN-CT-2006-035606.)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
add_executable (c8_air_shower c8_air_shower.cpp)
target_link_libraries (c8_air_shower CORSIKA8)
if(WITH_FLUKA)
message("compiling c8_air_shower.cpp with FLUKA")
target_compile_definitions(c8_air_shower PRIVATE WITH_FLUKA)
else()
message("compiling c8_air_shower.cpp with UrQMD")
endif()
install (
TARGETS c8_air_shower DESTINATION bin
)
# CORSIKA 8 Applications
This directory contains standard applications which are typical for astroparticle physics solutions.
They are "physics-complete" and are suitable for generating simulations that can be used in publications.
For example, `c8_air_shower.cpp` would be a similar binary to what would be built by CORSIKA 7 and will simulate
air showers in a curved atmosphere.
%% ICRC 2021 - CORSIKA 8 author list
%% usage:
%% just include this file in your proceedings tex file
%% \input{authorlist.tex}
%%
\clearpage
\section*{Full Authors List: \Coll\ Collaboration}
\scriptsize
\noindent
Jean-Marco Alameddine$^{b}$,
Johannes Albrecht$^{b}$,
Jaime Alvarez-Muniz$^{r}$,
Antonio Augusto Alves Jr$^{d}$,
Luisa Arrabito$^{a}$,
Dominik Baack$^{b}$,
Konrad Bernlöhr$^{c}$,
Marcus Bleicher$^{o}$,
Johan Bregeon$^{s}$,
Mathieu Carrere$^{a}$,
Hans Dembinski$^{b}$,
Hannah Elfner$^{i}$,
Dominik Elsässer$^{b}$,
Ralph Engel$^{d}$,
Hu Fan$^{p}$,
Anatoli Fedynitch$^{j}$,
Dieter Heck$^{d}$,
Tim Huege$^{d,e}$,
Karl-Heinz Kampert$^{k}$,
Nikolaos Karastathis$^{d}$,
Lukas Nellen$^{f}$,
Maximilian Nöthe$^{b}$,
David Parello$^{t}$,
Tanguy Pierog$^{d}$,
Maria Pokrandt$^{d}$,
Anton Poctarev$^{d}$,
Remy Prechelt$^{l}$,
Maximilian Reininghaus$^{d,m}$,
Wolfgang Rhode$^{b}$,
Felix Riehn$^{h,r}$,
Maximilian Sackel$^{b}$,
Alexander Sandrock$^{u}$,
Pranav Sampathkumar$^{d}$,
Michael Schmelling$^{c}$,
André Schmidt$^{d}$,
Günter Sigl$^{n}$,
Jan Soedingrekso$^{b}$,
Bernhard Spaan$^{b}$,
Donglian Xu$^{q}$,
Juan Ammerman-Yebra$^{r}$
and
Enrique Zas$^{r}$
\noindent
$^a$Laboratoire Univers et Particules, Université de Montpellier 2, Montpellier, France,
$^b$Experimentelle Physik 5, TU Dortmund, Dortmund, Germany,
$^c$Max Planck Institute for Nuclear Physics, Heidelberg, Germany,
$^d$Institute for Astroparticle Physics, Karlsruhe Institute of Technology, Karlsruhe, Germany,
$^e$Astrophysical Institute, Vrije Universiteit Brussel, Brussels, Belgium
$^f$National Autonomous University of Mexico, Mexico City, Mexico,
$^g$Instituto de Tecnologías en Detección y Astropartículas, Buenos Aires, Argentina,
$^h$Laboratory of Instrumentation and Experimental Particles, Lisbon, Portugal,
$^i$Helmholtzzentrum für Schwerionenforschung, Darmstadt, Germany,
$^j$Institute for Cosmic Ray Research, The University of Tokyo, Tokyo, Japan,
$^k$Lehrstuhl für Astroteilchenphysik, Bergische Universität Wuppertal, Wuppertal, Germany,
$^l$Department of Physics & Astronomy, University of Hawai'i at Manoa, Honolulu, USA,
$^m$Instituto de Tecnologías en Detección y Astropartículas, Buenos Aires, Argentina,
$^n$II Institut für Theoretische Physik, Universität Hamburg, Hamburg, Germany,
$^o$Johann-Wolfgang-Goethe-Universitaet, Frankfurt am Main, Germany,
$^p$Peking University, Beijing, China,
$^q$Tsung-Dao Lee Institute, Shanghai, China,
$^r$Instituto Galego de Física de Altas Enerxías, Universidade de Santiago de Compostela, Santiago de Compostela, Spain,
$^s$Laboratoire de Physique Subatomique et de Cosmologie, Grenoble, France,
$^t$LIRMM, Univ Montpellier, CNRS, Montpellier, France,
$^u$National Research Nuclear University, Moscow Engineering Physics Institute, Moscow, Russia.
\ No newline at end of file
......@@ -3,9 +3,8 @@
#
# 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.
# This software is distributed under the terms of the 3-clause BSD license.
# See file LICENSE for a full version of the license.
#
# - find Conex
......
......@@ -3,9 +3,8 @@
#
# 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.
# This software is distributed under the terms of the 3-clause BSD license.
# See file LICENSE for a full version of the license.
#
add_library (PhysUnits INTERFACE)
......
......@@ -3,9 +3,8 @@
#
# 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.
# This software is distributed under the terms of the 3-clause BSD license.
# See file LICENSE for a full version of the license.
#
#################################################
......
......@@ -3,9 +3,8 @@
#
# 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.
# This software is distributed under the terms of the 3-clause BSD license.
# See file LICENSE for a full version of the license.
#
# Look for an executable called sphinx-build
......