Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Standalone Windows Distribution

If you do not want to build SLIC yourself, there is a Windows executable available for download.

The current version is available as a ZIP file containing a static binary and the required DLLs.

Download the ZIP file using your browser and unzip the contents to C:. You should see the directory C:\slic_win32.

Test out the binary by running it in a console window.

  1. Start -> Run -> cmd.
  2. Press ENTER.
  3. Go to the SLIC directory.
    No Format
    
    C:\
    cd slic_win32
    
  4. Execute SLIC from the command line.
    No Format
    
    slic
    
Info

Cygwin needs to be installed to run SLIC.

Download the SLIC Windows binary from this location.

http://www.lcsim.org/dist/slic/slic-current-WIN32-g%2B%2B-bin.tar.gz

Open a Cygwin window and go to the directory where you saved the tarball.

Untar the file after it is saved to your computer.

No Format

tar -zxvf slic-current-WIN32-g++-bin.tar.gz

Now test the binary.

No Format

cd SimDist
./scripts/slic.sh

The slic usage screen should showThe Xerces and Cygwin DLLs are also included so that the package is standalone.

Preliminary Setup for Installation

...

  1. Download the Cygwin setup program.
  2. Double-click on it and click Next.
  3. Select Install from Internet and click Next.
  4. Enter your preferred Root Directory and click Next.
  5. Enter your preferred Local Package Directory, which can be the same as the Root Directory, and then click Next.
  6. Select Direct Connection and click Next.
  7. Select a site from the Available Download Sites. Servers inside your country will probably be fastest. I use ftp://ftp.sunsite.utk.edu.
  8. Click Next.
  9. In the Cygwin Setup - Select Packages window, you need to make sure that the following tools are selected by clicking in the corresponding box under the New column until you see a version number.
    1. Required packages.
      • Devel -> cvs
      • Devel -> gcc-core
      • Devel -> gcc-g++
      • Devel -> make
      • Base -> gzip
      • Base -> tar
    2. If OpenGL visualization is being used, these should also be installed.
      • X11 -> ALL
      • Graphics -> OpenGL
    3. Tool for downloading package tarballs and zip files.
      • Web -> wget
  10. Click Next after you have selected the packages.
  11. Cygwin will now automatically download and install all the selected packages. It might take awhile, so now is the time to go get some coffee.
  12. If desired, select Create icon on Desktop or Add icon to Start Menu, and click Finish.

If you need additional information on this installation process, Norman Graf has more detailed Cygwin installation instructions.

Tip
titleCygwin Packages

It may be easier to simply install all Cygwin packages instead of selecting them individually.

If you need additional information on this installation process, Norman Graf has more detailed Cygwin installation instructions.

Testing the Cygwin Command Line Tools

...

Package Installations

CLHEP

