...
- Create a working directory for CLHEP and go into it.
No Format mkdir clhep cd clhep
- Download the CLHEP tarball.
No Format wget http://cern.ch/clhep/clhep-1.9.2.0.tgz
- Unzip to your work directory.
No Format tar -zxvf clhep-1.9.2.0.tgz
- Change to CLHEP directory.
No Format cd 1.9.2.0/CLHEP
- Run configure. (Takes a long time!Configure the build. (This took 15-20 minutes on my machine.)
No Format ./configure --prefix=`cd ../..; pwd` --disable-shared
- Build the library and install it. (Also takes a long time!)
No Format make make install
- Add the following to setup.sh
No Format export CLHEP_BASE_DIR=$sim_work/clhep
...
- Return to the work dir, create a Geant4 work subdir and go into it.
No Format cd $sim_work mkdir geant4 cd geant4
- Download the Geant4 tarball.
No Format wget http://geant4.cern.ch/geant4/source/source/geant4.7.0.p01.tar.gz
- Unzip it.
No Format tar -zxvf geant4.7.0.p01.tar.gz
- Setting the following variables in $setup.sh will allow you to compile without running Geant4's ./Configure script.
No Format G4INSTALL=${sim_wrk}/geant4/geant4.7.0.p01 G4SYSTEM=WIN32-g++
- Go into the Geant4 install base dir.
No Format cd geant4.7.0.p01
- Build the libraries, which will be placed at $G4INSTALL/lib/WIN32-g++. (It This could take up to a few hours depending on your machine.)
No Format make
- Build the physics list libraries. These will go into $G4INSTALL/lib/plists/WIN32-g++.
No Format cd ../physics_lists/hadronic make
- Install the headers into $G4INSTALL/include.
No Format make includes
...
- Go back to the work dir, create a subdir for Xerces-C++, and go into it.
No Format cd $sim_wrk mkdir xercesc cd xercesc
- Download the Xerces tarball.
No Format wget http://www.apache.org/dist/xml/xerces-c/xerces-c-src_2_6_0.tar.gz
- Unzip the tarball.
No Format tar -zxvf xerces-c-src_2_6_0.tar.gz
- Set XERCESCROOT for the build in your environment, only.
No Format export XERCESCROOT=${sim_work}/xerces-c-src_2_6_0
- Go into the Xerces-C++ build area.
No Format cd xerces-c-src_2_6_0/src/xercesc
- Configure the build.
No Format ./runConfigure -pcygwin -cgcc -xg++ \ -minmem -nsocket -tnative -rpthread \ -P `cd ../../..; pwd`
- Build and install it.
No Format make make install
- In setup.sh, set XERCESCROOT to the installation area and add the library pathDLL location the PATH.
No Format export XERCESCROOT=${sim_work}/xercesc export PATH=$XERCESCROOT/libbin:$PATH
GDML
GDML's CVS is not directly accessible from the command line, but a tarball is available through a WWW interface.
- Download a snapshot of the current CVS head using this link in your browser. : http://simu.cvs.cern.ch/cgi-bin/simu.cgi/simu/GDML2/GDML2.tar.gz?tarball=1.
- Save the tarball to sim_wrk, which should be C:\sim.
- Unzip the tarball.
No Format tar -zxvf GDML2.tar.gz
- Change into the CPPGDML directory.
No Format cd GDML2/CPPGDML
- Set GDML_BASE and PLATFORM in setup.sh.
No Format export GDML_BASE=${sim_work}/GDML2/CPPGDML export PLATFORM=cygwin_g++
- Configure the build.
No Format ./configure --enable-geant4-vis --enable-geant4-ui --with-geant4-libtype=granular \ --with-platform=cygwin_g++
- Build it.
No Format make
...
- Go to the work dir and checkout LCDD.
No Format cd ${sim_work} cvs -d CVSROOT=:pserver:anonymous@cvs.freehep.org:/cvs/lcd checkout lcdd
- Go into the LCDD dir.
No Format cd lcdd
- Configure the build.
No Format ./configure
- Build the library.
No Format make
- Set the LCDD_BASE variable in setup.sh.
No Format export LCDD_BASE=${sim_work}/lcdd
SLIC
...
Finally, you are ready to install the simulation "hub" package. After this, you will have a fully-featured Geant4 simulator on your Windows machine.
- Go to the work dir and checkout the work dir and checkout SLIC.
No Format cd ${sim_work} cvs -d CVSROOT=:pserver:anonymous@cvs.freehep.org:/cvs/lcd checkout slic
- Go into the SLIC dir.
No Format cd slic
- Set the SLIC_BASE variable in setup.sh.
No Format export SLIC_BASE=${sim_work}/slic
- Configure the build with the Windows name for the Xerces-C++ lib.
No Format ./configure
- Build the binary.
No Format make all
If the test build completes successfulsuccessfully, you should see SLIC's usage statement as it runs and then exitsfrom the test run.
Running SLIC after Installation
When you want to run it later in a Cygwin shell, you just need to have $XERCESCROOT/bin should be in the PATH, so that Windows can find the DLL the DLL at runtime. Since the other applications were linked-in statically, this should be the only setup requirement at runtime.
Running SLIC after Installation
- Start -> Cygwin -> Cygwin Bash Shell
- Add Xerces-C++ bin to the path.
No Format export PATH=/cygdrive/c/sim/xerces/bin:$PATH
- Go to SLIC directory.
No Format cd /cygdrive/c/sim/slic
- Run the executable.
No Format bin/WIN32-g++/slic [options]
If you receive an error message about a missing DLL cygxerces-c26.dll, then make sure that the PATH is setup correctly and Xerces-C++ was properly installed correctly.
Final Setup Script
The final version of setup.sh should look something like this.
No Format |
---|
#!/bin/sh # 1. work area export sim_work=/cygdrive/c/work/nsim # 2. java export JAVA_HOME=/cygdrive/c/Java/jdk1.4.2 export JDK_HOME=${JAVA_HOME} # 3. clhep installation area export CLHEP_BASE_DIR=${sim_work}/clhep # 4. geant4 export G4INSTALL=${sim_work}/geant4/geant4.7.0.p01 export G4SYSTEM=WIN32-g++ # 5. LCPhys export LCPHYS_BASE=${sim_work}/LCPhys # 6. LCIO export LCIO=${sim_work}/lcio export PATH=$LCIO/tools:$LCIO/bin:$PATH # 7. Xerces-C++ installation area export XERCESCROOT=${sim_work}/xercesc export PATH=$XERCESCROOT/bin:$PATH # 8. GDML export GDML_BASE=${sim_work}/GDML2/CPPGDML export PLATFORM=cygwin_g++ # 9. LCDD export LCDD_BASE=${sim_work}/lcdd # 10. SLIC export SLIC_BASE=${sim_work}/slic |
...
Tip |
---|
The G4WORKDIR directory should be set to LCDD_BASE when building LCDD and SLIC_BASE for SLIC, or your libs and binaries will may end up in strange places. |
Tip |
---|
When rebuilding Xerces-C++, which you will probably not need to do once you get it working, XERCESCROOT needs to be set back to the Xerces-C++ source area rather than the installation base. |
Done!
That's it.
Happy simulating!
See links in the next section for more information.
If you think this guide could be improved in any way, then please contact the author