Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a working directory for CLHEP and go into it.
    No Format
    mkdir clhep
    cd clhep
    
  2. Download the CLHEP tarball.
    No Format
    wget http://cern.ch/clhep/clhep-1.9.2.0.tgz
    
  3. Unzip to your work directory.
    No Format
    tar -zxvf clhep-1.9.2.0.tgz
    
  4. Change to CLHEP directory.
    No Format
    cd 1.9.2.0/CLHEP
    
  5. 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
    
  6. Build the library and install it. (Also takes a long time!)
    No Format
    make
    make install
    
  7. Add the following to setup.sh
    No Format
    export CLHEP_BASE_DIR=$sim_work/clhep
    

...

  1. Return to the work dir, create a Geant4 work subdir and go into it.
    No Format
    cd $sim_work
    mkdir geant4
    cd geant4
    
  2. Download the Geant4 tarball.
    No Format
    wget http://geant4.cern.ch/geant4/source/source/geant4.7.0.p01.tar.gz
    
  3. Unzip it.
    No Format
    tar -zxvf geant4.7.0.p01.tar.gz
    
  4. 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++
    
  5. Go into the Geant4 install base dir.
    No Format
    cd geant4.7.0.p01
    
  6. 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
    
  7. Build the physics list libraries. These will go into $G4INSTALL/lib/plists/WIN32-g++.
    No Format
    cd ../physics_lists/hadronic
    make
    
  8. Install the headers into $G4INSTALL/include.
    No Format
    make includes
    

...

  1. 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
    
  2. Download the Xerces tarball.
    No Format
    wget http://www.apache.org/dist/xml/xerces-c/xerces-c-src_2_6_0.tar.gz
    
  3. Unzip the tarball.
    No Format
    tar -zxvf xerces-c-src_2_6_0.tar.gz
    
  4. Set XERCESCROOT for the build in your environment, only.
    No Format
    export XERCESCROOT=${sim_work}/xerces-c-src_2_6_0
    
  5. Go into the Xerces-C++ build area.
    No Format
    cd xerces-c-src_2_6_0/src/xercesc
    
  6. Configure the build.
    No Format
    ./runConfigure -pcygwin -cgcc -xg++ \
    -minmem -nsocket -tnative -rpthread \
    -P `cd ../../..; pwd`
    
  7. Build and install it.
    No Format
    make
    make install
    
  8. 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.

  1. 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.
  2. Unzip the tarball.
    No Format
    tar -zxvf GDML2.tar.gz
    
  3. Change into the CPPGDML directory.
    No Format
    cd GDML2/CPPGDML
    
  4. Set GDML_BASE and PLATFORM in setup.sh.
    No Format
    export GDML_BASE=${sim_work}/GDML2/CPPGDML
    export PLATFORM=cygwin_g++
    
  5. Configure the build.
    No Format
    ./configure --enable-geant4-vis --enable-geant4-ui --with-geant4-libtype=granular \
    --with-platform=cygwin_g++
    
  6. Build it.
    No Format
    make
    

...

  1. 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
    
  2. Go into the LCDD dir.
    No Format
    cd lcdd
    
  3. Configure the build.
    No Format
    ./configure
    
  4. Build the library.
    No Format
    make
    
  5. 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.

  1. 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
    
  2. Go into the SLIC dir.
    No Format
    cd slic
    
  3. Set the SLIC_BASE variable in setup.sh.
    No Format
    export SLIC_BASE=${sim_work}/slic
    
  4. Configure the build with the Windows name for the Xerces-C++ lib.
    No Format
    ./configure
    
  5. 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

  1. Start -> Cygwin -> Cygwin Bash Shell
  2. Add Xerces-C++ bin to the path.
    No Format
    export PATH=/cygdrive/c/sim/xerces/bin:$PATH
    
  3. Go to SLIC directory.
    No Format
    cd /cygdrive/c/sim/slic
    
  4. 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

Additional Resources

SLIC Homepage
Running SLIC at SLAC