Installation Instructions for geant4 using sources.
Versions:
  1. geant 4.8.1.p02 (in principle should work for any 4.8.x version)
  2. clhep 1.9.2.3 (installed from sources)
  3. inventor 2.1.5-10 (used for OpenGL graphics drivers) (uses openmotif libraries)
  4. root 5.16.00 (installed using source)
Vipin Bhatnagar, Nov. 2007 Jan. 2008 Updated - VB ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1. Prepare an area eg. /opt for all the above installations with about 4-5GB
2. Build and install root (see README directory in root directory after ungzip
and untaring): Don't forget to define ROOTSYS variable and the corresponding
$ROOTSYS/lib (using LD_LIBRARY_PATH). One can install in /opt/root
3. CLHEP Installation:
a. cd /opt; mkdir clhep-1.9.2.3
b. cd clhep-1.9.2.3 and do:
make
make check # to test everything worked ok before installation
make install
====> check in here /usr/local/lib for CLHEP libs
To install CLHEP documentation, do:
(in clhep-1.9.2.3 directory)
a. make docs
b. make install-docs
====> check for documentation /usr/local/doc/HepMC

4. OpenInventor Installation:
a. gunzip+Untar inventor sources in /opt
b. you get /opt/inventor directory, cd /opt/inventor
c. must read README.FIRST, do the following:
export IVROOT=/usr/local/src
export LD_LIBRARY_PATH=$IVROOT/usr/lib
export FREETYPE=1
gmake install
===> Now testing it
ls $IVROOT
$IVROOT/usr/bin/ivview /usr/local/src/usr/demos/data/Inventor/windmill.iv
If everything worked OK for inventor one should see a WindMill running!
Congratulations! OpenGL is working.
NOTE: Your graphics adaptor should support OpenGL (eg. Intel 945, 946
Nvidia GeForce2, ATI Radeon PCIX400, etc. etc.)

5. Install GEANT4: in /opt
a. tar zxvf geant4.8.1.p02.gtar.gz and you get a directory "geant4.8.1.p02"
b. cd geant4.8.1.p02
c. Setup clhep/root/inventor lib location environment NOW.
For bash shell:
ROOTSYS=/opt/root
IVROOT=/usr/local/src/usr
export ROOTSYS IVROOT
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib:$IVROOT/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib (for clhep)
===>
Now comes the important part! Configuring geant4
------------------------------------------------
(i) mkdir /usr/local/geant481 (for installing libs etc.)
(ii) mkdir /opt/geant4.8.1.p02/data (for dumping G4 std data files:
You need to gunzip+untar the following files (with versions) in
this "data" directory:
G4ELASTIC.1.1.tar.gz PhotonEvaporation.2.0.tar.gz
G4EMLOW.4.0.tar.gz RadiativeDecay.3.0.tar.gz
G4NDL.3.9.tar.gz
(iii) Now in /opt/geant4.8.1.p02 enter the following command:
./Configure -build #this configure the G4 system and builds libs
It will ask you some questions, answer which are self evident :)
I am reproducing here what I used:- Carefully see where the default is
[y] or [n] and accordingly you copy that response and also locations!

+++++START++++++++++++++
--- Geant4 Toolkit Build ---


Would you like to see the instructions? [n]

Definition of G4SYSTEM variable is Linux-g++.
That stands for:

1) OS : Linux

2) Compiler : g++

To modify default settings, select number above (e.g. 2)
[Press [Enter] for default settings]

I can set things up so that your shell scripts and binaries are more portable,
at what may be a noticable cost in performance. In particular, if you
ask to be portable, the following happens:

1) Shell scripts will rely on the PATH variable rather than using
the paths derived above.
2) ~username interpretations will be done at run time rather than
by Configure.

Do you expect to run these scripts and binaries on multiple machines? [n]


Where is Geant4 source installed? [/opt/geant4.8.1.p02]
Specify the path where Geant4 libraries and source files should be
installed.
[/usr/local/geant481]

