/*! @page  g4setupb Geant4 Installation

<BR>
<B> Previous:</B> @ref sg4setup
<B> Up:</B> @ref g4setup
<B> Next:</B>  @ref ssg4setup2
<BR>

<HR>
 
@section ssg4setup Additionnal Libraries

<UL>
<LI><A HREF="#lbclhep">CLHEP:</A>
<LI><A HREF="#lbmesa">Mesa/OpenGL:</A>
<LI><A HREF="g4setupb.html#lbvrml">VRML:</A>
<LI><A HREF="#lbdawn">Dawn (optionnal): </A>
<LI><A HREF="#lbroot">Root: </A>
<LI><A HREF="#lbcomment">Comment: </A>
</UL>

As many environment variables will have to be set, it is better to create a script file which would collect all of them. Let us refer at it as the SetEnv.sh script file. One can also copy the environment variables directly in the bash_profile, but it is more clear to have them separately. Each time one would start a work on the simulation one should first execute the SetEnv.sh script.


\anchor lbclhep
<H3><A>CLHEP:</A>

</H3> The class libraries for high energy physics can be downloaded from the <A HREF="http://www.cern.ch/clhep">CLHEP website</A>. The installation is well detailled on the web. For the version we used the installation procedure can be described as follow 


*-# Download a 
<A HREF="http://www.cern.ch/clhep">clhep-version.tar.gz</A> file. Recommended: http://cern.ch/clhep/clhep-1.9.1.2.tgz because the 2.0.x.x release are not yet perfectly working.
*-# Create a directory CLHEP-VERSION/ and copy the clhep-version.tar.gz file in it.
*-# Untar and unzip the file with <pre>tar -xzfv clhep-version</pre>
*-# Create a work directory CLHEP out of the source directory, for example /home/user/CLHEP
*-# Go to CLHEP-VERSION/CLHEP directory and execute the following commands:
<PRE>
./configure --prefix=/home/user/CLHEP
</PRE>
(Note that files will be installed under /usr/local if you do not 
    specify a prefix.)
<PRE>
make
</PRE>    
(Build temporary copies of libraries and executables.)
<PRE>
make check
</PRE>    
(Run the tests.)
<PRE>
make install
</PRE>    
(Copy libraries, headers, executables, etc. to relevant 
    subdirectories under .)
*-# \anchor clheplibs <a>Set environement variable</a> to indicate where the libraries are located, and the reference name of the library. <a>To access the correct values, execute the following</a> 
<pre>
cd CLHEP/bin
./clheplib
</pre> 
add the CLHEP/lib directory to the list of library paths (e.g)
<PRE>
export LD_LIBRARY_PATH=:$LD_LIBRARY_PATH:/home/user/CLHEP/lib
</PRE>
and export the name of the library (e.g)
<PRE>
export CLHEP_LIB=CLHEP-1.9.1.2
</PRE>
Also set
<PRE>
export CLHEP_BASE_DIR=/home/user/CLHEP/
</PRE>
It is recommended to set those variables in the SetEnv.sh file, which would be dedicated to store and set all the environment variables of the simulation. It is important execute it before the compilation of \gf, which <a>needs</a> to have those variables set to run.

Geant4 can support many visualisation application and the user is free to chose the one which he prefers to use.

NB: When one has no root privileges, it is better to create a directory "CLHEP" appart the directory "CLHEP-version" where the downloaded file is extracted. The bin and libraries will be then store in the "CLHEP" directory. The same procedure is used below.

\anchor lbmesa
<H3><A>MesaGL/OpenGL:</A></H3>
For the visualisation in three dimensions engine is required. The usual engine is OpenGL and one should check that it is correctly installed on the system. If not, Mesa is a free engine that can be downloaded easily, together with a demos package, at <A
 HREF="www.mesa3d.org">Mesa3D</A> website. The instalation is done as follow

<OL>
<LI>Go to the top directory of Mesa and execute the command
<PRE>
make linux-x86
</PRE> 
(or the name of the system configuration) 
</LI>
<LI>Update the library environnement variable with the Mesa/lib directory 
<PRE>
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/Mesa/lib
</PRE> 
</LI>
<LI>The demos are installed in the Mesa/progs/demos directory, and one can run one of them to test if Mesa is well installed.

</LI>
</OL>

\anchor lbvrml
<H3><A>VRML virtual reality module:</A></H3>
Geant4 can export the geometry in the virtual reality modeling language (VRML) format. The <a href="http://freewrl.sourceforge.net/">freewrl</a> VRML viewer can be installed as a web browser plugin or ran  in stand alone mode by a script. 

First one should download <a href="http://www.freetype.org/index2.html">freetype</a> which is a nice font software used by <a href="http://freewrl.sourceforge.net/">freewrl</a>. It not present on the computer, <a href="http://www.freetype.org/index2.html">download it</a>, untar, create a "/home/user/freetype directory and enter the following commands in the code directory freetype-version:
*- ./configure /home/user/freetype  (or /usr/local, or the directory to output the libraries)
*-      make
*-      make install (for root privilege only, otherwise use the standalone script.)
*.
Then download <a href="http://freewrl.sourceforge.net/">freewrl</a> and open the INSTALL.HTML file. The installation is done in three steps:
* - Edit vrml.conf and adjust it to the system, in particular the output libraries directory can be set to /home/user/freewrl (for example) and the freetype2 libraries directory might be corrected. Moreover the lines refering to Java application could be commented out.
* - perl Makefile.PL
* - make install 
*.
Note that the library <a href="http://rpmfind.net/linux/rpm2html/search.php?query=libjs.so">libjs.so</a> shall be downloaded if necessary. It can be copied in the freewrl-version/blib/arch/auto/VRML/JS/ directory.
If one does not have the root privileges one can simply use the 
runme-standalone script. It is however a bit less efficient.

A better application is  <a href="http://sourceforge.net/projects/openvrml/">OPEN VRML</a>.
*- ./configure /home/user/OpenVRML 
*-      make
*-      make check
*-      make install 



\anchor lbdawn
<H3><A>DAWN:</A></H3>
  Danw is a usefull application, whih allow to generate *.eps files from three dimensional OpenGL pictures. The installation is done easily following the <A HREF="http://geant4.slac.stanford.edu/g4cd/March2004/Documentation/Visualization/G4DAWNTutorial/G4DAWNTutorial.html#applicationrun">danw</A> tutorial website intructions. The following environment variables should be defined:
<PRE>
export G4DAWN_NAMED_PIPE=1
export G4DAWN_GUI_ALWAYS=1
export G4DAWN_GUI_ALWAYS=1
export G4VIS_USE_DAWN=1
export G4DAWN_NAMED_PIPE=1
export DAWN_PS_PREVIEWER=/usr/X11R6/bin/gv
</PRE>

\anchor lbroot
<H3><A>ROOT:</A></H3>
For histogramming and generating ntuples or trees, Root is probably the most convenient tool. It also provides a convenient interface and the manipulation and fitting of histograms are some of it's important feaures. An comprehensive documentation is available in the  <A
 HREF="http://root.cern.ch/">web page</A>. The LEMuSR simulation requires Root to be installed.




\anchor lbcomment
<H3><A>Comment:</A></H3>
The new environement variables can be define in the bash file for example, in order to have them defined by default for any logging.

<P>
Those libraries come with many tests and it's is <B><I>recommended</I></B> to run some of them before going any further. 
<
*/