changes.
| | The SLIC full simulator program requires the setup of 8 different software packages, not counting the required build tools. |
| | |
| | This guide provides a step-by-step walkthrough covering package and tool installation. |
| | |
| | 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. |
| | |
| | h1. Standalone Windows Distribution |
| | |
| | {info} |
| | Cygwin needs to be installed to run SLIC. |
| | {info} |
| | |
| | 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. |
| | |
| | {noformat} |
| | | tar -zxvf slic-current-WIN32-g%2B%2B-bin.tar.gz |
| | | tar -zxvf slic-current-WIN32-g++-bin.tar.gz |
| | {noformat} |
| | |
| | Now test the binary. |
| | |
| | {noformat} |
| | cd SimDist |
| | ./scripts/slic.sh |
| | {noformat} |
| | |
| | The slic usage screen should show. |
| | |
| | h1. Preliminary Setup for Installation |
| | |
| | h2. [Cygwin|http://www.cygwin.com] |
| | |
| | The Cygwin Linux emulation package is a prerequisite for building on Windows. |
| | |
| | {info} |
| | Unfortunately, the support for native WIN32 using project files is lacking. |
| | {info} |
| | |
| | These are brief instructions for installing the necessary Cygwin packages. |
| | |
| | # Download the [Cygwin setup program|http://www.cygwin.com/setup.exe]. |
| | # 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 |
| | # 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:title=Cygwin Packages} |
| | It may be easier to simply install all Cygwin packages instead of selecting them individually. |
| | {tip} |
| | |
| | If you need additional information on this installation process, Norman Graf has [more detailed Cygwin installation instructions|http://www-sldnt.slac.stanford.edu/nld/new/Docs/GettingStarted/Cygwin/]. |
| | |
| | h3. 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. |
| | {noformat} |
| | cvs |
| | gcc |
| | g++ |
| | tar |
| | wget |
| | make |
| | {noformat} |
| | # 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*-compatible shell. I take no responsibility if you decide to use *csh*, *tcsh*, et al. |
| | {warning} |
| | |
| | h2. Work Area |
| | |
| | The SLIC package and its dependencies will be installed into a common work area. |
| | |
| | # From the Cygwin shell, create a work directory and go into it. |
| | {noformat} |
| | cd /cygdrive/c |
| | mkdir sim |
| | cd sim |
| | {noformat} |
| | # Create the file *setup.sh* with the following contents. |
| | {noformat} |
| | #!/bin/sh |
| | export sim_work=/cygdrive/c/sim |
| | {noformat} |
| | # Source the script to setup the work dir. |
| | {noformat} |
| | source setup.sh |
| | {noformat} |
| | |
| | {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*, you should also execute this line in your current *bash* shell. Probably the easiest way to do this is by adding to the script first and then (re)sourcing it. |
| | {tip} |
| | |
| | h2. [Java|http://java.sun.com] |
| | |
| | Java is required for 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. |
| | {noformat} |
| | export JAVA_HOME=/cygdrive/c/java/jdk1.4.2/ |
| | export JDK_HOME=${JAVA_HOME} |
| | export PATH=$PATH:$JDK_HOME/bin |
| | {noformat} |
| | # To test the Java installation, try to run the Java compiler. |
| | {noformat} |
| | javac |
| | {noformat} |
| | |
| | {warning} |
| | The above *JAVA_HOME* directory is an example only. You need to replace it with the correct path to your JDK. |
| | {warning} |
| | |
| | {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. |
| | {info} |
| | |
| | h2. Proceed to Package Installation! |
| | |
| | You are now ready to install the simulation packages. |
| | |
| | {tip} |
| | The same Cygwin window should be used throughout the installation process in order to preserve the environment variables. |
| | {tip} |
| | |
| | h1. Package Installations |
| | |
| | h2. [CLHEP|http://wwwasd.web.cern.ch/wwwasd/lhc++/clhep/] |
| | |
| | CLHEP has [installation instructions|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. |
| | {noformat} |
| | mkdir clhep |
| | cd clhep |
| | {noformat} |
| | # Download the CLHEP tarball. |
| | {noformat} |
| | wget http://cern.ch/clhep/clhep-1.9.2.0.tgz |
| | {noformat} |
| | # Unzip to your work directory. |
| | {noformat} |
| | tar -zxvf clhep-1.9.2.0.tgz |
| | {noformat} |
| | # Change to CLHEP directory. |
| | {noformat} |
| | cd 1.9.2.0/CLHEP |
| | {noformat} |
| | # Configure the build. (This took 15-20 minutes on my machine.) |
| | {noformat} |
| | ./configure --prefix=`cd ../..; pwd` --disable-shared |
| | {noformat} |
| | # Build the library and install it. (Also takes a long time!) |
| | {noformat} |
| | make |
| | make install |
| | {noformat} |
| | # Add the following to *setup.sh* |
| | {noformat} |
| | export CLHEP_BASE_DIR=$sim_work/clhep |
| | {noformat} |
| | |
| | Now that the CLHEP dependency is satisfied, you should be able to install Geant4. |
| | |
| | h2. [Geant4|http://wwwasd.web.cern.ch/wwwasd/geant4/geant4.html] |
| | |
| | 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. |
| | |
| | {warning} |
| | The default Geant4 library settings for WIN32 are granular and static. You may choose other settings, but this could require changes in installation settings "down the line" that I may not mention. |
| | {warning} |
| | |
| | # Return to the work dir, create a Geant4 subdir and go into it. |
| | {noformat} |
| | cd $sim_work |
| | mkdir geant4 |
| | cd geant4 |
| | {noformat} |
| | # Download the Geant4 tarball. |
| | {noformat} |
| | wget http://geant4.cern.ch/geant4/source/source/geant4.7.1.tar.gz |
| | {noformat} |
| | # Unzip it. |
| | {noformat} |
| | tar -zxvf geant4.7.1.tar.gz |
| | {noformat} |
| | # Set the following variables in *setup.sh*. (You should not need to run Geant4's *Configure* script.) |
| | {noformat} |
| | export G4INSTALL=${sim_work}/geant4/geant4.7.1 |
| | export G4SYSTEM=WIN32-g++ |
| | {noformat} |
| | 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. |
| | {noformat} |
| | export OGLHOME=/usr/X11R6 |
| | export G4VIS_BUILD_OPENGLX_DRIVER=1 |
| | export G4VIS_USE_OPENGLX=1 |
| | {noformat} |
| | # Go into the Geant4 base dir. |
| | {noformat} |
| | cd geant4.7.1 |
| | {noformat} |
| | # 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*: |
| | {noformat} |
| | CPPFLAGS += -DG4BERTINI_KAON |
| | {noformat} |
| | Hopefully, this hack will be remedied soon! |
| | # 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* |
| | {noformat} |
| | CXXFLAGS := -Wall -ansi -pedantic -pipe |
| | {noformat} |
| | should be replaced with |
| | {noformat} |
| | CXXFLAGS := -W -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long |
| | CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe |
| | {noformat} |
| | # Build the libraries, which will be placed at *$G4INSTALL/lib/WIN32-g++*. (This could take up to a few hours depending on your machine.) |
| | {noformat} |
| | cd source |
| | make |
| | {noformat} |
| | # Install the headers into *$G4INSTALL/include*. |
| | {noformat} |
| | make includes |
| | {noformat} |
| | # Build the physics list libraries. These will go into *$G4INSTALL/lib/plists/WIN32-g++*. |
| | {noformat} |
| | cd ../physics_lists/hadronic |
| | make |
| | {noformat} |
| | |
| | Hopefully, Geant4 has been installed successfully, and you don't have too many more gray hairs. |
| | |
| | h2. [LCPhys|http://www.slac.stanford.edu/comp/physics/geant4/slac_physics_lists/ilc/ilc_physics_list.html] |
| | |
| | SLIC requires a special physics list written by Dennis Wright for Linear Collider physics. |
| | |
| | # Go back to the work dir. |
| | {noformat} |
| | cd $sim_work |
| | {noformat} |
| | # Checkout the physics list from CVS. |
| | {noformat} |
| | cvs -d :pserver:anonymous@cvs.freehep.org:/cvs/lcd checkout LCPhys |
| | {noformat} |
| | # 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++*. |
| | {noformat} |
| | cd LCPhys |
| | make |
| | {noformat} |
| | # Set the LCPhys variable in *setup.sh*. |
| | {noformat} |
| | export LCPHYS_BASE=$sim_work/LCPhys |
| | {noformat} |
| | |
| | h2. [LCIO|http://lcio.desy.de/] |
| | |
| | LCIO provides binary output capabilities. |
| | |
| | {warning} |
| | Installation requires a working Java runtime for *ant* support. |
| | {warning} |
| | |
| | LCIO has a [very nice manual|http://lcio.desy.de/v01-04/doc/manual_html/manual.html] with a whole [section on installation|http://lcio.desy.de/v01-04/doc/manual_html/manual.html#SECTION00030000000000000000]. Thanks, Frank! |
| | |
| | I will still walk you through the basic procedure. |
| | |
| | # Go back to the work dir. |
| | {noformat} |
| | cd $sim_work |
| | {noformat} |
| | # Checkout LCIO from CVS. |
| | {noformat} |
| | cvs -d :pserver:anonymous@cvs.freehep.org:/cvs/lcio checkout lcio |
| | {noformat} |
| | # Add these lines to your *setup.sh*. |
| | {noformat} |
| | export LCIO=${sim_work}/lcio |
| | export PATH=$LCIO/tools:$LCIO/bin:$PATH |
| | {noformat} |
| | # Build the libraries using the bundled *aid* and *ant* tools. |
| | {noformat} |
| | cd lcio |
| | ant aid.generate cpp |
| | {noformat} |
| | |
| | h2. [Xerces-C\+\+|http://xml.apache.org/xerces-c/] |
| | |
| | # Go back to the work dir, create a subdir for Xerces-C++, and go into it. |
| | {noformat} |
| | cd $sim_work |
| | mkdir xercesc |
| | cd xercesc |
| | {noformat} |
| | # Download the Xerces tarball. |
| | {noformat} |
| | wget http://www.apache.org/dist/xml/xerces-c/xerces-c-src_2_6_0.tar.gz |
| | {noformat} |
| | # Unzip the tarball. |
| | {noformat} |
| | tar -zxvf xerces-c-src_2_6_0.tar.gz |
| | {noformat} |
| | # Set *XERCESCROOT* for the build in your environment, only. |
| | {noformat} |
| | export XERCESCROOT=${sim_work}/xercesc/xerces-c-src_2_6_0 |
| | {noformat} |
| | # Go into the Xerces-C++ build area. |
| | {noformat} |
| | cd xerces-c-src_2_6_0/src/xercesc |
| | {noformat} |
| | # Configure the build. |
| | {noformat} |
| | ./runConfigure -pcygwin -cgcc -xg++ \ |
| | -minmem -nsocket -tnative -rpthread \ |
| | -P `cd ../../..; pwd` |
| | {noformat} |
| | # Build and install it. |
| | {noformat} |
| | make |
| | make install |
| | {noformat} |
| | # In *setup.sh*, set *XERCESCROOT* to the installation area and add the DLL location to the *PATH*. |
| | {noformat} |
| | export XERCESCROOT=${sim_work}/xercesc |
| | export PATH=$XERCESCROOT/bin:$PATH |
| | {noformat} |
| | |
| | {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. |
| | {tip} |
| | |
| | h2. [GDML|http://gdml.web.cern.ch/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. |
| | {noformat} |
| | tar -zxvf GDML2.tar.gz |
| | {noformat} |
| | # Change into the CPPGDML directory. |
| | {noformat} |
| | cd GDML2/CPPGDML |
| | {noformat} |
| | # Set *GDML_BASE* in *setup.sh*. |
| | {noformat} |
| | export GDML_BASE=${sim_work}/GDML2/CPPGDML |
| | {noformat} |
| | # Configure the build. |
| | {noformat} |
| | ./configure --enable-shared-libs=no |
| | {noformat} |
| | # Build it. |
| | {noformat} |
| | make |
| | {noformat} |
| | |
| | h2. [LCDD|http://www.lcsim.org/software/lcdd] |
| | |
| | # Go to the work dir and checkout LCDD. |
| | {noformat} |
| | cd ${sim_work} |
| | cvs -d :pserver:anonymous@cvs.freehep.org:/cvs/lcd checkout lcdd |
| | {noformat} |
| | # Go into the LCDD dir. |
| | {noformat} |
| | cd lcdd |
| | {noformat} |
| | # Configure the build. |
| | {noformat} |
| | ./configure |
| | {noformat} |
| | # Build the library. |
| | {noformat} |
| | make |
| | {noformat} |
| | # Set the *LCDD_BASE* variable in *setup.sh*. |
| | {noformat} |
| | export LCDD_BASE=${sim_work}/lcdd |
| | {noformat} |
| | |
| | h2. [SLIC|http://www.lcsim.org/software/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. |
| | {noformat} |
| | cd ${sim_work} |
| | cvs -d :pserver:anonymous@cvs.freehep.org:/cvs/lcd checkout slic |
| | {noformat} |
| | # Go into the SLIC dir. |
| | {noformat} |
| | cd slic |
| | {noformat} |
| | # Set the *SLIC_BASE* variable in *setup.sh*. |
| | {noformat} |
| | export SLIC_BASE=${sim_work}/slic |
| | {noformat} |
| | # Configure the build. |
| | {noformat} |
| | ./configure |
| | {noformat} |
| | # Build the binary (note that we currently do not support visualization). |
| | {noformat} |
| | export G4VIS_NONE=1 |
| | make all |
| | {noformat} |
| | |
| | If the build completes successfully, you should see SLIC's usage statement from the test run. |
| | |
| | h3. 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. |
| | {noformat} |
| | export PATH=/cygdrive/c/sim/xerces/bin:$PATH |
| | {noformat} |
| | # Go to the SLIC directory. |
| | {noformat} |
| | cd /cygdrive/c/sim/slic |
| | {noformat} |
| | # Run the executable. |
| | {noformat} |
| | bin/WIN32-g++/slic [options] |
| | {noformat} |
| | |
| | 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: |
| | |
| | {noformat} |
| | dos2unix mymacro.mac |
| | {noformat} |
| | {warning} |
| | |
| | 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. |
| | |
| | {noformat} |
| | startxwin.sh |
| | {noformat} |
| | |
| | _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. |
| | |
| | h3. Final Setup Script |
| | |
| | The final version of *setup.sh* (without OpenGL visualization) should be similar to this. |
| | |
| | {noformat} |
| | #!/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 |
| | |
| | # 9. LCDD |
| | export LCDD_BASE=${sim_work}/lcdd |
| | |
| | # 10. SLIC |
| | export SLIC_BASE=${sim_work}/slic |
| | {noformat} |
| | |
| | The above should be sufficient to "bootstrap" any future (re)builds. |
| | |
| | h1. 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|~jeremym] |
| | |
| | h1. Links |
| | |
| | * [Geant4 on Windows with CL and Cygwin|http://geant4.slac.stanford.edu/tutorial/installation/Geant4.8.0.p01/Windows/Geant4_8_0_p01_Windows_Installation.htm#_Getting_and_Installing] |