Below we give the explicit instructions (described in general at How to build and run an example page) for the example extended/electromagnetic/TestEm1.
Let's suppose that the TestEm1 directory is available in $HOME and Geant4 installation in /usr/local and we work within the bash shell on a 64-bit machine.
% cd $HOME % mkdir TestEm1_build % cd TestEm1_build % cmake -DGeant4_DIR=/usr/local/lib64/Geant4-11.0.0/ ../TestEm1 % make -j 2 TestEm1
% cd $HOME/TestEm1_build # or cd $HOME/TestEm1 if example was built with GNUmake % ./TestEm1 annihil.mac % ./TestEm1 brem.mac % ./TestEm1 TestEm1.in >& myTestEm1.out # redirecting output in a file
% cd $HOME/TestEm1_build # or cd $HOME/TestEm1 if example was built with GNUmake % ./TestEm1 PreInit> /run/initialize Idle> /run/beamOn 1 ... Idle> exit