...
It presumes nothing except a working Windows machine (2000, XP) with internet access. Therefore, you may only need to use parts of this installation guide if you have some of the external dependencies already installed.
Standalone Windows Distribution
If you do not want to build SLIC yourself, there is a Windows executable avaiable for download.
The current version is available as a static binary packaged with the Xerces dll.
Download the ZIP file using your browser and unzip the contents. You should see the directory slic_win32.
Test out the binary by running it in a console window.
- Start -> Run -> cmd.
- Press ENTER.
- Go to the SLIC directory.
No Format cd /my/download/dir/slic_win32
- Execute from the command line.
No Format slic
The Xerces and Cygwin dlls are also included so that the package is standalone.
Tip |
---|
In order for Windows to find the DLLs needed by SLIC, their directory needs to be in the PATH. Since the PATH usually includes the current directory, i.e. ., the program should work "out-of-the-box" provided that you leave the DLLs and the executable in the same directory and run SLIC from this directory. |
Preliminary Setup for Installation
Cygwin
The Cygwin Linux emulation package is a prerequisite for building on Windows.
Info |
---|
Unfortunately, the support for native WIN32 using project files is lacking. |
- Download www.cygwin.com/setup.exe from www.cygwin.com.
- Double-click on it and click Next.
- Select Install from Internet and click Next.
- Enter your preferred Root Directory and click Next.
- Enter your preferred Local Package Directory, which can be the same as the Root Directory, and then click Next.
- Select Direct Connection, if it is not already, click Next.
- Select a site from the Available Download Sites. Servers inside your country will probably be fastest. I use ftp://ftp.sunsite.utk.edu.
- Click Next.
- 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.
- Required packages.
- Devel -> cvs
- Devel -> gcc-core
- Devel -> gcc-g++
- Devel -> make
- Base -> gzip
- Base -> tar
- Tool for downloading package tarballs and zip files.
- Web -> wget
- Required packages.
- Click Next after you have selected the packages.
- 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.
- If desired, select Create icon on Desktop or Add icon to Start Menu, and click Finish.
Testing the Cygwin Command Line Tools
- Select Start Menu -> Cygwin -> Cygwin Bash Shell
- Check that the following commands do not result in a command not found message.
No Format cvs gcc g++ tar wget make
- If a command was not found, rerun the Cygwin setup to select the missing package, making sure to select Keep on the Cygwin Setup - Select Packages screen so that all the packages are not reinstalled.
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 show.
Preliminary Setup for Installation
Cygwin
The Cygwin Linux emulation package is a prerequisite for building on Windows.
Info |
---|
Unfortunately, the support for native WIN32 using project files is lacking. |
These are brief instructions for installing the necessary Cygwin packages.
- Download the Cygwin setup program.
- Double-click on it and click Next.
- Select Install from Internet and click Next.
- Enter your preferred Root Directory and click Next.
- Enter your preferred Local Package Directory, which can be the same as the Root Directory, and then click Next.
- Select Direct Connection and click Next.
- Select a site from the Available Download Sites. Servers inside your country will probably be fastest. I use ftp://ftp.sunsite.utk.edu.
- Click Next.
- 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.
- Required packages.
- Devel -> cvs
- Devel -> gcc-core
- Devel -> gcc-g++
- Devel -> make
- Base -> gzip
- Base -> tar
- If OpenGL visualization is being used, these should also be installed.
- X11 -> ALL
- Graphics -> OpenGL
- Tool for downloading package tarballs and zip files.
- Web -> wget
- Required packages.
- Click Next after you have selected the packages.
- 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.
- If desired, select Create icon on Desktop or Add icon to Start Menu, and click Finish.
Tip | ||
---|---|---|
| ||
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
- Select Start -> Programs -> Cygwin -> Cygwin Bash Shell
- Check that the following commands do not result in a command not found message.
No Format cvs gcc g++ tar wget make
- If a command was not found, rerun the Cygwin setup to select the missing package, making sure to select Keep on the Cygwin Setup - Select Packages screen so that all the packages are not reinstalled.
Warning |
---|
Throughout this guide, I assume you are using bash or at least another sh |
Warning |
Throughout this guide, I assume you are using bash or at least another sh-compatible shell. I take no responsibility if you decide to use csh, tcsh, et al. |
Work Area
We will install all packages The SLIC package and its dependencies will be installed into a common work area.
- From the Cygwin shell, create a work directory for SLIC and its external dependenciesand go into it.
No Format cd /cygdrive/c mkdir sim cd sim
- Create the file setup.sh with the following contents. (We will be adding to this file as the installation proceeds.)
No Format #!/bin/sh export sim_work=/cygdrive/c/sim
- Source the script to setup the work dir.
No Format source setup.sh
Tip |
---|
The $sim_work/setup.sh script will henceforth be referred to as setup.sh. At the end, it will have all of the environment variables required by SLIC and its dependencies. Throughout the guide, any time a line is added to setup.sh, it is presumed that you should also set execute this up line in the your current environment bash shell. Probably the easiest way to do this is by adding to the script first and then (re)sourcing it. |
Java
Java is required for installing LCIO installation.
- Install an appropriate JDK from http://java.sun.com/ with a minimum version of 1.4.2.
- In your setup.sh, set JAVA_HOME and JDK_HOME to the Java installation area.
No Format export JAVA_HOME=/cygdrive/c/java/jdk1.4.2/ export JDK_HOME=${JAVA_HOME} export PATH=$JDK_HOME$PATH:$JDK_HOME/bin
- To test the Java installation, try to run the Java compiler.
No Format javac
Warning |
---|
The above JAVA_HOME directory is an example only. You need to replace it with the correct path to your JDK. |
Info |
---|
Technically, installation of the LCIO C++ libraries only requires a Java JRE, but the JDK is useful for doing reconstruction and analysis where you may want to compile Java programs. |
Proceed to Package Installation!
You are now ready to start install the installationsimulation packages.
Tip |
---|
Leave your The same Cygwin window open, as you will be using it should be used throughout the installation . This will also allow the environment to be built-up incrementally as the installation proceedsprocess in order to preserve the environment variables. |
Package Installations
CLHEP
There are CLHEP has installation instructions for version 1.9 and up (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.
- 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 $sim_work/setup.sh
No Format export CLHEP_BASE_DIR=$sim_work/clhep
Now that the CLHEP dependency is satisfied, you should be able to install Geant4.
Geant4
Geant4 is probably the most difficult application to install of SLIC's dependencies, because there are a lot of options, it takes a long time, and it requires several different make commands. I will describe a minimal installation procedure with support for built-in UI and visualization drivers. You can always update the libraries later if you decide to change these settings.
...
- 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.p011.tar.gz
- Unzip it.
No Format tar -zxvf geant4.7.01.p01.tar.gz
- Setting Set the following variables in $sim_work/setup.sh should allow you to compile without running the ./. (You should not need to run Geant4's Configure script.)
Go into the Geant4 install dirNo Format export G4INSTALL=${sim_wrkwork}/geant4/geant4.7.0.p011 export G4SYSTEM=WIN32-g++
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
- Build the libraries. These will be placed at $G4INSTALL/lib/WIN32-g++. (Maybe you should let this run overnight!)
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.
No Format make includes
Hopefully, Geant4 has been installed successfully, and you don't have too many more gray hairs.
LCPhys
- Go back to the work dir.
No Format cd $sim_wrk
- Checkout the physics list from CVS.
No Format cvs -d :pserver:anonymous@cvs.freehep.org:/cvs/lcd checkout LCPhys
- Assuming that the environment from the Geant4 installation is still in place, you can build this like any other physics list.
No Format cd LCPhys make
- Set the LCPhys variable in setup.sh.
No Format LCPHYS_BASE=$sim_wrk/LCPhys
LCIO
Warning |
---|
LCIO installation requires a working Java SDK. |
LCIO has a very nice manual with a whole section on installation. Thanks, Frank!
I will still walk you through the basic procedure.
export OGLHOME=/usr/X11R6 export G4VIS_BUILD_OPENGLX_DRIVER=1 export G4VIS_USE_OPENGLX=1
- Go into the Geant4 base dir.
No Format cd geant4.7.1
- 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:
Hopefully, this hack will be remedied soon!No Format CPPFLAGS += -DG4BERTINI_KAON
- 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
should be replaced withNo Format CXXFLAGS := -Wall -ansi -pedantic -pipe
No Format CXXFLAGS := -W -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe
- 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
- Install the headers into $G4INSTALL/include.
No Format make includes
- 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.
- Go back to the work dir.
No Format cd $sim_work
- Checkout the physics list from CVS.
No Format cvs -d
- Go back to the work dir.
No Format cd $sim_wrk
- Checkout LCIO from CVS.
No Format cvs -d :pserver:anonymous@cvs.freehep.org:/cvs/lciolcd checkout lcio
- Add these lines to your setup.sh.
No Format export LCIO=${sim_wrk}/lcio export PATH=$LCIO/tools:$LCIO/bin:$PATH
LCPhys
- 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 ant aid cpp
Xerces-C++
cd LCPhys make
- 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 $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 path.
No Format export XERCESCROOT=${sim_work}/xercesc export PATH=$XERCESCROOT/lib:$PATH
GDML
GDML's CVS is not directly accessible from the command line, but a tarball is available through a WWW interface.
LCPHYS_BASE=$sim_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.
- Go back to the work dir.
No Format cd $sim_work
- Checkout LCIO from CVS.
No Format cvs -d :pserver:anonymous@cvs.freehep.org:/cvs/lcio checkout lcio
- Add these lines to your setup.sh.
No Format export LCIO=${sim_work}/lcio export PATH=$LCIO/tools:$LCIO/bin:$PATH
- Build the libraries using the bundled aid and ant tools.
No Format cd lcio ant aid.generate cpp
Xerces-C++
- Go back to the work dir, create a subdir for Xerces-C++, and go into it.
No Format cd $sim_work mkdir xercesc cd xercesc
- Download the Xerces tarball.
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.No Format wget http://www.apache.org/dist/xml/xerces-c/xerces-c-src_2_6_0.tar.gz
- Unzip the tarball.
Change into the CPPGDML directoryNo Format tar -zxvf GDML2xerces-c-src_2_6_0.tar.gz
- Set XERCESCROOT for the build in your environment, only.
Set GDML_BASE in setup.shNo Format cd GDML2/CPPGDML
export XERCESCROOT=${sim_work}/xercesc/xerces-c-src_2_6_0
- Go into the Xerces-C++ build area.
No Format export GDML_BASE=${sim_work}/GDML2/CPPGDML export PLATFORM=cygwin_g++ cd xerces-c-src_2_6_0/src/xercesc
- Configure the Configure the build.
No Format ./configurerunConfigure -pcygwin -enable-geant4-vis --enable-geant4-ui --with-geant4-libtype=granular \ --with-platform=cygwin_g++
- Build it.
No Format make
LCDD
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 DLL location to the PATHGo to the work dir and checkout LCDD.
No Format cdexport XERCESCROOT=${sim_work}/xercesc 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 --with-xerces-libname=xerces-c.dll
- Build the library.
No Format make
- Set the LCDD_BASE variable in setup.sh.
No Format export LCDD_BASE=${sim_work}/lcdd
SLIC
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.
- 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
- Go to 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 slicGDML2/CPPGDML
- Set the SLICGDML_BASE variable in setup.sh.
No Format export SLICGDML_BASE=${sim_work}/GDML2/slicCPPGDML
- Configure the build with the Windows name for the Xerces-C++ lib.
No Format ./configure --withenable-xercesshared-libname=xerces-c.dll libs=no
- Build the binaryit.
No Format make all
LCDD
If the test completes successful, you should see SLIC's usage statement as it runs and then exits.
Final Setup Script
...
- Go to the work dir and checkout LCDD.
No Format cd ${sim_work} cvs -d :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 SLIC.
No Format cd ${sim_work} cvs -d :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.
No Format ./configure
- 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.
- Select Start -> Programs -> Cygwin -> Cygwin Bash Shell.
- Add Xerces-C++ bin to the path.
No Format export PATH=/cygdrive/c/sim/xerces/bin:$PATH
- Go to the 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.
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:
|
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 window.
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.#!/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++ #export OGLHOME=/usr/X11R6 #export OGLHOME=/usr #export G4VIS_BUILD_OPENGLX_DRIVER=1 #export G4VIS_USE_OPENGLX=1=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 |
The above should be sufficient to "bootstrap" any future (re)builds with the following caveats.
Tip |
---|
The G4WORKDIR directory should be set to LCDD_BASE when building LCDD and SLIC_BASE for SLIC, or your libs and binaries will 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. |
Additional Resources
...
should be sufficient to "bootstrap" any future (re)builds.
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