Do you want to copy all Geant4 headers
in one directory? [n]



Please, specify default directory where ALL the Geant4 data is installed:

G4LEVELGAMMADATA: /opt/geant4.8.1.p02/data/PhotonEvaporation2.0

G4RADIOACTIVEDATA: /opt/geant4.8.1.p02/data/RadiativeDecay3.0

G4LEDATA: /opt/geant4.8.1.p02/data/G4EMLOW4.0

NeutronHPCrossSections: /opt/geant4.8.1.p02/data/G4NDL3.9

G4ELASTICDATA: /opt/geant4.8.1.p02/data/G4ELASTIC1.1
You will be asked about customizing these next.
[/opt/geant4.8.1.p02/data]

Please, specify default directory where the Geant4 data is installed:

1) G4LEVELGAMMADATA: /opt/geant4.8.1.p02/data/PhotonEvaporation2.0

2) G4RADIOACTIVEDATA: /opt/geant4.8.1.p02/data/RadiativeDecay3.0

3) G4LEDATA: /opt/geant4.8.1.p02/data/G4EMLOW4.0

4) NeutronHPCrossSections: /opt/geant4.8.1.p02/data/G4NDL3.9

5) G4ELASTICDATA: /opt/geant4.8.1.p02/data/G4ELASTIC1.1

To modify default settings, select number above (e.g. 2)
[Press [Enter] for default settings]

Please, specify where CLHEP is installed. It was found in:

CLHEP_BASE_DIR: /
[/] /usr/local

You can customize paths and library name of you CLHEP installation:

1) CLHEP_INCLUDE_DIR: /usr/local/include
2) CLHEP_LIB_DIR: /usr/local/lib
3) CLHEP_LIB: CLHEP
To modify default settings, select number above (e.g. 2)
[Press [Enter] for default settings]

By default 'static' (.a) libraries are built.

Do you want to build 'shared' (.so) libraries?
[y]


You selected to build 'shared' (.so) libraries.
Do you want to build 'static' (.a) libraries too?
[n] y

Do you want to build 'global' compound libraries? [n]



Do you want to compile libraries in DEBUG mode (-g)? [n]

G4UI_NONE

If this variable is set, no UI sessions nor any UI libraries are built.
This can be useful when running a pure batch job or in a user framework
having its own UI system.
Do you want to set this variable ?
[n]

G4UI_BUILD_XAW_SESSION
G4UI_USE_XAW

Specifies to include and use the XAW interfaces in the
application to be built.
The XAW (X11 Athena Widget set) extensions are required to activate
and build this driver.
[n]

G4UI_BUILD_XM_SESSION
G4UI_USE_XM
Specifies to include and use the XM Motif based user interfaces.
The XM Motif extensions are required to activate and build this
driver.
[y]

XM/include
XM/lib

You have selected to use the XM Motif based user interfaces.
Specify the correct path where Xm is installed in your system.
It was found in /usr/X11R6. Press [Enter] to set this path or type the correct
one.

You can set '-' (without quotation) to CANCEL the XM flag at all:
[/usr/X11R6]

G4VIS_NONE

If this variable is set, no visualization drivers will be built or used.
Do you want to set this variable ?
[n]

G4VIS_BUILD_OPENGLX_DRIVER
G4VIS_USE_OPENGLX

It is an interface to the de facto standard 3D graphics library,
OpenGL. It is well suited for real-time fast visualization
and prototyping. The X11 version of the OpenGL libraries is
required.
[y]

G4VIS_BUILD_OPENGLXM_DRIVER
G4VIS_USE_OPENGLXM

It is an interface to the de facto standard 3D graphics library,
OpenGL. It is well suited for real-time fast visualization
and prototyping. The X11 version of the OpenGL libraries and
the Motif Xm extension is required.
[y]

