1 | <HTML> |
---|
2 | <HEAD> |
---|
3 | <TITLE>Unix Machines</TITLE> |
---|
4 | </HEAD> |
---|
5 | |
---|
6 | <BODY> |
---|
7 | <TABLE WIDTH="100%"><TR> |
---|
8 | <TD> |
---|
9 | |
---|
10 | |
---|
11 | <A HREF="../index.html"> |
---|
12 | <IMG BORDER="0" SRC="../../../../resources/html/IconsGIF/Contents.gif" ALT="Contents"></A> |
---|
13 | <A HREF="../Introduction/introduction.html"> |
---|
14 | <IMG BORDER="0" SRC="../../../../resources/html/IconsGIF/Previous.gif" ALT="Previous"></A> |
---|
15 | <A HREF="../PCMachines/pcMachines.html"> |
---|
16 | <IMG BORDER="0" SRC="../../../../resources/html/IconsGIF/Next.gif" ALT="Next"></A> |
---|
17 | </TD> |
---|
18 | <TD ALIGN="Right"> |
---|
19 | <FONT SIZE="-1" COLOR="#238E23"> |
---|
20 | <P ALIGN="Right"> |
---|
21 | <B>Installation Guide</B><BR> |
---|
22 | </FONT> |
---|
23 | </TD> |
---|
24 | </TR></TABLE> |
---|
25 | <P> |
---|
26 | <BR><BR> |
---|
27 | |
---|
28 | <P ALIGN="Center"> |
---|
29 | <FONT SIZE="+4" COLOR="#238E23"> |
---|
30 | <A name="2"> |
---|
31 | <B>2. Installation Procedures</B></A> |
---|
32 | </FONT> |
---|
33 | <BR><BR> |
---|
34 | |
---|
35 | <HR ALIGN="Center" SIZE="7%"> |
---|
36 | <BR><BR> |
---|
37 | |
---|
38 | <!-- ============================================== Section --> |
---|
39 | |
---|
40 | Before installing Geant4, the required software listed in |
---|
41 | <A HREF="../Introduction/introduction.html">section 1.2</A> |
---|
42 | (and <A HREF="../Introduction/introduction.html">1.3</A> in the case of |
---|
43 | graphics drivers) of this Installation Guide must already be installed on |
---|
44 | your system. |
---|
45 | |
---|
46 | <p> |
---|
47 | In this section, a short tutorial on how to install the toolkit's |
---|
48 | kernel libraries is given. The installation of the Geant4 kernel |
---|
49 | libraries and the proper configuration of the environment can be |
---|
50 | achieved either manually (by setting the proper environment variables) |
---|
51 | or through the <CODE>Configure</CODE> shell script, which will allow |
---|
52 | the installation of just the necessary source code and libraries in a |
---|
53 | specified installation area. |
---|
54 | <P> |
---|
55 | |
---|
56 | <A name="2.1"> |
---|
57 | <H2>2.1 Using the <CODE>Configure</CODE> Script for installation</H2></A> |
---|
58 | |
---|
59 | A shell script is provided for building the libraries and to allow easy |
---|
60 | installation in a specified area. |
---|
61 | The <CODE>Configure</CODE> shell script is placed in the top directory tree |
---|
62 | of the distribution (<CODE>geant4/Configure</CODE>) and allows the user or |
---|
63 | system administrator to install the Geant4 toolkit in a semi-automatic way. |
---|
64 | Some knowledge of the system is required for the installation, such as: |
---|
65 | <UL> |
---|
66 | <LI>the compiler to be used</LI> |
---|
67 | <LI>the path where the Geant4 toolkit is to be installed |
---|
68 | (<CODE>$G4INSTALL</CODE>)</LI> |
---|
69 | <LI>definition of installation directory paths (optional)</LI> |
---|
70 | <LI>kind of graphics/analysis system(s) installed in the system, |
---|
71 | and paths to the installation of each graphics/analysis package</LI> |
---|
72 | <LI>the kind of library to be generated: static/shared, compound/granular.</LI> |
---|
73 | </UL> |
---|
74 | |
---|
75 | To run the installer script for installation of the Geant4 toolkit, |
---|
76 | one must type the following from the top directory <CODE>geant4</CODE>: |
---|
77 | <PRE> |
---|
78 | > ./Configure -build |
---|
79 | </PRE> |
---|
80 | and follow the on-screen instructions. The script will ask for the |
---|
81 | path in the system where the Geant4 libraries should be installed later on. |
---|
82 | The script provides default settings for most of the environment variables |
---|
83 | to be set. By pressing -RETURN-, the default values will be selected; |
---|
84 | otherwise the proper selection (or path, in case a path is requested) must be |
---|
85 | typed in. |
---|
86 | <P> |
---|
87 | In case the installation procedure fails for some reason, or you realise |
---|
88 | the selected options were not correct at the time the installation started, |
---|
89 | you can repeat the whole process by manually removing the current installation |
---|
90 | with: |
---|
91 | <PRE> |
---|
92 | > cd geant4/source |
---|
93 | > gmake clean |
---|
94 | </PRE> |
---|
95 | where the <CODE>$G4SYSTEM</CODE> environment variable (specifying the |
---|
96 | kind of architecture and compiler used) is manually set in your environment |
---|
97 | (according to the flavors listed in section 1.1). |
---|
98 | <P> |
---|
99 | In case new modules must be added to an existing build (for example |
---|
100 | a module for visualization), this can be done manually by re-running |
---|
101 | <CODE>Configure</CODE> and providing the new settings. |
---|
102 | <P> |
---|
103 | Once the process of building the libraries has been completed successfully, |
---|
104 | the Geant4 toolkit can be installed in the specified (already existing) |
---|
105 | installation area by typing: |
---|
106 | <PRE> |
---|
107 | > ./Configure -install |
---|
108 | </PRE> |
---|
109 | Libraries and necessary source code will be installed in <TT>lib/geant4</TT>, |
---|
110 | <TT>include/geant4</TT> (if selected to install all headers in a single |
---|
111 | directory), <TT>src/geant4</TT>, respectively.<BR> |
---|
112 | <CODE>$G4INSTALL</CODE> will be set to |
---|
113 | <CODE>[INSTALLATION_AREA]/src/geant4</CODE>. |
---|
114 | |
---|
115 | <BR> |
---|
116 | <HR> |
---|
117 | <A name="2.1.1"> |
---|
118 | <H2>2.1.1 Configuring the Environment to Use Geant4</H2></A> |
---|
119 | Once libraries have been installed, the user's environment must be correctly |
---|
120 | set up for the usage of the Geant4 toolkit. The <CODE>Configure</CODE> script |
---|
121 | provides a way to check the existing installation and provide the correct |
---|
122 | configuration for the user's environment. Configuration scripts |
---|
123 | <TT>env[.sh.csh]</TT> can be generated, and should be sourced by the final |
---|
124 | users in order to configure their environment according to the performed |
---|
125 | installation.<BR> |
---|
126 | |
---|
127 | To generate the configuration scripts, the user should run <TT>Configure</TT> |
---|
128 | placed in the installation area, as follows: |
---|
129 | <PRE> |
---|
130 | > $G4INSTALL/Configure |
---|
131 | </PRE> |
---|
132 | This will generate the shell script <CODE>env.csh</CODE> (<CODE>env.sh</CODE> |
---|
133 | for <TT>bash</TT> shell) to be sourced or integrated into the shell login |
---|
134 | script (<CODE>.tcshrc</CODE> or <CODE>.bashrc</CODE>). |
---|
135 | The shell script will be generated in the user's current directory |
---|
136 | (<CODE>$PWD</CODE>). The user can customize it to specify for example |
---|
137 | her/his proper working directory through the variable <CODE>$G4WORKDIR</CODE>. |
---|
138 | Once the generated script is sourced, the user will be ready to start building |
---|
139 | a Geant4 application.<BR> |
---|
140 | Refer to <a href="../../../ForApplicationDeveloper/html/GettingStarted/makeFile.html">section 2.7</a> |
---|
141 | of the "Geant4 User's Guide for Application Developers" for information on how |
---|
142 | to build an executable in Geant4. |
---|
143 | |
---|
144 | <BR> |
---|
145 | <HR> |
---|
146 | |
---|
147 | <A name="2.2"> |
---|
148 | <H2>2.2 Installing Geant4 Manually</H2></A> |
---|
149 | |
---|
150 | <p> |
---|
151 | Before proceeding with the installation, some key environment variables must |
---|
152 | be defined in your user environment in order to specify where all |
---|
153 | software components are to be placed and to set some compilation options. |
---|
154 | A complete reference to all environment variables in Geant4 is available in |
---|
155 | <a href="../../../ForApplicationDeveloper/html/Appendix/makeFile.html">section 10.5</a> |
---|
156 | of the "User's Guide - For Application Developers". |
---|
157 | </p> |
---|
158 | |
---|
159 | <h4>Required Environment Variables </h4> |
---|
160 | <DL> |
---|
161 | <dt><CODE>G4SYSTEM</CODE>: </dt> |
---|
162 | <DD>set to one of the flavors listed in section 1.1 to specify the kind of |
---|
163 | architecture and compiler used |
---|
164 | <DT><CODE>G4INSTALL</CODE>: |
---|
165 | <DD>path where the Geant4 toolkit tree is installed (ex. <CODE>$HOME/geant4</CODE>) |
---|
166 | <dt><code>CLHEP_BASE_DIR</code>: |
---|
167 | <dd>path to the CLHEP installation |
---|
168 | </DL> |
---|
169 | <h4>Optional Environment Variables </h4> |
---|
170 | <DL> |
---|
171 | <dt><CODE>G4WORKDIR</CODE>: </dt> |
---|
172 | <DD>path of the user's working directory (default in <CODE>$G4INSTALL</CODE>) |
---|
173 | <dt><CODE>G4LIB</CODE>: </dt> |
---|
174 | <DD>path where the kernel libraries should be installed (default in <CODE>$G4INSTALL/lib</CODE>) |
---|
175 | <dt><CODE>G4TMP</CODE>:</dt> |
---|
176 | <dd>path where temporary files (object files, dependency files) are placed (default |
---|
177 | in <CODE>$G4WORKDIR/tmp)</CODE></dd> |
---|
178 | <dt><CODE>G4BIN</CODE>:</dt> |
---|
179 | <DD> path where final executable files are placed (default in <CODE>$G4WORKDIR/bin)</CODE>. |
---|
180 | <DT><CODE>G4INCLUDE</CODE>: |
---|
181 | <DD>path where source header files may be mirrored at installation by issuing |
---|
182 | <CODE>gmake includes</CODE> (default in <CODE>$G4INSTALL/include</CODE>) |
---|
183 | <DT><CODE>G4DEBUG</CODE>: |
---|
184 | <DD>flag specifying that libraries be built with debug symbols (requires a |
---|
185 | lot of disk space). The default is optimised-mode |
---|
186 | <DT><CODE>G4LIB_BUILD_SHARED</CODE>: |
---|
187 | <DD>flag specifying that kernel libraries be built as shared libraries |
---|
188 | (libraries will then be used by default). If not set, static archive |
---|
189 | libraries are built by default |
---|
190 | <DT><CODE>G4LIB_BUILD_STATIC</CODE>: |
---|
191 | <DD>flag specifying that kernel libraries be built as static archive |
---|
192 | libraries. Note that you may specify this flag in addition to |
---|
193 | <code>G4LIB_BUILD_SHARED</code> to build shared and static libraries |
---|
194 | simultaneously. |
---|
195 | <DT><CODE>G4LIB_BUILD_G3TOG4</CODE>: |
---|
196 | <DD>flag specifying that the library for the g3tog4 module be built. By |
---|
197 | default the library will not be built. |
---|
198 | <DT><CODE>G4LIB_BUILD_ZLIB</CODE>: |
---|
199 | <DD>flag specifying that an additional library for file compression should |
---|
200 | be built (not required on Linux/Unix systems). By default the library |
---|
201 | will not be built. |
---|
202 | <DT><CODE>G4_NO_VERBOSE</CODE>: |
---|
203 | <DD>defining this flag prevents the compilation of verbosity code (for |
---|
204 | better performance). The default is with verbosity on. |
---|
205 | </DL> |
---|
206 | The Geant4 installation requires native STL (the Standard Template |
---|
207 | Library) as the base foundation class library. This also implies strict |
---|
208 | ISO-ANSI language compliance. |
---|
209 | |
---|
210 | In addition to the above, you might want to set the proper environment |
---|
211 | for visualization, such as: |
---|
212 | <UL> |
---|
213 | <LI>the kind of graphics driver(s) installed in the system |
---|
214 | <LI>the path to the installation of each graphics driver |
---|
215 | </UL> |
---|
216 | in case you want to build the Geant4 kernel libraries with the graphics |
---|
217 | drivers built-in. See |
---|
218 | <a href="../../../ForApplicationDeveloper/html/Visualization/visdrivers.html">section |
---|
219 | 8.3</a> in the User's Application Developers Guide. |
---|
220 | <P> |
---|
221 | At this point, you may choose one of two ways to compile and install the |
---|
222 | kernel libraries, depending on your needs and system resources. |
---|
223 | From <CODE>$G4INSTALL/source</CODE>: |
---|
224 | <OL> |
---|
225 | <LI><CODE>gmake</CODE><BR> |
---|
226 | This will make one library for each "leaf" category (maximum library |
---|
227 | granularity) and automatically produce a map of library use and |
---|
228 | dependencies. |
---|
229 | <LI><CODE>gmake global</CODE><BR> |
---|
230 | This will make global libraries, one for each major category. |
---|
231 | </OL> |
---|
232 | The main advantage of the first approach is the speed of building the |
---|
233 | libraries and of the application, which in some cases can be improved by |
---|
234 | a factor of two or three compared to the "global library" approach.<BR> |
---|
235 | Using the "granular library" approach a fairly large number (roughly 90) |
---|
236 | of "leaf" libraries is produced. However, the dependencies and linking |
---|
237 | list are evaluated and generated automatically on the fly. The top-level |
---|
238 | <CODE>GNUmakefile</CODE> in <CODE>$G4INSTALL/source</CODE> parses the |
---|
239 | dependency files of Geant4 and produces a file <CODE>libname.map</CODE> in |
---|
240 | <CODE>$G4LIB</CODE>. |
---|
241 | <CODE>libname.map</CODE> is produced by the tool <CODE>liblist</CODE>, whose |
---|
242 | source code is in <CODE>$G4INSTALL/config</CODE>.<BR> |
---|
243 | When building a binary application the script <CODE>binmake.gmk</CODE> in |
---|
244 | <CODE>$G4INSTALL/config</CODE> will parse the user's dependency files and use |
---|
245 | <CODE>libname.map</CODE> to determine through <CODE>liblist</CODE> the required |
---|
246 | libraries to add to the linking list. Only the required libraries will be |
---|
247 | loaded in the link command.<BR> |
---|
248 | The command <CODE>gmake libmap</CODE> issued from |
---|
249 | <CODE>$G4INSTALL/source</CODE>, |
---|
250 | allows manual rebuilding of the dependency map. The command is issued by |
---|
251 | default in the normal build process for granular libraries.<BR> |
---|
252 | It is possible to install both "granular" and "compound" libraries, by typing |
---|
253 | "gmake" and "gmake global" in sequence. In this case, to choose usage of |
---|
254 | granular libraries at link time one should set the flag G4LIB_USE_GRANULAR in |
---|
255 | the environment; otherwise compound libraries will be adopted by default. |
---|
256 | |
---|
257 | <BR> |
---|
258 | <HR> |
---|
259 | <A name="2.3"> |
---|
260 | <H2>2.3 Integrating Geant4 into a Generic Framework</H2></A> |
---|
261 | |
---|
262 | As part of the Geant4 kernel libraries installation, it is also possible |
---|
263 | to put the entire set of header files in a single place, which is determined |
---|
264 | by the environment variable <CODE>G4INCLUDE</CODE> specifying the directory |
---|
265 | path. Therefore, it's rather straightforward to integrate Geant4 into a |
---|
266 | generic external framework, by simply knowing the path where header files are |
---|
267 | located in the system (<CODE>G4INCLUDE</CODE>) and where installed libraries |
---|
268 | are placed (<CODE>G4LIB</CODE>). |
---|
269 | <P> |
---|
270 | In <a href="../../../ForApplicationDeveloper/html/Appendix/makeFile.html">section 10.5</a> |
---|
271 | of the Appendix, you can find a list of all the environment variables, together |
---|
272 | with a section explaining how to integrate external libraries which may or may |
---|
273 | not use Geant4 kernel libraries, in the <TT>GNUmake</TT> mechanism of Geant4. |
---|
274 | <BR><BR> |
---|
275 | <HR> |
---|
276 | <A HREF="../../../../Authors/html/subjectsToAuthors.html"> |
---|
277 | <I>About the authors</I></A> |
---|
278 | |
---|
279 | </BODY> |
---|
280 | </HTML> |
---|