FairShip is the software framework for the SHiP experiment which is based on FairRoot. The dependencies of FairShip are tracked and installed using alibuild.
All packages are managed in Git and GitHub. Please read the Git tutorial for SHiP first, even if you already know Git, as it explains how development is done on GitHub.
All needed pre-requisites are provided by the FairSoft package, see below.
Additionally for developers:
- clang-format (to format code according to our style guide)
- clang-tidy (to check coding conventions -- mostly naming rules which are not covered by
cpplint
)
Build Instructions, following the tutorial given at the Nov'17 collab meeting
-
For a full installation go to step 3. If you work on lxplus, or on SLC6/CC7 and have access to
/cvmfs/ship.cern.ch
, and you only want to install FairShip, define enviroment variables:export SHIPBUILD=/cvmfs/ship.cern.ch/SHiPBuild
-
Install FairShip
git clone https://github.com/ShipSoft/FairShip.git cd FairShip ./localBuild.sh
-
Setup environment
source FairShipRun/config.sh
-
For a full installation on any linux system:
mkdir SHiPBuild; cd SHiPBuild git clone https://github.com/ShipSoft/FairShip.git FairShip/aliBuild.sh
-
Setup environment
alibuild/alienv enter (--shellrc) FairShip/latest
- Build an docker image from a Dockerfile:
git clone https://github.com/ShipSoft/FairShip.git cd FairShip docker build -t fairship .
- Run the FairShip docker image:
docker run -i -t --rm fairship /bin/bash
- Advanced docker run options:
Line
docker run -i -t --rm \ -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \ -v /local_workdir:/image_workdir \ fairship /bin/bash
-e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix
forwards graphics from the image to your local system (similar to ssh -X). Line-v /local_workdir:/image_workdir
shares/local_workdir
directory on the local system with/image_workdir
directory on the docker image system.
Partial installation, step 1 of above :
source FairShipRun/config.sh
If you have a full installation, step 3 of above:
alibuild/alienv enter (--shellrc) FairShip/latest
Now you can for example simulate some events, run reconstruction and analysis:
python $FAIRSHIP/macro/run_simScript.py
>> Macro finished succesfully.
>> Output file is ship.conical.Pythia8-TGeant4.root
python $FAIRSHIP/macro/ShipReco.py -f ship.conical.Pythia8-TGeant4.root -g geofile_full.conical.Pythia8-TGeant4.root
>> finishing pyExit
python -i $FAIRSHIP/macro/ShipAna.py -f ship.conical.Pythia8-TGeant4_rec.root -g geofile_full.conical.Pythia8-TGeant4.root
>> finished making plots
Run the event display:
python -i $FAIRSHIP/macro/eventDisplay.py -f ship.conical.Pythia8-TGeant4_rec.root -g geofile_full.conical.Pythia8-TGeant4.root
// use SHiP Event Display GUI
Use quit() or Ctrl-D (i.e. EOF) to exit
The following targets are only available if clang-format
, clang-tidy
and git
are installed.
Build targets indicated with *
always come in three different flavors.
no-suffix
: executes the target on source files that changed compared to origin/master -- e.g.make check-format
-staged
: executes the target on source files that have been staged -- e.g.make check-format-staged
-all
: executes the target on all source files in the project -- e.g.make check-format-all
Target | Description |
---|---|
check-format* |
run clang-format on selected files. Fails if any file needs to be reformatted |
show-format* |
run clang-format on selected files and display differences |
format* |
run clang-format on selected files and update them in-place |
check-tidy* |
run clang-tidy on selected files. Fails if errors are found |
show-tidy* |
run clang-tidy on selected files and display errors. |
tidy* |
run clang-tidy on selected files and attempt to fix any warning automatically |
check-cpplint* |
run cpplint on selected files. Fails if errors are found and displays them. |
check-submission |
will build, run all tests, check formatting, code style, and generate documentation and coverage report |
fix-submission |
will attempt to fix the reported issues using clang-format and clang-tidy . Failing build, tests, compiler warnings, issues from cpplint and warnings from doxygen must be fixed manually. Also some clang-tidy issues cannot be resolved automatically |