G4VIS_BUILD_DAWN_DRIVER
G4VIS_USE_DAWN

DAWN drivers are interfaces to the Fukui Renderer DAWN. DAWN is
a vectorized 3D PostScript processor suited to prepare technical
high quality outputs for presentation and/or documentation.
[y]

G4VIS_BUILD_OIX_DRIVER
G4VIS_USE_OIX

The OpenInventor driver is based on OpenInventor technology
for scientific visualization.
The X11 version of OpenInventor is required.
[y]

OIVHOME/include
OIVHOME/lib

You have selected to use OpenInventor driver.
Specify the correct path (OIVHOME) where OpenInventor is installed in your
system.
It was found in /usr/local/src/usr. Press [Enter] to set this path or type the
correct one.

You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
[/usr/local/src/usr]

G4VIS_BUILD_RAYTRACERX_DRIVER
G4VIS_USE_RAYTRACERX

Allows for interactive ray-tracing graphics through X11.
The X11 package is required.
[y]

G4VIS_BUILD_VRML_DRIVER
G4VIS_USE_VRML

These driver generate VRML files, which describe 3D scenes to be
visualized with a proper VRML viewer.
[n]

OGLHOME/include
OGLHOME/lib

You have selected to use OpenGL driver.
Specify the correct path (OGLHOME) where OpenGL is installed in your system.
It was found in /usr. Press [Enter] to set this path or type the correct one.

You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
[/usr]

G4LIB_BUILD_G3TOG4

The utility module 'g3tog4' will be built by setting this
variable. NOTE: it requires a valid FORTRAN compiler to be
installed on your system and the 'cernlib' command in the
path, in order to build the ancillary tools!
Do you want to build 'g3tog4' ?

[n]



G4LIB_BUILD_ZLIB

Do you wish to activate compression for output files generated
through the HepRep visualization driver ?
[y]

G4ANALYSIS_USE

Activates the configuration setup for allowing plugins to
analysis tools based on AIDA (Astract Interfaces for Data
Analysis). In order to use AIDA features and compliant analysis
tools, the proper environment for these tools will have to be
set (see documentation for the specific analysis tools).
[y]

End of configuration phase.


Creating configuration setup file...


Now starting Geant4 libraries build...

On this machine the G4SYSTEM=Linux-g++
On this machine the G4INSTALL=/opt/geant4.8.1.p02
On this machine the G4TMP=/opt/geant4.8.1.p02/tmp
..........................
.........................
Starting build...

*************************************************************
Installation Geant4 version : geant4-08-01-patch-02
Copyright (C) 1994-2006 Geant4 Collaboration
*************************************************************
..................................
........................................
Creating shared library /opt/geant4.8.1.p02/lib/Linux-g++/libG4OpenInventor.so
...
Creating/replacing object files in
/opt/geant4.8.1.p02/lib/Linux-g++/libG4OpenInventor.a ...
ar: creating /opt/geant4.8.1.p02/lib/Linux-g++/libG4OpenInventor.a
libmap stage:
Searching for GNUmakefiles and sorting ...
Weeding out paths and files ...
Making libname.map starter file ...
Making libname.map ...
Reading library name map file...
Reading dependency files...
Checking for circular dependencies...
Reordering according to dependencies...
Writing new library map file...

####################################################
# Your Geant4 installation seems to be successful!
# To be sure please have a look into the log file:
# /opt/geant4.8.1.p02/.config/bin/Linux-g++/g4make.log
####################################################
+++++++++++FINISH+++++++++++++++++++++++++++

It takes some time close 1 hour for building on a P4 2GHz with 512MB RAM

(iv) Now to install everything in /usr/local/geant481:
./Configure -install (as the -build doesnot install)
and you should see two directories under /usr/local/geant481: lib src

(v) You are done now! GREAT.

6. TESTING of Geant4 NOW
---------------------
To be Added Here.....pls. wait for an update.


contact: vipinATpu.ac.in