This is a repository with stuff I made while learning Geant4 Application Development and the C++ Programming Language. Further information not detailed as comments inside the source files can be found in:
- Introduction to Geant4
- Geant4 User's Guide: For Application Developers
- Geant4 User's Guide: For Toolkit Developers
- Geant4 Physics Reference Manual
- Geant4 Physics List Guide
- C++ Reference
- C Standard Library Reference
- C Standard (Older) (Newer)
Using this ShellScript one should be able to compile every basic and avanced example in Geant4's examples folder. In order to do that, place it inside the same folder where the source code for examples are found and run . compile.sh
.
The script will prompt for installation path to init ENVIRONMENT VARIABLES required by Geant4 to compile and run examples. It will also ask for the name of the source code file containing the int main{}
function (Usually it is exampleB1
, exampleB2a
, exampleB2b
, etc) but may differ in advanced examples. It will automatically create and go to directory ./build, then it will automatically generate build tools and compile the example.
- This ShellScript was NOT tested against extended examples, but should work just fine with advanced and basic ones.
- This ShellScript was created to work on LINUX environments and was tested in Ubuntu 22.04 LTS using a standard installation of Geant4 v11.0.2 based on Geant4 Installation Guide doc Rev6.0 using
-DGEANT4_USE_QT=ON
,-DGEANT4_BUILD_MULTITHREADED=ON
,-DGEANT4_INSTALL_DATA=ON
flags. Although it could work in previous and future versions (if folder structure don't change), there's no warranty that it will work. - This ShellScript is meant to make it easy to compile your first examples and should be treated as a training-wheel you want to get rid of and not get used to. You are strongly encouraged to read the Geant4 Documentation, CMake Documentation and Make Documentation.