1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title> |
---|
2 | Geant4 Installation Guide |
---|
3 | </title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="geant4_installation_guide"></a> |
---|
4 | Geant4 Installation Guide |
---|
5 | </h1></div><div><h2 class="subtitle"> |
---|
6 | For setting up Geant4 in your computing environment |
---|
7 | </h2></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname"></span> <span class="surname">Geant4 Collaboration</span></h3></div></div></div><div><p class="releaseinfo">Version: geant4 9.1</p></div><div><p class="pubdate">14 December, 2007</p></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#chap.InstIntro">1. |
---|
8 | Installation Introduction |
---|
9 | </a></span></dt><dd><dl><dt><span class="sect1"><a href="#sect.Support"> |
---|
10 | Supported Computers and Operating Systems |
---|
11 | </a></span></dt><dt><span class="sect1"><a href="#sect.ReqSoft"> |
---|
12 | Required Software |
---|
13 | </a></span></dt><dt><span class="sect1"><a href="#sect.VisSoft"> |
---|
14 | Visualization Software |
---|
15 | </a></span></dt><dt><span class="sect1"><a href="#sect.SoftAnaHisto"> |
---|
16 | Software for Analysis and Histogramming |
---|
17 | </a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap.InstProc">2. |
---|
18 | Installation Procedures |
---|
19 | </a></span></dt><dd><dl><dt><span class="sect1"><a href="#sect.UsingConfig"> |
---|
20 | Using the Configure Script for installation |
---|
21 | </a></span></dt><dt><span class="sect1"><a href="#sect.ConfigEnv"> |
---|
22 | Configuring the Environment to Use Geant4 |
---|
23 | </a></span></dt><dt><span class="sect1"><a href="#sect.InstManually"> |
---|
24 | Installing Geant4 Manually |
---|
25 | </a></span></dt><dd><dl><dt><span class="sect2"><a href="#sect.InstManually.ReqEnvVar"> |
---|
26 | Required Environment Variables |
---|
27 | </a></span></dt><dt><span class="sect2"><a href="#sect.InstManually.OptEnvVar"> |
---|
28 | Optional Environment Variables |
---|
29 | </a></span></dt></dl></dd><dt><span class="sect1"><a href="#sect.IntegGeneFrame"> |
---|
30 | Integrating Geant4 into a Generic Framework |
---|
31 | </a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap.TipsWin">3. |
---|
32 | Tips for Installing on Windows |
---|
33 | </a></span></dt><dd><dl><dt><span class="sect1"><a href="#sect.Cygwin"> |
---|
34 | Windows with the Cygwin Toolset and Microsoft Visual C++ |
---|
35 | </a></span></dt><dt><span class="sect1"><a href="#sect.BuildLibDLLs"> |
---|
36 | Building Kernel Libraries DLLs |
---|
37 | </a></span></dt></dl></dd></dl></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="chap.InstIntro"></a>Chapter 1. |
---|
38 | Installation Introduction |
---|
39 | </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#sect.Support"> |
---|
40 | Supported Computers and Operating Systems |
---|
41 | </a></span></dt><dt><span class="sect1"><a href="#sect.ReqSoft"> |
---|
42 | Required Software |
---|
43 | </a></span></dt><dt><span class="sect1"><a href="#sect.VisSoft"> |
---|
44 | Visualization Software |
---|
45 | </a></span></dt><dt><span class="sect1"><a href="#sect.SoftAnaHisto"> |
---|
46 | Software for Analysis and Histogramming |
---|
47 | </a></span></dt></dl></div><p> |
---|
48 | This section describes the global computing environment required |
---|
49 | for installing the Geant4 toolkit. To set up your specific |
---|
50 | computing environment for Geant4, refer to Section 2 of this Guide. |
---|
51 | </p><p> |
---|
52 | A shell script (<tt class="literal">Configure</tt>) is provided to |
---|
53 | facilitate the installation procedure, and to help the user set up |
---|
54 | the environment correctly. |
---|
55 | </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.Support"></a> |
---|
56 | Supported Computers and Operating Systems |
---|
57 | </h2></div></div><div></div></div><p> |
---|
58 | Geant4 is supported under the following operating systems: |
---|
59 | |
---|
60 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
61 | Linux on PC with g++ (gcc compiler) |
---|
62 | </p></li><li><p> |
---|
63 | MacOSX with g++ (gcc compiler) |
---|
64 | </p></li><li><p> |
---|
65 | Windows/XP with MicroSoft Visual C++ |
---|
66 | </p></li></ul></div><p> |
---|
67 | </p><p> |
---|
68 | Currently, this is the set of flavors which can be associated with |
---|
69 | the environment variable <tt class="literal">$G4SYSTEM</tt> to identify the |
---|
70 | system architecture and compiler used: |
---|
71 | |
---|
72 | </p><div class="literallayout"><p><tt class="literal"><br> |
---|
73 | Linux - Scientific Linux CERN, SLC4 (or SLC5) <br> |
---|
74 | g++ gcc 3.4.6 (or 4.1.2) G4SYSTEM: Linux-g++<br> |
---|
75 | MacOSX - MacOSX Darwin 10.5 <br> |
---|
76 | g++ gcc 4.0.1 G4SYSTEM: Darwin-g++<br> |
---|
77 | Windows - Windows XP and Cygwin32<br> |
---|
78 | MSVC++ 9.0, Visual Studio 2008 G4SYSTEM: WIN32-VC<br> |
---|
79 | </tt></p></div><p> |
---|
80 | </p><p> |
---|
81 | For a more detailed description of supported platforms/compilers |
---|
82 | and versions of third party software, please refer to the release |
---|
83 | notes available with the current release you're using in |
---|
84 | <tt class="literal">geant4/ReleaseNotes</tt> (also accessible from the web |
---|
85 | <a href="http://cern.ch/geant4/support/download.shtml" target="_top"> |
---|
86 | distribution page |
---|
87 | </a> |
---|
88 | ). |
---|
89 | </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.ReqSoft"></a> |
---|
90 | Required Software |
---|
91 | </h2></div></div><div></div></div><p> |
---|
92 | To run Geant4, the following software must be properly installed in |
---|
93 | your computing environment: |
---|
94 | |
---|
95 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
96 | C++ compiler |
---|
97 | </p><p> |
---|
98 | (compiler from Unix vendor, g++ or Visual C++ for Windows systems) |
---|
99 | </p><p> |
---|
100 | </p></li><li><p> |
---|
101 | CLHEP library |
---|
102 | </p><p> |
---|
103 | (see CLHEP reference guide |
---|
104 | <a href="http://cern.ch/clhep/manual/RefGuide/" target="_top"> |
---|
105 | cern.ch/clhep/manual/RefGuide |
---|
106 | </a> |
---|
107 | ) |
---|
108 | </p><p> |
---|
109 | </p></li><li><p> |
---|
110 | GNU Make (note: g++ preprocessing is used to build file |
---|
111 | dependencies) is also used and a UNIX shell |
---|
112 | </p></li><li><p> |
---|
113 | The Geant4 toolkit source code |
---|
114 | </p></li></ul></div><p> |
---|
115 | </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.VisSoft"></a> |
---|
116 | Visualization Software |
---|
117 | </h2></div></div><div></div></div><p> |
---|
118 | The above list of software is the minimum required for a |
---|
119 | non-graphical setup of Geant4. To use visualization graphics in |
---|
120 | Geant4 and/or a graphical user interface (GUI), at least one of the |
---|
121 | following graphic systems or packages is required in your computing |
---|
122 | environment: |
---|
123 | |
---|
124 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
125 | X Windows |
---|
126 | </p></li><li><p> |
---|
127 | <a href="http://www.opengl.org/" target="_top"> |
---|
128 | OpenGL |
---|
129 | </a> |
---|
130 | or |
---|
131 | <a href="http://www.mesa3d.org/" target="_top"> |
---|
132 | MesaGL |
---|
133 | </a> |
---|
134 | (free software compatible with OpenGL) |
---|
135 | </p></li><li><p> |
---|
136 | <a href="http://geant4.kek.jp/GEANT4/vis/" target="_top"> |
---|
137 | DAWN |
---|
138 | </a> |
---|
139 | , a PostScript renderer |
---|
140 | </p></li><li><p> |
---|
141 | <a href="http://www.trolltech.com" target="_top"> |
---|
142 | Qt |
---|
143 | </a> |
---|
144 | , a powerfull toolkit |
---|
145 | </p></li><li><p> |
---|
146 | <a href="http://oss.sgi.com/projects/inventor/" target="_top"> |
---|
147 | Open Inventor |
---|
148 | </a> |
---|
149 | (free software from SGI) |
---|
150 | </p></li><li><p> |
---|
151 | <a href="http://openscientist.lal.in2p3.fr/" target="_top"> |
---|
152 | Open Scientist |
---|
153 | </a> |
---|
154 | (Interactive environment, including GUI) |
---|
155 | </p></li><li><p> |
---|
156 | <a href="http://www.slac.stanford.edu/BFROOT/www/Computing/Graphics/Wired/" target="_top"> |
---|
157 | HepRApp Browser |
---|
158 | </a> |
---|
159 | ( |
---|
160 | <a href="http://www.slac.stanford.edu/~perl/heprep/" target="_top"> |
---|
161 | HepRep |
---|
162 | </a> |
---|
163 | Browser) |
---|
164 | </p></li><li><p> |
---|
165 | <a href="http://wired.freehep.org/" target="_top"> |
---|
166 | WIRED4 JAS Plug-In |
---|
167 | </a> |
---|
168 | ( |
---|
169 | <a href="http://www.slac.stanford.edu/~perl/heprep/" target="_top"> |
---|
170 | HepRep |
---|
171 | </a> |
---|
172 | Browser) |
---|
173 | </p></li><li><p> |
---|
174 | <a href="http://cern.ch/geant4/geant4_public/source/geant4/environments/MOMO/docs/MOMOHelp.html" target="_top"> |
---|
175 | Momo |
---|
176 | </a> |
---|
177 | (a |
---|
178 | <a href="http://java.sun.com/" target="_top"> |
---|
179 | Java |
---|
180 | </a> |
---|
181 | -based GUI environment, GGE, GPE, ...) |
---|
182 | </p></li><li><p> |
---|
183 | VRML browser |
---|
184 | </p></li></ul></div><p> |
---|
185 | </p><p> |
---|
186 | Alternatively, you can produce an ascii file for VRML or DAWN. |
---|
187 | </p><p> |
---|
188 | More information is available in Section 8.6, Visualization |
---|
189 | Drivers, of the User's Guide for Application Developers. |
---|
190 | </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.SoftAnaHisto"></a> |
---|
191 | Software for Analysis and Histogramming |
---|
192 | </h2></div></div><div></div></div><p> |
---|
193 | Histogramming facilities are provided through the <span class="bold"><b>AIDA</b></span> |
---|
194 | abstract interface, which in this case needs to be installed as |
---|
195 | well: |
---|
196 | |
---|
197 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
198 | <a href="http://aida.freehep.org/" target="_top"> |
---|
199 | AIDA |
---|
200 | </a> |
---|
201 | (Abstract Interfaces for Data Analysis) |
---|
202 | </p></li></ul></div><p> |
---|
203 | </p><p> |
---|
204 | External, AIDA-compliant packages which provide the necessary |
---|
205 | functionalities for doing histogramming (and therefore, should be |
---|
206 | optionally installed) are: |
---|
207 | |
---|
208 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
209 | <a href="http://iaida.dynalias.net/" target="_top"> |
---|
210 | iAIDA |
---|
211 | </a> |
---|
212 | (iAIDA, an implementation of AIDA in C++) |
---|
213 | </p></li><li><p> |
---|
214 | <a href="http://jas.freehep.org/jas3/" target="_top"> |
---|
215 | JAS |
---|
216 | </a> |
---|
217 | (Java Analysis Studio) |
---|
218 | </p></li><li><p> |
---|
219 | <a href="http://openscientist.lal.in2p3.fr/" target="_top"> |
---|
220 | Open Scientist |
---|
221 | </a> |
---|
222 | (Interactive Analysis Environment). |
---|
223 | </p></li><li><p> |
---|
224 | <a href="http://ilcsoft.desy.de/portal/software_packages/raida/" target="_top"> |
---|
225 | rAIDA |
---|
226 | </a> |
---|
227 | (rAIDA, a <a href="http://root.cern.ch/" target="_top">Root</a> implementation of AIDA) |
---|
228 | </p></li></ul></div><p> |
---|
229 | </p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="chap.InstProc"></a>Chapter 2. |
---|
230 | Installation Procedures |
---|
231 | </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#sect.UsingConfig"> |
---|
232 | Using the Configure Script for installation |
---|
233 | </a></span></dt><dt><span class="sect1"><a href="#sect.ConfigEnv"> |
---|
234 | Configuring the Environment to Use Geant4 |
---|
235 | </a></span></dt><dt><span class="sect1"><a href="#sect.InstManually"> |
---|
236 | Installing Geant4 Manually |
---|
237 | </a></span></dt><dd><dl><dt><span class="sect2"><a href="#sect.InstManually.ReqEnvVar"> |
---|
238 | Required Environment Variables |
---|
239 | </a></span></dt><dt><span class="sect2"><a href="#sect.InstManually.OptEnvVar"> |
---|
240 | Optional Environment Variables |
---|
241 | </a></span></dt></dl></dd><dt><span class="sect1"><a href="#sect.IntegGeneFrame"> |
---|
242 | Integrating Geant4 into a Generic Framework |
---|
243 | </a></span></dt></dl></div><p> |
---|
244 | |
---|
245 | Before installing Geant4, the required software listed in |
---|
246 | <a href="#sect.ReqSoft" title=" |
---|
247 | Required Software |
---|
248 | ">the section called “ |
---|
249 | Required Software |
---|
250 | ”</a> |
---|
251 | (and <a href="#sect.VisSoft" title=" |
---|
252 | Visualization Software |
---|
253 | ">the section called “ |
---|
254 | Visualization Software |
---|
255 | ”</a> in the case of graphics drivers) |
---|
256 | of this Installation Guide must already be installed on |
---|
257 | your system. |
---|
258 | </p><p> |
---|
259 | In this section, a short tutorial on how to install the |
---|
260 | toolkit's kernel libraries is given. The installation of the Geant4 |
---|
261 | kernel libraries and the proper configuration of the environment |
---|
262 | can be achieved either manually (by setting the proper environment |
---|
263 | variables) or through the <tt class="literal">Configure</tt> shell script, |
---|
264 | which will allow the installation of just the necessary source code |
---|
265 | and libraries in a specified installation area. |
---|
266 | </p><p> |
---|
267 | <span class="emphasis"><em>Step-by-Step</em></span> guides for the installation are |
---|
268 | also available. See |
---|
269 | <a href="http://cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/apas06.html" target="_top"> |
---|
270 | Appendix - Step-by-Step Installation Guides</a> |
---|
271 | of <span class="emphasis"><em>Geant4 User's Guide - For Application Developers</em></span>. |
---|
272 | </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.UsingConfig"></a> |
---|
273 | Using the <tt class="literal">Configure</tt> Script for installation |
---|
274 | </h2></div></div><div></div></div><p> |
---|
275 | A shell script is provided for building the libraries and to allow |
---|
276 | easy installation in a specified area. The <tt class="literal">Configure</tt> |
---|
277 | shell script is placed in the top directory tree of the |
---|
278 | distribution (<tt class="literal">geant4/Configure</tt>) and allows the user or |
---|
279 | system administrator to install the Geant4 toolkit in a |
---|
280 | semi-automatic way. Some knowledge of the system is required for |
---|
281 | the installation, such as: |
---|
282 | |
---|
283 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
284 | the compiler to be used |
---|
285 | </p></li><li><p> |
---|
286 | the path where the Geant4 toolkit is to be installed |
---|
287 | (<tt class="literal">$G4INSTALL</tt>) |
---|
288 | </p></li><li><p> |
---|
289 | definition of installation directory paths (optional) |
---|
290 | </p></li><li><p> |
---|
291 | kind of graphics/analysis system(s) installed in the system, |
---|
292 | and paths to the installation of each graphics/analysis |
---|
293 | package |
---|
294 | </p></li><li><p> |
---|
295 | the kind of library to be generated: static/shared, |
---|
296 | compound/granular. |
---|
297 | </p></li></ul></div><p> |
---|
298 | </p><p> |
---|
299 | To run the installer script for building the libraries of the Geant4 toolkit, |
---|
300 | one must type the following from the top directory |
---|
301 | <tt class="literal">geant4</tt>: |
---|
302 | |
---|
303 | </p><div class="informalexample"><pre class="programlisting"> |
---|
304 | > ./Configure -build |
---|
305 | </pre></div><p> |
---|
306 | |
---|
307 | and follow the on-screen instructions. No system administrator |
---|
308 | privileges are required at this stage. The script will ask for the |
---|
309 | path in the system where the Geant4 libraries should be installed |
---|
310 | later on. The script provides default settings for most of the |
---|
311 | environment variables to be set. By pressing -RETURN-, the default |
---|
312 | values will be selected; otherwise the proper selection (or path, |
---|
313 | in case a path is requested) must be typed in. |
---|
314 | </p><p> |
---|
315 | In case the installation procedure fails for some reason, or you |
---|
316 | realise the selected options were not correct at the time the |
---|
317 | installation started, you can repeat the whole process by manually |
---|
318 | removing the current installation with: |
---|
319 | |
---|
320 | </p><div class="informalexample"><pre class="programlisting"> |
---|
321 | > cd geant4/source |
---|
322 | > make clean |
---|
323 | </pre></div><p> |
---|
324 | where the <tt class="literal">$G4SYSTEM</tt> environment variable (specifying |
---|
325 | the kind of architecture and compiler used) is manually set in your |
---|
326 | environment (according to the flavors listed in |
---|
327 | <a href="#sect.Support" title=" |
---|
328 | Supported Computers and Operating Systems |
---|
329 | ">the section called “ |
---|
330 | Supported Computers and Operating Systems |
---|
331 | ”</a>). |
---|
332 | </p><p> |
---|
333 | In case new modules must be added to an existing build (for |
---|
334 | example a module for visualization), this can be done manually by |
---|
335 | re-running <tt class="literal">Configure</tt> and providing the new |
---|
336 | settings. |
---|
337 | </p><p> |
---|
338 | Once the process of building the libraries has been completed |
---|
339 | successfully, the Geant4 toolkit can be installed in the specified |
---|
340 | (already existing) installation area by typing: |
---|
341 | |
---|
342 | </p><div class="informalexample"><pre class="programlisting"> |
---|
343 | > ./Configure -install |
---|
344 | </pre></div><p> |
---|
345 | </p><p> |
---|
346 | Libraries and necessary source code will be installed in |
---|
347 | <tt class="literal">lib/geant4</tt>, <tt class="literal">include/geant4</tt> (if selected to |
---|
348 | install all headers in a single directory), <tt class="literal">src/geant4</tt>, |
---|
349 | respectively. System administrator privileges may be required for the |
---|
350 | installation stage, depending upon where in the system the installation |
---|
351 | should happen. |
---|
352 | </p><p> |
---|
353 | <tt class="literal">$G4INSTALL</tt> will be set to |
---|
354 | <tt class="literal">[INSTALLATION_AREA]/src/geant4</tt>. |
---|
355 | </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.ConfigEnv"></a> |
---|
356 | Configuring the Environment to Use Geant4 |
---|
357 | </h2></div></div><div></div></div><p> |
---|
358 | Once libraries have been installed, the user's environment must be |
---|
359 | correctly set up for the usage of the Geant4 toolkit. The |
---|
360 | <tt class="literal">Configure</tt> script provides a way to check the existing |
---|
361 | installation and provide the correct configuration for the user's |
---|
362 | environment. Configuration scripts <tt class="literal">env[.sh.csh]</tt> can be |
---|
363 | generated, and should be sourced by the final users in order to |
---|
364 | configure their environment according to the performed |
---|
365 | installation. |
---|
366 | </p><p> |
---|
367 | To generate the configuration scripts, the user should run |
---|
368 | <tt class="literal">Configure</tt> placed in the installation area, as follows: |
---|
369 | |
---|
370 | </p><div class="informalexample"><pre class="programlisting"> |
---|
371 | > $G4INSTALL/Configure |
---|
372 | </pre></div><p> |
---|
373 | </p><p> |
---|
374 | This will generate the shell script <tt class="literal">env.csh</tt> |
---|
375 | (<tt class="literal">env.sh</tt> for <tt class="literal">bash</tt> shell) to be sourced or |
---|
376 | integrated into the shell login script (<tt class="literal">.tcshrc</tt> or |
---|
377 | <tt class="literal">.bashrc</tt>). The shell script will be generated in the |
---|
378 | user's current directory (<tt class="literal">$PWD</tt>). The user can |
---|
379 | customize it to specify for example her/his proper working |
---|
380 | directory through the variable <tt class="literal">$G4WORKDIR</tt>. Once the |
---|
381 | generated script is sourced, the user will be ready to start |
---|
382 | building a Geant4 application. |
---|
383 | </p><p> |
---|
384 | Refer to section the section |
---|
385 | <span class="emphasis"><em> |
---|
386 | Getting Started with Geant4 - How to Make an Executable Program |
---|
387 | </em></span> |
---|
388 | of the |
---|
389 | <a href="http://cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/index.html" target="_top"> |
---|
390 | Geant4 User's Guide for Application Developers |
---|
391 | </a> |
---|
392 | for information on how to build an executable in Geant4. |
---|
393 | </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.InstManually"></a> |
---|
394 | Installing Geant4 Manually |
---|
395 | </h2></div></div><div></div></div><p> |
---|
396 | Before proceeding with the installation, some key environment |
---|
397 | variables must be defined in your user environment in order to |
---|
398 | specify where all software components are to be placed and to set |
---|
399 | some compilation options. A complete reference to all environment |
---|
400 | variables in Geant4 is available in section |
---|
401 | |
---|
402 | <span class="emphasis"><em> |
---|
403 | Appendix - Makefiles and Environment Variables |
---|
404 | </em></span> |
---|
405 | of the |
---|
406 | <a href="http://cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/index.html" target="_top"> |
---|
407 | Geant4 User's Guide for Application Developers |
---|
408 | </a>. |
---|
409 | </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.InstManually.ReqEnvVar"></a> |
---|
410 | Required Environment Variables |
---|
411 | </h3></div></div><div></div></div><div class="variablelist"><p class="title"><b></b></p><dl><dt><span class="term"> |
---|
412 | <tt class="literal">G4SYSTEM:</tt> |
---|
413 | </span></dt><dd><p> |
---|
414 | set to one of the flavors listed in section 1.1 to specify the |
---|
415 | kind of architecture and compiler used |
---|
416 | </p></dd><dt><span class="term"> |
---|
417 | <tt class="literal">G4INSTALL:</tt> |
---|
418 | </span></dt><dd><p> |
---|
419 | path where the Geant4 toolkit tree is installed (ex. |
---|
420 | <tt class="literal">$HOME/geant4</tt>) |
---|
421 | </p></dd><dt><span class="term"> |
---|
422 | <tt class="literal">CLHEP_BASE_DIR:</tt> |
---|
423 | </span></dt><dd><p> |
---|
424 | path to the CLHEP installation |
---|
425 | </p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.InstManually.OptEnvVar"></a> |
---|
426 | Optional Environment Variables |
---|
427 | </h3></div></div><div></div></div><div class="variablelist"><p class="title"><b></b></p><dl><dt><span class="term"> |
---|
428 | <tt class="literal">G4WORKDIR:</tt> |
---|
429 | </span></dt><dd><p> |
---|
430 | path of the user's working directory (default in |
---|
431 | <tt class="literal">$G4INSTALL</tt>) |
---|
432 | </p></dd><dt><span class="term"> |
---|
433 | <tt class="literal">G4LIB:</tt> |
---|
434 | </span></dt><dd><p> |
---|
435 | path where the kernel libraries should be installed (default in |
---|
436 | <tt class="literal">$G4INSTALL/lib</tt>) |
---|
437 | </p></dd><dt><span class="term"> |
---|
438 | <tt class="literal">G4TMP:</tt> |
---|
439 | </span></dt><dd><p> |
---|
440 | path where temporary files (object files, dependency files) are |
---|
441 | placed (default in <tt class="literal">$G4WORKDIR/tmp)</tt> |
---|
442 | </p></dd><dt><span class="term"> |
---|
443 | <tt class="literal">G4BIN:</tt> |
---|
444 | </span></dt><dd><p> |
---|
445 | path where final executable files are placed (default in |
---|
446 | <tt class="literal">$G4WORKDIR/bin)</tt>. |
---|
447 | </p></dd><dt><span class="term"> |
---|
448 | <tt class="literal">G4INCLUDE:</tt> |
---|
449 | </span></dt><dd><p> |
---|
450 | path where source header files may be mirrored at installation |
---|
451 | by issuing <tt class="literal">make includes</tt> (default in |
---|
452 | <tt class="literal">$G4INSTALL/include</tt>) |
---|
453 | </p></dd><dt><span class="term"> |
---|
454 | <tt class="literal">G4DEBUG:</tt> |
---|
455 | </span></dt><dd><p> |
---|
456 | flag specifying that libraries be built with debug symbols |
---|
457 | (requires a lot of disk space). The default is optimised-mode |
---|
458 | </p></dd><dt><span class="term"> |
---|
459 | <tt class="literal">G4LIB_BUILD_SHARED:</tt> |
---|
460 | </span></dt><dd><p> |
---|
461 | flag specifying that kernel libraries be built as shared |
---|
462 | libraries (libraries will then be used by default). If not set, |
---|
463 | static archive libraries are built by default |
---|
464 | </p></dd><dt><span class="term"> |
---|
465 | <tt class="literal">G4LIB_BUILD_STATIC:</tt> |
---|
466 | </span></dt><dd><p> |
---|
467 | flag specifying that kernel libraries be built as static |
---|
468 | archive libraries. Note that you may specify this flag in addition |
---|
469 | to <tt class="literal">G4LIB_BUILD_SHARED</tt> to build shared and static |
---|
470 | libraries simultaneously. |
---|
471 | </p></dd><dt><span class="term"> |
---|
472 | <tt class="literal">G4LIB_BUILD_G3TOG4:</tt> |
---|
473 | </span></dt><dd><p> |
---|
474 | flag specifying that the library for the g3tog4 module be |
---|
475 | built. By default the library will not be built. |
---|
476 | </p></dd><dt><span class="term"> |
---|
477 | <tt class="literal">G4LIB_BUILD_ZLIB:</tt> |
---|
478 | </span></dt><dd><p> |
---|
479 | flag specifying that an additional library for file compression |
---|
480 | should be built (not required on Linux/Unix systems). By default |
---|
481 | the library will not be built. |
---|
482 | </p></dd><dt><span class="term"> |
---|
483 | <tt class="literal">G4_NO_VERBOSE:</tt> |
---|
484 | </span></dt><dd><p> |
---|
485 | defining this flag prevents the compilation of verbosity code |
---|
486 | (for better performance). The default is with verbosity on. |
---|
487 | </p></dd></dl></div><p> |
---|
488 | The list of all additional flags (also requiring third-party packages |
---|
489 | installed) can be found in |
---|
490 | <a href="http://cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/apas05.html#sect.MkflEnvVar.EnvVar" target="_top">Section 5.2</a> |
---|
491 | of the |
---|
492 | <a href="http://cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/index.html" target="_top"> |
---|
493 | Geant4 User's Guide for Application Developers |
---|
494 | </a>. |
---|
495 | </p><p> |
---|
496 | The Geant4 installation requires native STL (the Standard Template |
---|
497 | Library) as the base foundation class library. This also implies |
---|
498 | strict ISO-ANSI language compliance. In addition to the above, you |
---|
499 | might want to set the proper environment for visualization, such |
---|
500 | as: |
---|
501 | |
---|
502 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
503 | the kind of graphics driver(s) installed in the system |
---|
504 | </p></li><li><p> |
---|
505 | the path to the installation of each graphics driver |
---|
506 | </p></li></ul></div><p> |
---|
507 | |
---|
508 | in case you want to build the Geant4 kernel libraries with the |
---|
509 | graphics drivers built-in. See |
---|
510 | |
---|
511 | <span class="emphasis"><em> |
---|
512 | Visualization - The Visualization Drivers |
---|
513 | </em></span> |
---|
514 | of the |
---|
515 | <a href="http://cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/index.html" target="_top"> |
---|
516 | Geant4 User's Guide for Application Developers |
---|
517 | </a>. |
---|
518 | </p><p> |
---|
519 | At this point, you may choose one of two ways to compile and |
---|
520 | install the kernel libraries, depending on your needs and system |
---|
521 | resources. From <tt class="literal">$G4INSTALL/source</tt>: |
---|
522 | |
---|
523 | </p><div class="orderedlist"><ol type="1" compact><li><p> |
---|
524 | <tt class="literal">make</tt> |
---|
525 | </p><p> |
---|
526 | This will make one library for each "leaf" category (maximum |
---|
527 | library granularity) and automatically produce a map of library use |
---|
528 | and dependencies.</p><p> |
---|
529 | </p></li><li><p> |
---|
530 | <tt class="literal">make global</tt> |
---|
531 | </p><p> |
---|
532 | This will make global libraries, one for each major category. |
---|
533 | </p><p> |
---|
534 | </p></li></ol></div><p> |
---|
535 | </p><p> |
---|
536 | The main advantage of the first approach is the speed of building |
---|
537 | the libraries and of the application, which in some cases can be |
---|
538 | improved by a factor of two or three compared to the "global |
---|
539 | library" approach. |
---|
540 | </p><p> |
---|
541 | Using the "granular library" approach a fairly large number |
---|
542 | (roughly 90) of "leaf" libraries is produced. However, the |
---|
543 | dependencies and linking list are evaluated and generated |
---|
544 | automatically on the fly. The top-level <tt class="literal">GNUmakefile</tt> in |
---|
545 | <tt class="literal">$G4INSTALL/source</tt> parses the dependency files of |
---|
546 | Geant4 and produces a file <tt class="literal">libname.map</tt> in |
---|
547 | <tt class="literal">$G4LIB</tt>. <tt class="literal">libname.map</tt> is produced by the |
---|
548 | tool <tt class="literal">liblist</tt>, whose source code is in |
---|
549 | <tt class="literal">$G4INSTALL/config</tt>. |
---|
550 | </p><p> |
---|
551 | When building a binary application the script |
---|
552 | <tt class="literal">binmake.gmk</tt> in <tt class="literal">$G4INSTALL/config</tt> will |
---|
553 | parse the user's dependency files and use <tt class="literal">libname.map</tt> |
---|
554 | to determine through <tt class="literal">liblist</tt> the required libraries to |
---|
555 | add to the linking list. Only the required libraries will be loaded |
---|
556 | in the link command. |
---|
557 | </p><p> |
---|
558 | The command <tt class="literal">make libmap</tt> issued from |
---|
559 | <tt class="literal">$G4INSTALL/source</tt>, allows manual rebuilding of the |
---|
560 | dependency map. The command is issued by default in the normal |
---|
561 | build process for granular libraries. |
---|
562 | </p><p> |
---|
563 | It is possible to install both "granular" and "compound" libraries, |
---|
564 | by typing "make" and "make global" in sequence. In this case, to |
---|
565 | choose usage of granular libraries at link time one should set the |
---|
566 | flag G4LIB_USE_GRANULAR in the environment; otherwise compound |
---|
567 | libraries will be adopted by default. |
---|
568 | </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.IntegGeneFrame"></a> |
---|
569 | Integrating Geant4 into a Generic Framework |
---|
570 | </h2></div></div><div></div></div><p> |
---|
571 | As part of the Geant4 kernel libraries installation, it is also |
---|
572 | possible to put the entire set of header files in a single place, |
---|
573 | which is determined by the environment variable |
---|
574 | <tt class="literal">G4INCLUDE</tt> specifying the directory path. Therefore, |
---|
575 | it's rather straightforward to integrate Geant4 into a generic |
---|
576 | external framework, by simply knowing the path where header files |
---|
577 | are located in the system (<tt class="literal">G4INCLUDE</tt>) and where |
---|
578 | installed libraries are placed (<tt class="literal">G4LIB</tt>). |
---|
579 | </p><p> |
---|
580 | In <a href="http://cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/apas05.html#sect.MkflEnvVar.EnvVar" target="_top">Section 5.2</a>. |
---|
581 | (<span class="emphasis"><em>Appendix - Makefiles and Environment Variables</em></span>) |
---|
582 | of the |
---|
583 | <a href="http://cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/index.html" target="_top"> |
---|
584 | Geant4 User's Guide for Application Developers |
---|
585 | </a>, |
---|
586 | you can find a list of all the environment variables. In |
---|
587 | <a href="http://cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/apas05.html#sect.MkflEnvVar.LnkExtLib" target="_top">Section 5.3</a> |
---|
588 | it is also explained how to integrate external libraries which may or |
---|
589 | may not use the Geant4 kernel libraries, using the <tt class="literal">GNUmake</tt> |
---|
590 | build system of Geant4. |
---|
591 | </p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="chap.TipsWin"></a>Chapter 3. |
---|
592 | Tips for Installing on Windows |
---|
593 | </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#sect.Cygwin"> |
---|
594 | Windows with the Cygwin Toolset and Microsoft Visual C++ |
---|
595 | </a></span></dt><dt><span class="sect1"><a href="#sect.BuildLibDLLs"> |
---|
596 | Building Kernel Libraries DLLs |
---|
597 | </a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.Cygwin"></a> |
---|
598 | Windows with the Cygwin Toolset and Microsoft Visual C++ |
---|
599 | </h2></div></div><div></div></div><p> |
---|
600 | To compile and run Geant4 under Windows systems, some additional |
---|
601 | information and tools are required, although the installation |
---|
602 | produre is similar to that required on a UNIX based system. On |
---|
603 | Windows, the Cygwin toolset and the Microsoft Visual C++ compiler |
---|
604 | are used. |
---|
605 | </p><p> |
---|
606 | Cygwin32 is a UNIX development environment available for Microsoft |
---|
607 | Windows. You can freely obtain Cygwin32 from |
---|
608 | <a href="http://cygwin.com/" target="_top"> |
---|
609 | Cygwin |
---|
610 | </a> |
---|
611 | or |
---|
612 | <a href="http://x.cygwin.com/" target="_top"> |
---|
613 | Cygwin/X |
---|
614 | </a> |
---|
615 | . |
---|
616 | </p><p> |
---|
617 | We do not support direct use of Visual Studio; i.e. we do not |
---|
618 | provide Visual Studio workspace (.dsw) or project (.dsp) files, nor |
---|
619 | we do provide makefiles for the <tt class="literal">nmake</tt> application of MS |
---|
620 | Visual C++. |
---|
621 | </p><p> |
---|
622 | We use several of the tools provided by the Cygwin toolset: |
---|
623 | |
---|
624 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
625 | <tt class="literal">make.exe</tt> as a make tool |
---|
626 | </p></li><li><p> |
---|
627 | <tt class="literal">g++.exe</tt> as a tool to analyse source file dependencies |
---|
628 | and create dependency (<tt class="literal">.d</tt>) files |
---|
629 | </p></li><li><p> |
---|
630 | several other unix tools like <tt class="literal">cp</tt>, <tt class="literal">mv</tt>, |
---|
631 | <tt class="literal">rm</tt>, <tt class="literal">touch</tt>, etc. |
---|
632 | </p></li></ul></div><p> |
---|
633 | </p><p> |
---|
634 | At the installation of the Cygwin toolset it is therefore required |
---|
635 | to explicitely select some packages (i.e. <span class="emphasis"><em>gmake</em></span>, |
---|
636 | <span class="emphasis"><em>gcc</em></span>, <span class="emphasis"><em>binutils</em></span> |
---|
637 | and <span class="emphasis"><em>tcsh</em></span> from the "devel" category) in |
---|
638 | addition to those which are part of the default installation. |
---|
639 | </p><p> |
---|
640 | For more details on the toolset, please see the documentation |
---|
641 | available on the |
---|
642 | <a href="http://cygwin.com/" target="_top"> |
---|
643 | Cygwin pages |
---|
644 | </a> |
---|
645 | . |
---|
646 | The User's Guide has quick start guides and help with |
---|
647 | setting up Cygwin with <tt class="literal">setup.exe</tt>. |
---|
648 | </p><p> |
---|
649 | Links to some installation tips for the Cygwin toolset and also |
---|
650 | "step by step" installation guides can be found in the section |
---|
651 | <a href="http://cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/apas06.html" target="_top"> |
---|
652 | Appendix - Step-by-Step Installation Guides - Build for MS Visual C++ |
---|
653 | </a> |
---|
654 | of <span class="emphasis"><em>Geant4 User's Guide - For Application Developers</em></span>. |
---|
655 | </p><p> |
---|
656 | The usage of Cygwin32 for the build environment results in a |
---|
657 | build procedure similar to that on a UNIX system. |
---|
658 | </p><p> |
---|
659 | The following steps are required to install geant4: |
---|
660 | |
---|
661 | </p><div class="orderedlist"><ol type="1" compact><li><p> |
---|
662 | Install Cygwin (see also notes above and additional |
---|
663 | <a href="http://cern.ch/geant4/support/windows_note.shtml" target="_top">installation |
---|
664 | notes</a> for known issues related to the most current version): |
---|
665 | </p><p> |
---|
666 | We do not depend on any specific feature of the version of Cygwin, |
---|
667 | so newer versions (or slightly older) are expected to work. |
---|
668 | </p><p> |
---|
669 | </p></li><li><p> |
---|
670 | Set the environment for MS Visual C++, i.e. set the paths to |
---|
671 | libraries, include files, and executables for MS Visual C++. This |
---|
672 | can be done by modifying the start-up batch file |
---|
673 | <tt class="literal">cygwin.bat</tt> of Cygwin32 to include all the MSDOS commands |
---|
674 | found in the file <tt class="literal">vcvars32.bat</tt> provided in MS Visual C++ |
---|
675 | (in the VC++ .NET compiler installation directory, and usually |
---|
676 | located inside the <tt class="literal">Common7/Tools</tt> directory). This |
---|
677 | modification should be done after the installation of the Cygwin |
---|
678 | toolset, so that the environment gets properly set at the time of |
---|
679 | the invocation of the shell. |
---|
680 | </p></li><li><p> |
---|
681 | Unpack the source code into a directory of your choice. |
---|
682 | </p></li><li><p> |
---|
683 | Start the <tt class="literal">Cygwin</tt> shell from the start menu. |
---|
684 | </p></li><li><p> |
---|
685 | At this point you're ready to install Geant4. If manual |
---|
686 | installation is chosen, you must set the necessary environment |
---|
687 | variables. There are various ways to do so; for example through a |
---|
688 | command file for the Cygwin bash shell. This command file could be |
---|
689 | named <tt class="literal">geant4-setup.sh</tt>, and you must execute it with |
---|
690 | |
---|
691 | </p><div class="informalexample"><pre class="programlisting"> |
---|
692 | . geant4-setup.sh |
---|
693 | </pre></div><p> |
---|
694 | |
---|
695 | including the leading dot and blank space. You could also have this |
---|
696 | as your <tt class="literal">.bashrc</tt> file. The commands in the command file |
---|
697 | should be: |
---|
698 | |
---|
699 | </p><div class="informalexample"><pre class="programlisting"> |
---|
700 | # Set G4SYSTEM |
---|
701 | export G4SYSTEM=WIN32-VC |
---|
702 | # |
---|
703 | # Set Path to CLHEP |
---|
704 | export CLHEP_BASE_DIR=C:/usr/local |
---|
705 | # |
---|
706 | # --- Other optional settings |
---|
707 | #Turn on verbose to show command used for compilation |
---|
708 | #export CPPVERBOSE=1 |
---|
709 | # |
---|
710 | </pre></div><p> |
---|
711 | Note, in the example above, CLHEP was installed in |
---|
712 | <tt class="literal">C:/usr/local</tt>, therefore <tt class="literal">include/CLHEP</tt> and |
---|
713 | <tt class="literal">lib/CLHEP.lib</tt> must be included therein. |
---|
714 | </p></li><li><p> |
---|
715 | Once the environment is correctly set, the libraries are built |
---|
716 | using make from the <tt class="literal">geant4/source</tt> directory typing |
---|
717 | <tt class="literal">make</tt> from the <tt class="literal">Cygwin bash</tt> shell |
---|
718 | prompt. |
---|
719 | </p></li></ol></div><p> |
---|
720 | </p><p> |
---|
721 | Examples can be built in the same way as the libraries from |
---|
722 | examples/novice/N01, for instance: type <tt class="literal">make</tt> from the |
---|
723 | shell prompt. |
---|
724 | </p><p> |
---|
725 | Note that, depending on which external software is used, there may |
---|
726 | be some warnings in linking about conflictings libraries. This often |
---|
727 | seems to be caused by an external library compiled for a different |
---|
728 | run time environment. |
---|
729 | </p><p> |
---|
730 | The binary of the example is placed by default into the |
---|
731 | <tt class="literal">geant4/bin/WIN32-VC</tt> directory. You may run it either from |
---|
732 | this directory or from the <tt class="literal">examples/novice/N01</tt> directory; |
---|
733 | sample input and output files are placed in each of the |
---|
734 | <tt class="literal">examples/novice</tt> directories. Some of the examples will |
---|
735 | need to read data files, and the place has to be given in |
---|
736 | environment variables again similar to the following example: |
---|
737 | |
---|
738 | </p><div class="informalexample"><pre class="programlisting"> |
---|
739 | # |
---|
740 | # Environment variables needed to find geant4 data files: |
---|
741 | # |
---|
742 | # Data for neutron scattering processes, |
---|
743 | # distributed in a separate tar file, then placed under data |
---|
744 | export G4NEUTRONHPDATA=c:/usr/local/geant4/data/G4NDL |
---|
745 | # |
---|
746 | # Nuclear Photon evaporation data, |
---|
747 | # distributed with the source files under data |
---|
748 | export G4LEVELGAMMADATA=c:/usr/local/geant4/data/PhotonEvaporation |
---|
749 | # |
---|
750 | # Data for radiative decay hadronic processes under data, |
---|
751 | # distributed in a separate tar file |
---|
752 | export G4RADIOACTIVEDATA=c:/usr/local/geant4/data/RadiativeDecay |
---|
753 | # |
---|
754 | # Data for low energy electromagnetic processes, |
---|
755 | # distributed in a separate tar file, then placed under data |
---|
756 | export G4LEDATA=c:/usr/local/geant4/data/G4EMLOW |
---|
757 | # |
---|
758 | # Data for nuclear shell effects for INCL/ABLA hadronic model, |
---|
759 | # distributed in a separate tar file, then placed under data |
---|
760 | export G4ABLADATA=c:/usr/local/geant4/data/G4ABLA |
---|
761 | # |
---|
762 | </pre></div><p> |
---|
763 | </p><p> |
---|
764 | All compiler and linker options are set in |
---|
765 | <tt class="literal">config/sys/WIN32-VC.gmk</tt>. If you require options different |
---|
766 | from our choice, you can modify this file. |
---|
767 | </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.BuildLibDLLs"></a> |
---|
768 | Building Kernel Libraries DLLs |
---|
769 | </h2></div></div><div></div></div><p> |
---|
770 | DLLs (Dynamic Link Libraries) on Windows are supported for MS-VC++ |
---|
771 | and can be built for the <tt class="literal">compound</tt> kernel libraries of |
---|
772 | Geant4 (see <a href="#sect.InstManually.OptEnvVar" title=" |
---|
773 | Optional Environment Variables |
---|
774 | ">the section called “ |
---|
775 | Optional Environment Variables |
---|
776 | ”</a> of the |
---|
777 | Installation Procedure of this Guide for a dissertation on |
---|
778 | <tt class="literal">global/compound</tt> libraries). |
---|
779 | </p><p> |
---|
780 | The libraries can be built either manually, issuing the |
---|
781 | command: |
---|
782 | |
---|
783 | </p><div class="informalexample"><pre class="programlisting"> |
---|
784 | make dll |
---|
785 | </pre></div><p> |
---|
786 | |
---|
787 | from the directory <tt class="literal">$G4INSTALL/source</tt> or by specifying it |
---|
788 | through the <tt class="literal">Configure</tt> script used for the |
---|
789 | installation. |
---|
790 | </p><p> |
---|
791 | Then, to build any application making use of the installed DLLs, |
---|
792 | the environment variable <tt class="literal">G4LIB_USE_DLL</tt> must be set in the |
---|
793 | environment. |
---|
794 | </p><p> |
---|
795 | Once the application is built, it is required to specify to the |
---|
796 | system the path where the DLLs are installed. To do so, add the |
---|
797 | absolute path (in Cygwin format) of the DLLs installation directory |
---|
798 | to the <tt class="literal">PATH</tt> variable; for example: |
---|
799 | |
---|
800 | </p><div class="informalexample"><pre class="programlisting"> |
---|
801 | export PATH=$PATH:/usr/local/geant4/lib/$G4SYSTEM |
---|
802 | </pre></div><p> |
---|
803 | </p><p> |
---|
804 | You may then be able to run successfully your application. |
---|
805 | </p></div></div></div></body></html> |
---|