This twiki page explains the process to statically link Geant 4 in a large dynamic library.

Recipe to link G4 in a large dynamic library

<!-- Add the main topic here. i.e. create some new headings as follows: -->

#grab the desired copy of geant4
cp -r /afs/ .

# get and change CLHEP version from to the appropriate one (in our example

asetup 19.0.1 here

svn co ${SVNGROUPS}/Computing/Simulation/Geant4/BuildScripts

vi BuildScripts/


#build it with (compare CompilingG4ForAtlas):

./BuildScripts/ -s $PWD/geant4.9.6.patch02.atlas03/ geant4.9.6.patch02.atlas03

#set link to data directory
mkdir -p InstallArea/external/Geant4/releases/share/geant4.9.6.patch02.atlas03/

cd InstallArea/external/Geant4/releases/share/geant4.9.6.patch02.atlas03/

ln -s /cvmfs/ data

#Copy linking script from my public folder (CLHEP, Xerces and Expat versions are hardcoded in this script!)

cp /afs/ .

#create dynamic library by executing script from workspace folder. It prints out all included files (which is a lot). it excludes all clhep libraries in G4.


#execute to get


#edit to add to the preloads

This topic: Sandbox > RobertLangenbergSandbox > StaticLinkingG4
Topic revision: r1 - 2014-05-14 - RobertLangenberg
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback