Difference between revisions of "TF GEANT4.11"
| Line 6: | Line 6: | ||
==Step -by- Step commands==  | ==Step -by- Step commands==  | ||
| − | mkdir geant4.  | + |  mkdir geant4.11  | 
| − | cd geant4.  | + |  cd geant4.11  | 
| − | using   | + | using git to get version 4.11.2  | 
| − | + |  git clone https://github.com/Geant4/geant4.git  | |
| − | + |  git checkout v11.2.0  | |
| + |  mkdir build  | ||
| − | + |  cd build  | |
| − | |||
| − | cd   | ||
You need data file for the physics interaction processes  | You need data file for the physics interaction processes  | ||
| − | + |  cmake -DCMAKE_INSTALL_PREFIX=/data/src/GEANT4/4.11/geant4-install /data/src/GEANT4/4.11/geant4  | |
| − | |||
| − | |||
| − | cmake -DCMAKE_INSTALL_PREFIX=  | ||
| + |  cmake -DGEANT4_INSTALL_DATA=ON .  | ||
| + |  cmake -DCMAKE_INSTALL_PREFIX=/data/src/GEANT4/4.11/geant4-install /data/src/GEANT4/4.11/geant4  | ||
| − | + |  make -j8  | |
| − | + |  make install  | |
| − | + |  cd ../geant4-install/  | |
| − | + |  source bin/geant4.sh  | |
| − | |||
| − | |||
| − | |||
| − | |||
| Line 51: | Line 45: | ||
first try to compile example/novice/N01  located in the directory where you untarred everything  (geant4.9.6.p02)  | first try to compile example/novice/N01  located in the directory where you untarred everything  (geant4.9.6.p02)  | ||
| − | source geant4  | + | source geant4-install/bin/geant4.csh    | 
| − | cd geant4  | + | cd geant4/examples/basic/B1  | 
| + | |||
| + | mkdir build  | ||
| + | |||
| + | cd build  | ||
cmake .  | cmake .  | ||
| Line 77: | Line 75: | ||
rm CMakeCache.txt  | rm CMakeCache.txt  | ||
| − | cmake .  | + | cmake ../  | 
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | make  | |
==Commands used for version 4.9.5==  | ==Commands used for version 4.9.5==  | ||
Revision as of 22:51, 15 January 2024
resources
Step -by- Step commands
mkdir geant4.11
cd geant4.11
using git to get version 4.11.2
git clone https://github.com/Geant4/geant4.git
git checkout v11.2.0
mkdir build
cd build
You need data file for the physics interaction processes
cmake -DCMAKE_INSTALL_PREFIX=/data/src/GEANT4/4.11/geant4-install /data/src/GEANT4/4.11/geant4
cmake -DGEANT4_INSTALL_DATA=ON .
cmake -DCMAKE_INSTALL_PREFIX=/data/src/GEANT4/4.11/geant4-install /data/src/GEANT4/4.11/geant4
make -j8
make install
cd ../geant4-install/
source bin/geant4.sh
examples
You can test your installation by compiling and running the example programs
first try to compile example/novice/N01 located in the directory where you untarred everything (geant4.9.6.p02)
source geant4-install/bin/geant4.csh
cd geant4/examples/basic/B1
mkdir build
cd build
cmake .
make -f Makefile
./exampleN01
exampleN02 will allow you to test that you have installed the visual drivers needed to draw paraticle trajectories
creating a copy of an example
cd
mkdir geant4
cd geant4
cp -r geant4.10.02.p02/examples/novice/N02 ./
cd N02
rm CMakeCache.txt
cmake ../
make
Commands used for version 4.9.5
Download the source code to a subdirectory.
I stored it in /Users/tforest/src/GEANT4/geant4.9.5/geant4.9.5.p01
Then I created a build subdirectory
mkdir /Users/tforest/src/GEANT4/geant4.9.5/geant4.9.5-build
From inside the build directory I execute the cmake command using a switch to download the data files and install visulatization
cmake -DCMAKE_INSTALL_PREFIX=/Users/tforest/src/GEANT4/geant4.9.5/geant4.9.5-install -DGEANT4_USE_OPENGL_X11=ON GEANT4_INSTALL_DATA=ON /Users/tforest/src/GEANT4/geant4.9.5/geant4.9.5.p01
cmake -DCMAKE_INSTALL_PREFIX=/Users/tforest/src/GEANT4/geant4.9.5/geant4.9.5-install -DGEANT4_USE_XM=ON GEANT4_INSTALL_DATA=ON /Users/tforest/src/GEASNT4/geant4.9.5/geant4.9.5.p01
Then I install if teh make was succcessfull
make install
Build example N02
To build an example you need to create a build subdirectory under the subdirectory of teh example source code.
cmake -DGeant4_DIR=/Users/tforest/src/GEANT4/geant4.9.5/geant4.9.5-install ../
make
Simulations_of_Particle_Interactions_with_Matter#Building_GEANT4.11