IAP GITLAB

README.md 5.4 KB
Newer Older
Ralf Ulrich's avatar
doxygen  
Ralf Ulrich committed
1
# CORSIKA 8 Framework for Particle Cascades in Astroparticle Physics 
Ralf Ulrich's avatar
Ralf Ulrich committed
2

Ralf Ulrich's avatar
Ralf Ulrich committed
3 4 5 6 7 8 9
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.
Ralf Ulrich's avatar
Ralf Ulrich committed
10 11 12 13 14 15

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
only specific model parameters can still be changed.

Ralf Ulrich's avatar
Ralf Ulrich committed
16
CORSIKA 8 is by default released under the GPLv3 license. See [license
Ralf Ulrich's avatar
Ralf Ulrich committed
17 18 19
file](https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika/blob/master/LICENSE)
which is part of every release and the source code.

20
If you use, or want to refer to, CORSIKA 8 please cite ["Towards a Next
Ralf Ulrich's avatar
Ralf Ulrich committed
21 22 23
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
Ralf Ulrich's avatar
Ralf Ulrich committed
24
require) any relevant improvement or addition to be offered or
25
contributed to the main CORSIKA 8 repository for the benefit of the
Ralf Ulrich's avatar
Ralf Ulrich committed
26 27
whole community.

28
When you plan to contribute to CORSIKA 8 check the guidelines outlined here:
Ralf Ulrich's avatar
Ralf Ulrich committed
29 30 31 32
[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
33
been accepted and merged you become a contributor of the CORSIKA 8
Ralf Ulrich's avatar
Ralf Ulrich committed
34
project (code author). 
Ralf Ulrich's avatar
Ralf Ulrich committed
35 36 37 38 39 40 41 42 43 44 45 46

IMPORTANT: Before you 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.


## Get in contact
Ralf Ulrich's avatar
Ralf Ulrich committed
47
  * Connect to https://gitlab.ikp.kit.edu register yourself and join the "Air Shower Physics" group
Ralf Ulrich's avatar
Ralf Ulrich committed
48 49 50
  * 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
Ralf Ulrich's avatar
Ralf Ulrich committed
51 52


Ralf Ulrich's avatar
Ralf Ulrich committed
53 54 55 56

## Installation (from source)

### Prerequisites
Ralf Ulrich's avatar
Ralf Ulrich committed
57

Ralf Ulrich's avatar
Ralf Ulrich committed
58 59 60 61 62 63 64
CORSIKA 8 is tested regularly via gitlab-CI using recent gcc and clang
versions.  Additional software prerequisites: cmake, g++, git.
Furthermore, eigen3, boost, catch2, spdlog are shipped in the
ThirdParty directory, so an installation on the system is optional.
Also Pythia 8, CONEX and PROPOSAL are distributed in the ThirdParty
folder. You may also install those packages on your system and use
those; we test with Pythia version 8.235.
65

66
On a bare Ubuntu 18.04, just add:
Ralf Ulrich's avatar
Ralf Ulrich committed
67
```
Ralf Ulrich's avatar
Ralf Ulrich committed
68
sudo apt install binutils gfortran make python3 cmake gcc g++ git libz-dev libspdlog-dev libeigen3-dev libboost-iostreams-dev
Ralf Ulrich's avatar
Ralf Ulrich committed
69
```
Ralf Ulrich's avatar
Ralf Ulrich committed
70 71 72

Furthermore these packages are also reqommended:
add ```gcc ssh-client less rsync libboost-dev```
Ralf Ulrich's avatar
Ralf Ulrich committed
73

Ralf Ulrich's avatar
Ralf Ulrich committed
74 75
If you work with FreeBSD, run:
```
Ralf Ulrich's avatar
Ralf Ulrich committed
76
pkg install git cmake python3 flang eigen
Ralf Ulrich's avatar
Ralf Ulrich committed
77
```
Ralf Ulrich's avatar
Ralf Ulrich committed
78
or add ```boost-libs``` if you want to use the system versions. 
Ralf Ulrich's avatar
Ralf Ulrich committed
79

Ralf Ulrich's avatar
Ralf Ulrich committed
80
### Compiling
Ralf Ulrich's avatar
Ralf Ulrich committed
81

Ralf Ulrich's avatar
Ralf Ulrich committed
82
Follow these steps to download and install CORSIKA 8, master development version
Ralf Ulrich's avatar
Ralf Ulrich committed
83
```
Ralf Ulrich's avatar
Ralf Ulrich committed
84
git clone --recursive https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika.git
Ralf Ulrich's avatar
Ralf Ulrich committed
85 86 87 88 89 90 91
cd corsika
mkdir ../corsika-build
cd ../corsika-build
cmake ../corsika -DCMAKE_INSTALL_PREFIX=../corsika-install
make -j8
make install
```
Ralf Ulrich's avatar
Ralf Ulrich committed
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123

Type `make test` to run the unit test suite.

## 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 Ubunut: `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.ikp.kit.edu/AirShowerPhysics/corsika.git
cd corsika
sudo docker run -v $PWD:/corsika -it corsika/devel:clang-8 /bin/bash
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
make -j8
make install
```

Type `make test` to run the unit test suite.

## Running, Examples

There are various examples in the folder `Documentation/Examples`. 

If you want to see how the first simple hadron cascade develops, 
Ralf Ulrich's avatar
Ralf Ulrich committed
124
see `Documentation/Examples/cascade_example.cc` for a starting point. 
125 126 127 128 129 130 131

Run the cascade_example with: 
```
cd ../corsika-install
share/examples/cascade_example
```

Maximilian Reininghaus's avatar
Maximilian Reininghaus committed
132
Visualize output (needs gnuplot installed): 
133 134 135 136
```
bash share/tools/plot_tracks.sh tracks.dat 
firefox tracks.dat.gif 
```
Hans Dembinski's avatar
Hans Dembinski committed
137

Ralf Ulrich's avatar
Ralf Ulrich committed
138
Or also consider the `vertical_EAS` example in the same directory, which can 
Ralf Ulrich's avatar
Ralf Ulrich committed
139 140 141
be configured with command line options. 


Hans Dembinski's avatar
Hans Dembinski committed
142 143
### Generating doxygen documentation

Ralf Ulrich's avatar
Ralf Ulrich committed
144 145
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:
Hans Dembinski's avatar
Hans Dembinski committed
146 147 148 149 150 151
```
sudo apt-get install doxygen graphviz
```
Switch to the corsika build directory and do
```
make doxygen
152
make install
Hans Dembinski's avatar
Hans Dembinski committed
153
```
154 155 156 157
browse with firefox:
```
firefox ../corsika-install/share/doc/html/index.html
```
Ralf Ulrich's avatar
doxygen  
Ralf Ulrich committed
158