TF GEANT4.9.5

From New IAC Wiki
Jump to navigation Jump to search

resources

http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/

http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch02s07.html


mkdir geant4.9.5

cd geant4.9.5

mv ../geant4.9.5.p01.tar ./

tar -xvf geant4.9.5.p01.tar

ls

geant4.9.5.p01 geant4.9.5.p01.tar

mkdir geant4.9.5-build

cd geant4.9.5-build

You need data file for the physics interaction processes

If the server is up you can tell CMake to download them for you

cmake -DCMAKE_INSTALL_PREFIX=~/src/GEANT4/geant4.9.5/geant4.9.5-install -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=ON ~/src/GEANT4/geant4.9.5/geant4.9.5.p01

(the data files will be installed at geant4.9.5-install/share/Geant4-9.5.1/data)

If the server is down then you need to download, install and set environmental variables by hand

cmake -DCMAKE_INSTALL_PREFIX=~/src/GEANT4/geant4.9.5/geant4.9.5-install -DGEANT4_INSTALL_DATA=OFF -DGEANT4_USE_OPENGL_X11=ON ~/src/GEANT4/geant4.9.5/geant4.9.5.p01


make -j2 VERBOSE=1

make install

the above creates the subdirectory ~/src/GEANT4/geant4.9.5/geant4.9.5.p01/geant4.9.5-install


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.5.p01)

source geant4.9.5-install/bin/geant4.csh

cd geant4.9.5.p01/examples/novice/N01

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

cp -r geant4.9.5.p01/examples/novice/N02 ./


problems

1.) bus error on Mac if using -DGEANT4_USE_OPENGL_X11=ON

try using XM instead

cmake -DCMAKE_INSTALL_PREFIX=~/src/GEANT4/geant4.9.5/geant4.9.5-install -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_XM=ON ~/src/GEANT4/geant4.9.5/geant4.9.5.p01

opens up the GUI but also has a Bus error.

Commands used

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