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. |
| | |
| | h1. Preliminaries |
| | |
| | h2. Tools |
| | |
| | You need the following command line tools. |
| | |
| | * cvs |
| | * g++ (*gcc* 3.2 and 3.3 seem to work okay. I doubt that 3.4 works.) |
| | * make |
| | * gzip |
| | * tar (that's the GNU version) |
| | |
| | If you are missing one of these...are you sure that you're running Linux? |
| | |
| | Any recent versions of these programs should do okay. |
| | |
| | You also need a Java VM, for running ant. |
| | |
| | * java (to run ant) |
| | |
| | Also, [wget|http://www.gnu.org/software/wget/wget.html] is mighty useful for retrieving files via http. |
| | |
| | h2. Work Area |
| | |
| | The SLIC package and its dependencies will be installed into a common work area. |
| | |
| | # From the shell, create a work directory where you have a lot of space and go into it. |
| | {noformat} |
| | cd ~ |
| | mkdir sim |
| | cd sim |
| | {noformat} |
| | # Create the file *setup.sh* with the following contents. |
| | {noformat} |
| | #!/bin/sh |
| | export sim_work=~/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} |
| | |
| | h1. Package Installations |
| | |
| | You are now ready to install the simulation packages. |
| | |
| | {info} |
| | Possibly some of these software packages already exist on your system. |
| | You still need to setup the environment accordingly. Scan over the package installation instructions to see what environment variables need to be defined. Usually, this is one variable per package (with the exception of Geant4, which has many). |
| | {info} |
| | |
| | {tip} |
| | The same shell window should be used throughout the installation process in order to preserve the environment variables. |
| | {tip} |
| | |
| | h2. Package Versions |
| | |
| | Currently, the SLIC, LCDD, LCIO, GDML, and LCPhys CVS heads should all work fine together. |
| | |
| | The following is a recent, tested configuration. |
| | |
| | {noformat} |
| | slic v1r12p0 |
| | lcio v1r5p0_slic |
| | lcdd v1r8p2 |
| | lcphys v1r0p1 |
| | gdml 2.3.0 |
| | geant4 7.1.0 |
| | clhep 1.9.2.1 |
| | xerces 2.6.0 |
| | {noformat} |
| | |
| | The Geant4 version must be *7.1.x* or SLIC will not compile. |
| | |
| | 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. (Now go get some coffee.) |
| | {noformat} |
| | ./configure --prefix=`cd ../..; pwd` --disable-shared |
| | {noformat} |
| | # Build the library and install it. (Get some more coffee.) |
| | {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} |
| | Due to limitations of GDML, Geant4 must be compiled with granular libraries. This should be fixed soon. |
| | {warning} |
| | |
| | {info} |
| | These procedures are geared towards setting up a *minimal* Geant4 installation for SLIC. If you want a full Geant4 setup, I recommend running the *Configure* script. It will walk you through setting up a complete enviroment. |
| | {info} |
| | |
| | # 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.0.p01.tar.gz |
| | {noformat} |
| | # Set the following variables in *setup.sh*. (You should not need to run *Configure*.) |
| | {noformat} |
| | export G4INSTALL=${sim_work}/geant4/geant4.7.1 |
| | export G4SYSTEM=Linux-g++ |
| | export G4LIB_USE_GRANULAR=1 |
| | {noformat} |
| | # If you want to enable OpenGL-based visualization, set these variables, too. |
| | {noformat} |
| | export G4VIS_BUILD_OPENGLX_DRIVER=1 |
| | export G4VIS_USE_OPENGLX=1 |
| | export OGLHOME=/usr |
| | {noformat} |
| | # Refer to the [Application Guide Section on Enviroment Variables|http://wwwasd.web.cern.ch/wwwasd/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/Appendix/makeFile.html] for additional enviroment variables that you might want to set. |
| | # 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! |
| | # Build the libraries, which will be placed at *$G4INSTALL/lib/Linux-g++*. (This could take up to a few hours depending on your machine.) |
| | {noformat} |
| | cd source |
| | make |
| | {noformat} |
| | # Install the headers into the *$G4INSTALL/include* directory. |
| | {noformat} |
| | make includes |
| | {noformat} |
| | # Build the physics list libraries. These will go into the default location at *$G4INSTALL/lib/plists/Linux-g++*. |
| | {noformat} |
| | cd ../physics_lists/hadronic |
| | make |
| | {noformat} |
| | |
| | Hopefully, Geant4 has been installed successfully, and you don't have too many more gray hairs! (Did you remember to set *G4BERTINI_KAON*? LCPhys won't work without it.) |
| | |
| | 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} |
| | 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 $sim_work/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 -plinux -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 LD_LIBRARY_PATH=$XERCESCROOT/lib:$LD_LIBRARY_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 to *sim_wrk* using this link in your browser: [http://simu.cvs.cern.ch/cgi-bin/simu.cgi/simu/GDML2/GDML2.tar.gz?tarball=1]. |
| | # Unzip the tarball. |
| | {noformat} |
| | tar -zxvf GDML2.tar.gz |
| | {noformat} |
| | # Change into the CPPGDML directory. |
| | {noformat} |
| | cd GDML2/CPPGDML |
| | {noformat} |
| | # Set *GDML_BASE* and *PLATFORM* 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 Linux 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. |
| | {noformat} |
| | 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. |
| | |
| | # Open a bash shell. |
| | # Add Xerces-C\+\+ bin to the load path. |
| | {noformat} |
| | export LD_LIBRARY_PATH=$XERCESCROOT/lib |
| | {noformat} |
| | # Go to the SLIC directory. |
| | {noformat} |
| | cd ~/sim/slic |
| | {noformat} |
| | # Run the executable. |
| | {noformat} |
| | bin/Linux-g++/slic [options] |
| | {noformat} |
| | |
| | If you receive an error message about a missing Xerces library, then make sure that the *PATH* is setup correctly and Xerces-C\+\+ was properly installed. |
| | |
| | h3. Final Setup Script |
| | |
| | The final version of *setup.sh* should be similar to this. |
| | |
| | {noformat} |
| | #!/bin/sh |
| | |
| | # work area |
| | export sim_work=~/sim |
| | |
| | # clhep installation area |
| | export CLHEP_BASE_DIR=${sim_work}/clhep |
| | |
| | # geant4 |
| | export G4INSTALL=${sim_work}/geant4/geant4.7.1 |
| | export G4SYSTEM=Linux-g++ |
| | |
| | # LCPhys |
| | export LCPHYS_BASE=${sim_work}/LCPhys |
| | |
| | # LCIO |
| | export LCIO=${sim_work}/lcio |
| | |
| | # if rebuilding LCIO |
| | export PATH=$LCIO/tools:$LCIO/bin:$PATH |
| | |
| | # Xerces-C++ installation area |
| | export XERCESCROOT=${sim_work}/xercesc |
| | export LD_LIBRARY_PATH=$XERCESCROOT/lib:$LD_LIBRARY_PATH |
| | |
| | # GDML |
| | export GDML_BASE=${sim_work}/GDML2/CPPGDML |
| | |
| | # LCDD |
| | export LCDD_BASE=${sim_work}/lcdd |
| | |
| | # SLIC |
| | export SLIC_BASE=${sim_work}/slic |
| | {noformat} |
| | |
| | The above should be sufficient to "bootstrap" the environment for any future (re)builds of SLIC dependencies. |
| | |
| | h1. Running SLIC |
| | |
| | To run SLIC once it is built, simply add the Xerces library location to your load path. |
| | |
| | Then you can execute the binary from the *SLIC_BASE* directory. |
| | |
| | {noformat} |
| | export LD_LIBRARY_PATH=$XERCESCROOT/lib:$LD_LIBRARY_PATH |
| | bin/Linux-g++/slic [args] |
| | {noformat} |
| | |
| | {tip:title=SLIC Run Script} |
| | You should create a run script for your site, so that simply typing "slic" from the command line executes the simulator. A sample run script is found in *$SLIC_BASE/scripts/run.sh*. |
| | {tip} |
| | |
| | h1. Done. |
| | |
| | That's it. |
| | |
| | If you think this guide could be improved in any way, then please contact the [author|~jeremym] |
| | |
| | Someday, I will get around to packaging all of this as RPMs to save everyone the hassle. |
| | |
| | Happy simulating... |
| | |
| | h1. Additional Resources |
| | |
| | [SLIC Homepage|SLIC] |
| | [Running SLIC at SLAC|Running SLIC at SLAC] |