Installation
Guide |
3. Tips for installing on
Windows
To compile and run Geant4 under Windows systems, some additional information
and tools are required, although the installation produre is similar to that
required on a UNIX based system. On Windows, the Cygwin toolset and the
Microsoft Visual C++ compiler are used.
Cygwin32 is a UNIX development
environment available for Microsoft Windows . You can freely obtain Cygwin32
from Cygwin.
We do
not support direct use of Visual Studio; i.e. we do not provide Visual Studio
workspace (.dsw) or project (.dsp) files, nor do we provide makefiles for the
nmake application of MS Visual C++.
We use several of the tools provided by the Cygwin toolset:
For this release of Geant4 we used MS Visual Studio Enterprise version 6.0, Service Pack 5. Due to severe limitations of the MS-VC++ optimizer, we suggest to perform the installation with debug flags turned on, i.e. G4DEBUG=1, and no optimisation. In some cases, tests showed problems both at compile and run time when optimisation was turned on.
The usage of cgywin32 for the build environment results in a build procedure similar to a UNIX system. Also the documentation in the User's Guide for Application Developers, Section 10.5 applies largely.
You should follow the following steps to install geant4:
. geant4-setup.shincluding the leading dot and blank space. You could also have this as your .bashrc file. The commands in the command file should be:
# Set G4SYSTEM export G4SYSTEM=WIN32-VC # # Turn on debug flags, note that testing was done for the debug version only. export G4DEBUG=1 # # Set Path to CLHEP export CLHEP_BASE_DIR=C:/usr/local # # --- Other optional settings #Turn on verbose to show command used for compilation #export CPPVERBOSE=1 #Note, in the example above, CLHEP was installed in C:/usr/local, therefore include/CLHEP and lib/CLHEP.lib must be included therein.
The binary of the example by default is placed into the geant4/bin/WIN32-VC directory. You may run this either from this directory or from the examples/novice/N01 directory; sample input and output files are placed in each of the examples/novice directories. Some of the examples will need to read data files, and the place has to be given in environment variables again similar to the following example:
# # Environment variables needed to find geant4 data files: # # Data for neutron scattering processes, # distributed in a separate tar file, then placed under data export NeutronHPCrossSections=c:/usr/local/geant4/data/G4NDL # # Nuclear Photon evaporation data, # distributed with the source files under data export G4LEVELGAMMADATA=c:/usr/local/geant4/data/PhotonEvaporation # # Data for radiative decay hadronic processes under data, # distributed in a separate tar file export G4RADIOACTIVEDATA=c:/usr/local/geant4/data/RadiativeDecay # # Data for low energy electromagnetic processes, # distributed in a separate tar file, then placed under data export G4LEDATA=c:/usr/local/geant4/data/G4EMLOW #
All compiler and linker options are set in config/sys/WIN32-VC.gmk. If you require options different from our choice, you should modify this file.
Geant4 is regularly tested on Linux RedHat distributions. For details on the installation please refer to chapter 1 and 2 of this Installation Guide.