| 1 | <HTML>
|
|---|
| 2 | <HEAD>
|
|---|
| 3 | <TITLE>PC Machines</TITLE>
|
|---|
| 4 | </HEAD>
|
|---|
| 5 | <BODY>
|
|---|
| 6 | <TABLE WIDTH="100%"><TR>
|
|---|
| 7 | <TD>
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 | <A HREF="../index.html">
|
|---|
| 11 | <IMG BORDER="0" SRC="../../../../resources/html/IconsGIF/Contents.gif" ALT="Contents"></A>
|
|---|
| 12 | <A HREF="../UnixMachines/unixMachines.html">
|
|---|
| 13 | <IMG BORDER="0" SRC="../../../../resources/html/IconsGIF/Previous.gif" ALT="Previous"></A>
|
|---|
| 14 | <IMG BORDER="0" SRC="../../../../resources/html/IconsGIF/NextGR.gif" ALT="Next">
|
|---|
| 15 | </TD>
|
|---|
| 16 | <TD ALIGN="Right">
|
|---|
| 17 | <FONT SIZE="-1" COLOR="#238E23">
|
|---|
| 18 | <P ALIGN="Right">
|
|---|
| 19 | <B>Installation Guide</B><BR>
|
|---|
| 20 | </FONT>
|
|---|
| 21 | </TD>
|
|---|
| 22 | </TR></TABLE>
|
|---|
| 23 | <P>
|
|---|
| 24 | <BR><BR>
|
|---|
| 25 |
|
|---|
| 26 | <P ALIGN="Center">
|
|---|
| 27 | <FONT SIZE="+4" COLOR="#238E23">
|
|---|
| 28 | <B>3. Tips for Installing on Windows</B>
|
|---|
| 29 | </FONT>
|
|---|
| 30 | <BR><BR>
|
|---|
| 31 |
|
|---|
| 32 | <HR ALIGN="Center" SIZE="7%">
|
|---|
| 33 | <BR><BR>
|
|---|
| 34 |
|
|---|
| 35 | <!-- ============================================== Section -->
|
|---|
| 36 | <HR>
|
|---|
| 37 | <A name="3.1">
|
|---|
| 38 | <H2>3.1 Windows with the Cygwin Toolset and Microsoft Visual C++</H2></A>
|
|---|
| 39 |
|
|---|
| 40 | <P>
|
|---|
| 41 | To compile and run Geant4 under Windows systems, some additional information
|
|---|
| 42 | and tools are required, although the installation produre is similar to that
|
|---|
| 43 | required on a UNIX based system. On Windows, the Cygwin toolset and the
|
|---|
| 44 | Microsoft Visual C++ compiler are used.<br>
|
|---|
| 45 | Cygwin32 is a UNIX development environment available for Microsoft Windows.
|
|---|
| 46 | You can freely obtain Cygwin32 from
|
|---|
| 47 | <A target="ext" HREF="http://cygwin.com">Cygwin</a> or
|
|---|
| 48 | <A target="ext" HREF="http://x.cygwin.com">Cygwin/X</a>.<br>
|
|---|
| 49 | We do not support direct use of Visual Studio; i.e. we do not provide
|
|---|
| 50 | Visual Studio workspace (.dsw) or project (.dsp) files, nor we do provide
|
|---|
| 51 | makefiles for the <TT>nmake</TT> application of MS Visual C++.
|
|---|
| 52 | <P>
|
|---|
| 53 | We use several of the tools provided by the Cygwin toolset:
|
|---|
| 54 | <UL>
|
|---|
| 55 | <LI><TT>make.exe</TT> as a make tool</LI>
|
|---|
| 56 | <LI><TT>g++.exe</TT> as a tool to analyse source file dependencies and create
|
|---|
| 57 | dependency (<TT>.d</TT>) files</LI>
|
|---|
| 58 | <LI>several other unix tools like <TT>cp</TT>, <TT>mv</TT>, <TT>rm</TT>,
|
|---|
| 59 | <TT>touch</TT>, etc.</LI>
|
|---|
| 60 | </UL>
|
|---|
| 61 | At the installation of the Cygwin toolset it is therefore required to
|
|---|
| 62 | explicitely select some packages (i.e. <i>gmake</i>, <i>gcc</i>, <i>binutils</i> and
|
|---|
| 63 | <i>tcsh</i> from the "devel" category) in addition to those which are part of
|
|---|
| 64 | the default installation.<BR>
|
|---|
| 65 | For more details on the toolset, please see the documentation available on the
|
|---|
| 66 | <a target="ext" href="http://cygwin.com">Cygwin pages</a>. The User's Guide has
|
|---|
| 67 | quick start guides and help with setting up Cygwin with <TT>setup.exe</TT>.<BR>
|
|---|
| 68 | Links to some installation tips for the Cygwin toolset and also "step by step"
|
|---|
| 69 | installation guides can be found in
|
|---|
| 70 | <A HREF="../../../ForApplicationDeveloper/html/Appendix/buildFile.html">section 10.6</A>
|
|---|
| 71 | of the Application Developers Guide.
|
|---|
| 72 | <P>
|
|---|
| 73 | The usage of Cygwin32 for the build environment results in a build procedure
|
|---|
| 74 | similar to that on a UNIX system. The documentation in the User's Guide for
|
|---|
| 75 | Application Developers, Section 10.5, is largely applicable in this case.
|
|---|
| 76 | <P>
|
|---|
| 77 | The following steps are required to install geant4:
|
|---|
| 78 | <OL>
|
|---|
| 79 | <LI> Install Cygwin (see also notes above):<BR>
|
|---|
| 80 | We do not depend on any specific feature of the version of Cygwin,
|
|---|
| 81 | so newer versions (or slightly older) are expected to work.</LI>
|
|---|
| 82 | <LI> Set the environment for MS Visual C++, i.e. set the paths to libraries,
|
|---|
| 83 | include files, and executables for MS Visual C++. This can be done by
|
|---|
| 84 | modifying the start-up batch file <TT>cygwin.bat</TT> of Cygwin32 to
|
|---|
| 85 | include all the MSDOS commands found in the file
|
|---|
| 86 | <TT>vcvars32.bat</TT> provided in MS Visual C++ (in the VC++ .NET compiler
|
|---|
| 87 | installation directory, and usually located inside the
|
|---|
| 88 | <TT>Common7/Tools</TT> directory). This modification should be done after
|
|---|
| 89 | the installation of the Cygwin toolset, so that the environment gets
|
|---|
| 90 | properly set at the time of the invocation of the shell.</LI>
|
|---|
| 91 | <LI> Unpack the source code into a directory of your choice.</LI>
|
|---|
| 92 | <LI> Start the <TT>Cygwin</TT> shell from the start menu.</LI>
|
|---|
| 93 | <LI> At this point you're ready to install Geant4. If manual installation
|
|---|
| 94 | is chosen, you must set the necessary environment variables. There are
|
|---|
| 95 | various ways to do so; for example through a command file for the Cygwin
|
|---|
| 96 | bash shell. This command file could be named <TT>geant4-setup.sh</TT>,
|
|---|
| 97 | and you must execute it with<BR>
|
|---|
| 98 | <PRE>
|
|---|
| 99 | . geant4-setup.sh
|
|---|
| 100 | </PRE>
|
|---|
| 101 | including the leading dot and blank space. You could also have this as
|
|---|
| 102 | your <TT>.bashrc</TT> file. The commands in the command file should be:
|
|---|
| 103 | <PRE>
|
|---|
| 104 | # Set G4SYSTEM
|
|---|
| 105 | export G4SYSTEM=WIN32-VC
|
|---|
| 106 | #
|
|---|
| 107 | # Set Path to CLHEP
|
|---|
| 108 | export CLHEP_BASE_DIR=C:/usr/local
|
|---|
| 109 | #
|
|---|
| 110 | # --- Other optional settings
|
|---|
| 111 | #Turn on verbose to show command used for compilation
|
|---|
| 112 | #export CPPVERBOSE=1
|
|---|
| 113 | #
|
|---|
| 114 | </PRE>
|
|---|
| 115 | Note, in the example above, CLHEP was installed in <TT>C:/usr/local</TT>,
|
|---|
| 116 | therefore <TT>include/CLHEP</TT> and <TT>lib/CLHEP.lib</TT> must be
|
|---|
| 117 | included therein.</LI>
|
|---|
| 118 | <LI> Once the environment is correctly set, the libraries are built using
|
|---|
| 119 | make from the <TT>geant4/source</TT> directory typing <TT>make</TT>
|
|---|
| 120 | from the <tt>Cygwin bash</TT> shell prompt.</LI>
|
|---|
| 121 | </OL>
|
|---|
| 122 | Examples can be built in the same way as the libraries from
|
|---|
| 123 | examples/novice/N01, for instance:
|
|---|
| 124 | type <TT>make</TT> from the shell prompt.<BR>
|
|---|
| 125 | Note that, depending on which external software is used, there may be
|
|---|
| 126 | some warnings in linking; e.g., we get
|
|---|
| 127 | <TT>"unrecognized source file type -file.o-,object file assumed"</TT>, or
|
|---|
| 128 | warnings of conflictings libraries. This often seems to be caused by an
|
|---|
| 129 | external library compiled for a different run time environment.
|
|---|
| 130 |
|
|---|
| 131 | <P>
|
|---|
| 132 | The binary of the example is placed by default into the
|
|---|
| 133 | <TT>geant4/bin/WIN32-VC</TT> directory. You may run it either from this
|
|---|
| 134 | directory or from the <TT>examples/novice/N01</TT> directory; sample input
|
|---|
| 135 | and output files are placed in each of the <TT>examples/novice</TT>
|
|---|
| 136 | directories. Some of the examples will need to read data files, and
|
|---|
| 137 | the place has to be given in environment variables again similar to the
|
|---|
| 138 | following example:
|
|---|
| 139 | <PRE>
|
|---|
| 140 | #
|
|---|
| 141 | # Environment variables needed to find geant4 data files:
|
|---|
| 142 | #
|
|---|
| 143 | # Data for neutron scattering processes,
|
|---|
| 144 | # distributed in a separate tar file, then placed under data
|
|---|
| 145 | export NeutronHPCrossSections=c:/usr/local/geant4/data/G4NDL
|
|---|
| 146 | #
|
|---|
| 147 | # Nuclear Photon evaporation data,
|
|---|
| 148 | # distributed with the source files under data
|
|---|
| 149 | export G4LEVELGAMMADATA=c:/usr/local/geant4/data/PhotonEvaporation
|
|---|
| 150 | #
|
|---|
| 151 | # Data for radiative decay hadronic processes under data,
|
|---|
| 152 | # distributed in a separate tar file
|
|---|
| 153 | export G4RADIOACTIVEDATA=c:/usr/local/geant4/data/RadiativeDecay
|
|---|
| 154 | #
|
|---|
| 155 | # Data for low energy electromagnetic processes,
|
|---|
| 156 | # distributed in a separate tar file, then placed under data
|
|---|
| 157 | export G4LEDATA=c:/usr/local/geant4/data/G4EMLOW
|
|---|
| 158 | #
|
|---|
| 159 | </PRE>
|
|---|
| 160 | <P>
|
|---|
| 161 | All compiler and linker options are set in <TT>config/sys/WIN32-VC.gmk</TT>.
|
|---|
| 162 | If you require options different from our choice, you can modify this file.
|
|---|
| 163 |
|
|---|
| 164 | <!-- ============================================== Section -->
|
|---|
| 165 | <HR>
|
|---|
| 166 | <A name="3.2">
|
|---|
| 167 | <H2>3.2 Building Kernel Libraries DLLs</H2></A>
|
|---|
| 168 | <p>
|
|---|
| 169 | DLLs (Dynamic Link Libraries) on Windows are supported for .NET VC++ and can
|
|---|
| 170 | be built for the <TT>compound</TT> kernel libraries of Geant4 (see the
|
|---|
| 171 | <a href="../UnixMachines/unixMachines.html">Installation Procedure</a> of this
|
|---|
| 172 | Guide for a dissertation on <TT>global/compound</TT> libraries).
|
|---|
| 173 | <P>
|
|---|
| 174 | The libraries can be built either manually, issuing the command:
|
|---|
| 175 | <PRE>
|
|---|
| 176 | make dll
|
|---|
| 177 | </PRE>
|
|---|
| 178 | from the directory <TT>$G4INSTALL/source</TT> or by specifying it through
|
|---|
| 179 | the <TT>Configure</TT> script used for the installation.<BR>
|
|---|
| 180 | Then, to build any application making use of the installed DLLs, the
|
|---|
| 181 | environment variable <TT>G4LIB_USE_DLL</TT> must be set in the environment.<BR>
|
|---|
| 182 | Once the application is built, it is required to specify to the system the path
|
|---|
| 183 | where the DLLs are installed. To do so, add the absolute path (in Cygwin format)
|
|---|
| 184 | of the DLLs installation directory to the <TT>PATH</TT> variable; for example:
|
|---|
| 185 | <PRE>
|
|---|
| 186 | export PATH=$PATH:/usr/local/geant4/lib/$G4SYSTEM
|
|---|
| 187 | </PRE>
|
|---|
| 188 | You may then be able to run successfully your application.
|
|---|
| 189 | </P>
|
|---|
| 190 |
|
|---|
| 191 | <HR>
|
|---|
| 192 | <A HREF="../../../../Authors/html/subjectsToAuthors.html">
|
|---|
| 193 | <I>About the authors</I></A>
|
|---|
| 194 |
|
|---|
| 195 | </BODY>
|
|---|
| 196 | </HTML>
|
|---|
| 197 |
|
|---|