From 3eea42d4bf7d56dbc6aed3391fd2e8838d157b20 Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Thu, 27 Dec 2018 11:41:22 +0100 Subject: [PATCH] improve gitlab/build infrastructure --- .gitlab-ci.yml | 18 +++++++++++++++++ CMakeLists.txt | 1 + Documentation/Examples/CMakeLists.txt | 8 ++++---- README.md | 28 +++++++++++++++++++++------ Tools/CMakeLists.txt | 6 ++++++ 5 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 Tools/CMakeLists.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad2746000..5d437eecb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ variables: before_script: - apt-get update --yes - apt-get install --yes cmake libboost-dev libeigen3-dev python3 gfortran + - apt-get install --yes doxygen graphviz build: stage: build @@ -18,6 +19,23 @@ build: - cmake --build . - ctest +pages: + stage: documentation + script: + - make doxygen + - mkdir .public + - cp -r Documentation/Doxygen/html .public/ + - mv .public public + artifacts: + paths: + - public + only: + - master + - tags + - triggers + - schedules + + # code_quality: # image: docker:stable # variables: diff --git a/CMakeLists.txt b/CMakeLists.txt index d2d4df9b1..f0a9f0898 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,3 +70,4 @@ add_subdirectory (Setup) add_subdirectory (Processes) add_subdirectory (Documentation) add_subdirectory (Main) +add_subdirectory (Tools) diff --git a/Documentation/Examples/CMakeLists.txt b/Documentation/Examples/CMakeLists.txt index cd7e52513..47a7a495c 100644 --- a/Documentation/Examples/CMakeLists.txt +++ b/Documentation/Examples/CMakeLists.txt @@ -7,13 +7,13 @@ add_test(helix_example helix_example) add_executable (geometry_example geometry_example.cc) target_compile_options(geometry_example PRIVATE -g) # do not skip asserts target_link_libraries (geometry_example CORSIKAgeometry CORSIKAunits) -#install (TARGETS geometry_example DESTINATION share/examples) +install (TARGETS geometry_example DESTINATION share/examples) add_test(geometry_example geometry_example) add_executable (logger_example logger_example.cc) target_compile_options(logger_example PRIVATE -g) # do not skip asserts target_link_libraries (logger_example CORSIKAunits CORSIKAlogging) -#install (TARGETS logger_example DESTINATION share/examples) +install (TARGETS logger_example DESTINATION share/examples) add_test(logger_example logger_example) add_executable (stack_example stack_example.cc) @@ -35,7 +35,7 @@ target_link_libraries (cascade_example SuperStupidStack CORSIKAunits CORSIKAlogg CORSIKAenvironment CORSIKAprocesssequence ) -#install (TARGETS cascade_example DESTINATION share/examples) +install (TARGETS cascade_example DESTINATION share/examples) add_test(cascade_example cascade_example) add_executable (staticsequence_example staticsequence_example.cc) @@ -45,5 +45,5 @@ target_link_libraries (staticsequence_example CORSIKAunits CORSIKAgeometry CORSIKAlogging) -#install (TARGETS staticsequence_example DESTINATION share/examples) +install (TARGETS staticsequence_example DESTINATION share/examples) add_test(staticsequence_example staticsequence_example) diff --git a/README.md b/README.md index 421dc0860..d072278b2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Documentation and reference guide for the CORSIKA8 software framework for air shower simulations. We aim that CORSIKA remains the most comprehensive framework for simulating particle cascades with stochastic and continuous processes. The purpose of CORSIKA is to -simulate any particle cascades in astroparticle physics or astrophysical context. A lot of emphasis is put on modularity, completeness, validation and correctness. To boost computational efficiency different techniques are +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 software makes extensive use of static design patterns and @@ -14,9 +14,9 @@ only specific model parameters can still be changed. CORSIKA8 is released under the GPL3 license. See [license file](https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika/blob/master/LICENSE) which is part of every release and the source code. When you contribute to CORSIKA check the guidelines outlined here: -[coding guidelines](https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika/blob/master/CONTRIBUTING.md). Code that fail 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 project and you should include yourself in the [AUTHORS](https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika/blob/master/AUTHORS) file. +[coding guidelines](https://gitlab.ikp.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 project and you should include yourself in the [AUTHORS](https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika/blob/master/AUTHORS) file. -You need to read and agree to the [collaboration agreement](https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika/blob/master/COLLABORATION_AGREEMENT.md). The agreement can be discussed, and eventually improved. +IMPORTANT: Before your contribute, you need to read and agree to the [collaboration agreement](https://gitlab.ikp.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.ikp.kit.edu/AirShowerPhysics/corsika/blob/master/MCNET_GUIDELINES), which are very useful also for us. @@ -27,11 +27,11 @@ Prerequisites: eigen3, boost, cmake, g++, git. On Ubuntu 18.04, just do: sudo apt-get install libeigen3-dev libboost-dev cmake g++ git ``` -Follow these steps to download and install CORSIKA8-milestone1 +Follow these steps to download and install CORSIKA8-milestone2 ``` git clone git@gitlab.ikp.kit.edu:AirShowerPhysics/corsika.git cd corsika -git checkout milestone1 +git checkout milestone2 mkdir ../corsika-build cd ../corsika-build cmake ../corsika -DCMAKE_INSTALL_PREFIX=../corsika-install @@ -39,7 +39,19 @@ make -j8 make install make test ``` -and if you want to see how the Heitler model works and is implemented, see `Framework/Cascade/testCascade.cc` for a starting point. +and if you want to see how the first simple hadron cascade develops, see `Documentation/Examples/cascade_example.cc` for a starting point. + +Run the cascade_example with: +``` +cd ../corsika-install +share/examples/cascade_example +``` + +Visualize output: +``` +bash share/tools/plot_tracks.sh tracks.dat +firefox tracks.dat.gif +``` ### Generating doxygen documentation @@ -51,3 +63,7 @@ Switch to the corsika build directory and do ``` make doxygen ``` +browse with firefox: +``` +firefox ../corsika-install/share/doc/html/index.html +``` diff --git a/Tools/CMakeLists.txt b/Tools/CMakeLists.txt new file mode 100644 index 000000000..c0e4c12b9 --- /dev/null +++ b/Tools/CMakeLists.txt @@ -0,0 +1,6 @@ +set (TOOLS_FILES plot_tracks.sh) + +install ( + FILES ${TOOLS_FILES} + DESTINATION share/tools + ) -- GitLab