Installing Pre-Compiled Geant4 on Windows

Prerequisites

To compile and use Geant4 under windows some additional tools are required. First you need Microsoft Visual Studio version 6 (with service pack 5 or later). This is commercial software that you will need to purchase and install. When installing Visual Studio you will be asked whether you want to allow it to modify your environment variables. I find it best to answer No to this question, and instead set the variables in my cygwin startup script (see below).

Secondly you will need to install cygwin, a Unix emulation layer for windows. The cygwin software is freely available from http://www.cygwin.com/. It can be quite tricky to install the correct components of the cygwin toolkit, but Norman Graf has written detailed installation instructions which are included on this CD. I find the easiest way to set up visual studio to run under cygwin is to modify my cygwin.bat file (normally in c:\cygwin) as follows:

@echo off

C:
chdir C:\cygwin\bin
call "C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat"

bash --login -i

You may need to change the path to vcvars32.bat if you installed visual studio in a different location.

Finally you will need to install CLHEP. CLHEP is available on this CD here. (CLHEP is distributed as a .tgz file, you will need a tool like WinZip to unpack it). I assume in the following that you have unpacked CLHEP into c:\clhep.

Unpacking Geant4

Open the ZIP file containing the pre-compiled Geant4:

Geant4.5.2/pre-built/Windows/Geant4.zip

Unpack the entire file into c:\ (or somewhere else if you prefer).

Start a cygwin shell, by clicking on the cygwin icon on your desktop:

Then issuing something like the following commands:

cd c:
cd geant4
source geant4-setup.sh

(If you unpacked Geant4 somewhere other than c:\ you will need to modify the geant4-setup.sh script appropriately)

Your done! Now you are ready to continue with the rest of the installation exercise.