CLHEP has installation instructions for version 1.9 and up. But you should not need them to setup the package.(http://wwwasd.web.cern.ch/wwwasd/lhc\+\+/clhep/INSTALLATION/newCLHEP-install.html) for version 1.9 and up. But you should not need them to setup the package.

  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. 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 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.p011.tar.gz
    
  3. Unzip it.
    No Format
    tar -zxvf geant4.7.0.p011.tar.gz
    
  4. Set the following variables in setup.sh. (You should not need to run Geant4's Configure script.)
    No Format
    export G4INSTALL=${sim_wrkwork}/geant4/geant4.7.0.p011
    export G4SYSTEM=WIN32-g++
    
    Go into the Geant4 base dir If you would like to enable OpenGL visualization, add the following variable definitions.
    This assumes you installed the X11 libraries when you set up cygwin.
    No Format
    cd geant4.7.0.p01
    
  5. Build the libraries, which will be placed at $G4INSTALL/lib/WIN32-g++. (This could take up to a few hours depending on your machine.)
    No Format
    
    cd source
    make
    
  6. export OGLHOME=/usr/X11R6
    export G4VIS_BUILD_OPENGLX_DRIVER=1
    export G4VIS_USE_OPENGLX=1
    
  7. Go into the Geant4 base dirInstall the headers into $G4INSTALL/include.
    No Format
    make includes
    
  8. Build the physics list libraries. These will go into $G4INSTALL/lib/plists/WIN32-g++.
    No Format
    
    cd ../physics_lists/hadronic
    make
    

Hopefully, Geant4 has been installed successfully, and you don't have too many more gray hairs.

LCPhys

SLIC requires a special physics list written by Dennis Wright for Linear Collider physics.

  1. Go back to the work dir.
    No Format
    
    cd $sim_wrk
    
  2. Checkout the physics list from CVS.
    No Format
    
    cvs -d :pserver:anonymous@cvs.freehep.org:/cvs/lcd checkout LCPhys
    
  3. Assuming that the environment from the Geant4 installation is still in place, you can build this like any other physics list, and the library should be installed into $G4INSTALL/lib/plists/WIN32-g++.
    No Format
    
    cd LCPhys
    make
    
  4. Set the LCPhys variable in setup.sh.
    No Format
    
    export LCPHYS_BASE=$sim_wrk/LCPhys
    

LCIO

LCIO provides binary output capabilities.

Warning

Installation requires a working Java runtime for ant support.

LCIO has a very nice manual with a whole section on installation. Thanks, Frank!

I will still walk you through the basic procedure.

  1. cd geant4.7.1
    
  2. LCPhys requires that a special flag is set in order to use the latest Kaon model. At the end of config/architecture.gmk, insert the following line exactly as it appears below:
    No Format
    
    CPPFLAGS += -DG4BERTINI_KAON
    
    Hopefully, this hack will be remedied soon!
  3. Now for another lovely Geant4 hack. In order to successfully compile the HepRep driver, the following line in the file config/sys/WIN32-g++.gmk
    No Format
    
    CXXFLAGS  := -Wall -ansi -pedantic -pipe
    
    should be replaced with
    No Format
    
    CXXFLAGS  := -W -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long
    CXXFLAGS  += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe 
    
  4. Build the libraries, which will be placed at $G4INSTALL/lib/WIN32-g++. (This could take up to a few hours depending on your machine.)
    No Format
    
    cd source
    make
    
  5. Install the headers into $G4INSTALL/include.
    No Format
    
    make includes
    
  6. Build the physics list libraries. These will go into $G4INSTALL/lib/plists/WIN32-g++.
    No Format
    
    cd ../physics_lists/hadronic
    make
    

Hopefully, Geant4 has been installed successfully, and you don't have too many more gray hairs.

LCPhys

SLIC requires a special physics list written by Dennis Wright for Linear Collider physics.

  1. Go Go back to the work dir.
    No Format
    cd $sim_wrkwork
    
  2. Checkout LCIO the physics list from CVS.
    No Format
    cvs -d :pserver:anonymous@cvs.freehep.org:/cvs/lciolcd checkout lcio
    
  3. Add these lines to your setup.sh.
    No Format
    
    export LCIO=${sim_wrk}/lcio 
    export PATH=$LCIO/tools:$LCIO/bin:$PATH
    
  4. LCPhys
    
  5. Assuming that the environment from the Geant4 installation is still in place, you can build this like any other physics list, and the library should be installed into $G4INSTALL/lib/plists/WIN32-g++Build the libraries using the bundled aid and ant tools.
    No Format
    cd lcio
    ant aid.generate cpp
    

Xerces-C++

  1. LCPhys
    make
    
  2. Set the LCPhys variable in setup.shGo back to the work dir, create a subdir for Xerces-C++, and go into it.
    No Format
    cdexport LCPHYS_BASE=$sim_wrk
    mkdir xercesc
    cd xercesc
    work/LCPhys
    

LCIO

LCIO provides binary output capabilities.

Warning

Installation requires a working Java runtime for ant support.

LCIO has a very nice manual with a whole section on installation. Thanks, Frank!

I will still walk you through the basic procedure.

  1. Go back to the work dirDownload 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
    cd $sim_work
    
  2. Checkout LCIO from CVS.
    No Format
    tarcvs -zxvf xerces-c-src_2_6_0.tar.gz
    d :pserver:anonymous@cvs.freehep.org:/cvs/lcio checkout lcio
    
  3. Add these lines to your setup.shSet XERCESCROOT for the build in your environment, only.
    No Format
    export XERCESCROOTLCIO=${sim_work}/xerces-c-src_2_6_0
    
    Go into the Xerces-C++ build area
    lcio 
    export PATH=$LCIO/tools:$LCIO/bin:$PATH
    
  4. Build the libraries using the bundled aid and ant tools.
    No Format
    cd xerces-c-src_2_6_0/src/xercesc
    lcio
    ant aid.generate cpp
    

Xerces-C++

  1. Go back to the work dir, create a subdir for Xerces-C++, and go into
  2. Configure the build.
    No Format
    
    ./runConfigure -pcygwin -cgcc -xg++ \
    -minmem -nsocket -tnative -rpthread \
    -P `cd ../../..; pwd`
    
  3. Build and install it.
    No Format
    make
    make install
    
    In setup.sh, set XERCESCROOT to the installation area and add the DLL location to the PATH
    cd $sim_work
    mkdir xercesc
    cd xercesc
    
  4. Download the Xerces tarball.
    No Format
    export XERCESCROOT=${sim_work}/xercesc
    export PATH=$XERCESCROOT/bin:$PATH
    
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.

GDML

GDML's CVS is not directly accessible from the command line, but a tarball is available through a WWW interface.

  1. wget http://www.apache.org/dist/xml/xerces-c/xerces-c-src_2_6_0.tar.gz
    
  2. Unzip the tarball.
    No Format
    
    tar -zxvf xerces-c-src_2_6_0.tar.gz
    
  3. Set XERCESCROOT for the build in your environment, only.
    No Format
    
    export XERCESCROOT=${sim_work}/xercesc/xerces-c-src_2_6_0
    
  4. Go into the Xerces-C++ build area
  5. 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.
  6. Unzip the tarball.
    No Format
    
    tar -zxvf GDML2.tar.gz
    
  7. Change into the CPPGDML directory.
    No Format
    cd GDML2/CPPGDML
    
    Set GDML_BASE and PLATFORM in setup.sh
    xerces-c-src_2_6_0/src/xercesc
    
  8. Configure the build.
    No Format
    export GDML_BASE=${sim_work}/GDML2/CPPGDML
    export PLATFORM=CYGWIN-g++
    
  9. Configure the build.
    No Format
    
    ./configure --enable-geant4-vis --enable-geant4-ui --with-geant4-libtype=granular --with-platform=CYGWIN-g++
    
  10. ./runConfigure -pcygwin -cgcc -xg++ \
    -minmem -nsocket -tnative -rpthread \
    -P `cd ../../..; pwd`
    
  11. Build and install Build it.
    No Format
    
    make
    make install
    

LCDD

  1. Go In setup.sh, set XERCESCROOT to the work dir and checkout LCDDinstallation area and add the DLL location to the PATH.
    No Format
    cdexport XERCESCROOT=${sim_work}/xercesc
    cvs -d :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. export PATH=$XERCESCROOT/bin:$PATH
    
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.

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 in setup.sh.
    No Format
    
    export GDML_BASE=${sim_work}/GDML2/CPPGDML
    
  5. Configure the build.
    No Format
    
    ./configure --enable-shared-libs=no
    
  6. Build it.
    No Format
    
    make
    

LCDD

  1. Go to the work dir and checkout LCDD.
    No Format
    
    cd ${sim_work}
    cvs -d 
    Go to the work dir and checkout SLIC.
    No Format
    
    cd ${sim_work}
    cvs -d CVSROOT=:pserver:anonymous@cvs.freehep.org:/cvs/lcd checkout sliclcdd
    
  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.
    No Format
    
    ./configure
    
  5. Build the binary.
    No Format
    
    make all
    

If the build completes successfully, you should see SLIC's usage statement from the test run.

Running SLIC after Installation

When you want to run later in a Cygwin shell, $XERCESCROOT/bin should be in the PATH, so that Windows can find the DLL at runtime. Since the other applications were linked-in statically, this should be the only setup requirement.

This is the procedure for running SLIC from the Cygwin commandline.

  1. Select Start -> Programs -> 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 the SLIC directory.
    No Format
    
    cd /cygdrive/c/sim/slic
    
  4. Run the executable.
    No Format
    
    bin/WIN32-g++/slic [options]
    
  1. the LCDD dir.
    No Format
    
    cd lcdd
    
  2. Configure the build.
    No Format
    
    ./configure
    
  3. Build the library.
    No Format
    
    make
    
  4. 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 SLIC.
    No Format
    
    cd ${sim_work}
    cvs -d :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.
    No Format
    
    ./configure
    
  5. Build the binary (note that we currently do not support visualization).
    No Format
    
    export G4VIS_NONE=1
    make all
    

If the build completes successfully, you should see SLIC's usage statement from the test run.

Running SLIC after Installation

When you want to run later in a Cygwin shell, $XERCESCROOT/bin should be in the PATH, so that Windows can find the DLL at runtime. Since the other applications were linked-in statically, this should be the only setup requirement.

This is the procedure for running SLIC from the Cygwin commandline.

  1. Select Start -> Programs -> 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 the 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.

Warning

If you encounter difficulties running macros, it may be due to the different DOS and Unix end-of-line definitions. You can convert files using:

No Format

dos2unix mymacro.mac

In order to run with OpenGL visualization, an X-server needs to be running on your machine.

This command will start the Cygwin X-server.

No Format

startxwin.sh

Then you need to run SLIC from the xterm that pops-up. At least on my setup, it does not work to run the binary from the plain Cygwin windowIf 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.

Final Setup Script

The final version of setup.sh (without OpenGL visualization) should be similar to 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}
export PATH=${JAVA_HOME}/bin:${PATH}

# 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

...

If you think this guide could be improved in any way, then please contact the author

Additional Resources

...

Links