source: trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/Appendix/makeFile.xml @ 1213

Last change on this file since 1213 was 1213, checked in by garnier, 15 years ago

Suppression de Xaw. Sauf dans Configure et les fichier G4UIXaw.hh et cc

File size: 30.6 KB
Line 
1<!-- ******************************************************** -->
2<!--                                                          -->
3<!--  [History]                                               -->
4<!--    Converted to DocBook: Katsuya Amako, Aug-2006         -->
5<!--                                                          -->
6<!-- ******************************************************** -->
7
8
9<!-- ******************* Section (Level#1) ****************** -->
10<sect1 id="sect.MkflEnvVar">
11<title>
12Makefiles and Environment Variables
13</title>
14
15<para>
16This section describes how the GNUmake infrastructure is
17implemented in Geant4 and provides a quick reference guide for the
18user/installer about the most important environment variables
19defined.
20</para>
21
22<!-- ******************* Section (Level#2) ****************** -->
23<sect2 id="sect.MkflEnvVar.GNUG4">
24<title>
25The GNUmake system in Geant4
26</title>
27
28<para>
29As described in <xref linkend="sect.HowToDefMain" /> of the
30Installation Guide, the GNUmake process in
31Geant4 is mainly controlled by the following GNUmake script files
32(<literal>*.gmk</literal> scripts are placed in
33<literal>$G4INSTALL/config</literal>):
34
35<itemizedlist spacing="compact">
36  <listitem><para>
37    <literal>architecture.gmk</literal>: defining all the architecture
38    specific settings and paths. System settings are stored in
39    <literal>$G4INSTALL/config/sys</literal> in separate files.
40  </para></listitem>
41  <listitem><para>
42    <literal>common.gmk</literal>: defining all general GNUmake rules for
43    building objects and libraries.
44  </para></listitem>
45  <listitem><para>
46    <literal>globlib.gmk</literal>: defining all general GNUmake rules for
47    building compound libraries.
48  </para></listitem>
49  <listitem><para>
50    <literal>binmake.gmk</literal>: defining the general GNUmake rules for
51    building executables.
52  </para></listitem>
53  <listitem><para>
54    <literal>GNUmake</literal> scripts: placed inside each directory in the
55    G4 distribution and defining directives specific to build a library
56    (or a set of sub-libraries) or and executable.
57  </para></listitem>
58</itemizedlist>
59</para>
60
61<para>
62To build a single library (or a set of sub-libraries) or an
63executable, you must explicitly change your current directory to
64the one you're interested in and invoke the "<literal>make</literal>"
65command from there ("<literal>make global</literal>" for building a
66compound library). Here is a list of the basic commands or GNUmake
67"targets" one can invoke to build libraries and/or executables:
68
69<itemizedlist spacing="compact">
70  <listitem><para>
71    <literal>make</literal>
72    <para>
73    starts the compilation process for building a kernel library or a
74    library associated with an example. Kernel libraries are built with
75    maximum granularity, i.e. if a category is a compound, this command 
76    will build all the related sub-libraries,
77    <emphasis role="bold">not</emphasis> the compound one.
78    The top level <literal>GNUmakefile</literal> in
79    <literal>$G4INSTALL/source</literal> will also build in this case a
80    dependency map <literal>libname.map</literal> of each library to establish
81    the linking order automatically at the <literal>bin</literal> step. The map
82    will be placed in <literal>$G4LIB/$G4SYSTEM</literal>.
83    </para>
84  </para></listitem>
85  <listitem><para>
86    <literal>make global</literal>
87    <para>
88    starts the compilation process to build a single compound kernel
89    library per category. If issued after "make", both 'granular' and
90    'compound' libraries will be available (NOTE: this will
91    consistently increase the disk space required. Compound libraries
92    will then be selected by default at link time, unless
93    G4LIB_USE_GRANULAR is specified).
94    </para>
95  </para></listitem>
96  <listitem><para>
97    <literal>make bin</literal> or <literal>make</literal> (only for
98    examples/)
99    <para>
100    starts the compilation process to build an executable. This command
101    will build implicitly the library associated with the example and
102    link the final application. It assumes <emphasis role="bold">all</emphasis> 
103    kernel libraries are already generated and placed in the correct
104    <literal>$G4INSTALL</literal> path defined for them.
105    </para>
106
107    <para>
108    The linking order is controlled automatically in case libraries
109    have been built with maximum granularity, and the link list is
110    generated on the fly.
111    </para>
112  </para></listitem>
113  <listitem><para>
114    <literal>make dll</literal>
115    <para>
116    On Windows systems this will start the compilation process to build
117    single compound kernel library per category and generate Dynamic
118    Link Libraries (DLLs). Once the libraries are generated, the
119    process will imply also the deletion of all temporary files
120    generated during the compilation.
121    </para>
122  </para></listitem>
123</itemizedlist>
124</para>
125
126<!-- ******* Bridgehead ******* -->
127<bridgehead renderas='sect4'>
128<literal>lib/ bin/</literal> and <literal>tmp/</literal> directories
129</bridgehead>
130
131<para>
132The <literal>$G4INSTALL</literal> environment variable specifies where
133the installation of the Geant4 toolkit should take place, therefore
134kernel libraries will be placed in <literal>$G4INSTALL/lib</literal>. The
135<literal>$G4WORKDIR</literal> environment variable is set by the user and
136specifies the path to the user working directory; temporary files
137(object-files and data products of the installation process of
138Geant4) will be placed in <literal>$G4WORKDIR/tmp</literal>, according to
139the system architecture used. Binaries will be placed in
140<literal>$G4WORKDIR/bin</literal>, according to the system architecture
141used. The path to <literal>$G4WORKDIR/bin/$G4SYSTEM</literal> should be
142added to <literal>$PATH</literal> in the user environment.
143</para>
144
145</sect2>
146
147
148<!-- ******************* Section (Level#2) ****************** -->
149<sect2 id="sect.MkflEnvVar.EnvVar">
150<title>
151Environment variables
152</title>
153
154<para>
155Here is a list of the most important environment variables defined
156within the Geant4 <literal>GNUmake</literal> infrastructure, with a short
157explanation of their use.
158</para>
159
160<para>
161<emphasis role="bold">We recommend that those environment variables listed here and
162marked with (*) NOT be overriden or set (explicitly or by
163accident). They are already set and used internally in the default
164setup !</emphasis>
165</para>
166
167<!-- ******* Bridgehead ******* -->
168<bridgehead renderas='sect4'>
169System configuration
170</bridgehead>
171
172<para>
173<variablelist>
174  <varlistentry>
175    <term>
176      $CLHEP_BASE_DIR
177    </term>
178    <listitem>
179      Specifies the path where the CLHEP package is installed in your system.
180    </listitem>
181  </varlistentry>
182  <varlistentry>
183    <term>
184      $G4SYSTEM
185    </term>
186    <listitem>
187      <para> 
188      Defines the architecture and compiler currently used.
189      </para>
190      <para> 
191      <emphasis role="bold">NOTE</emphasis>: This variable is set automatically
192      if the <literal>Configure</literal> script is adopted for the
193      installation. This will result in the proper settings also for
194      configuring the environment with the generated shell scripts
195      <literal>env.[c]sh</literal>.
196      </para>
197    </listitem>
198  </varlistentry>
199</variablelist>
200</para>
201
202
203
204<!-- ******* Bridgehead ******* -->
205<bridgehead renderas='sect4'>
206Installation paths
207</bridgehead>
208
209<para>
210<variablelist>
211  <varlistentry>
212    <term>
213      $G4INSTALL
214    </term>
215    <listitem>
216      Defines the path where the Geant4 toolkit is located. It
217      should be set by the system installer. By default, it sets to
218      <literal>$HOME/geant4</literal>, assuming the Geant4 distribution
219      is placed in <literal>$HOME</literal>.
220    </listitem>
221  </varlistentry>
222  <varlistentry>
223    <term>
224      $G4BASE <emphasis role="bold">(*)</emphasis>
225    </term>
226    <listitem>
227      Defines the path to the source code. Internally used to define
228      <literal>$CPPFLAGS</literal> and <literal>$LDFLAGS</literal> for
229      -I and -L directives. It has to be set to
230      <literal>$G4INSTALL/src</literal>.
231    </listitem>
232  </varlistentry>
233  <varlistentry>
234    <term>
235      $G4WORKDIR
236    </term>
237    <listitem>
238      Defines the path for the user's workdir for Geant4. It is set by
239      default to <literal>$HOME/geant4</literal>, assuming the user's
240      working directory for Geant4 is placed in <literal>$HOME</literal>.
241    </listitem>
242  </varlistentry>
243  <varlistentry>
244    <term>
245      $G4INCLUDE
246    </term>
247    <listitem>
248      Defines the path where source header files may be mirrored at
249      installation by issuing <literal>gmake includes</literal> (default
250      is set to <literal>$G4INSTALL/include</literal>)
251    </listitem>
252  </varlistentry>
253  <varlistentry>
254    <term>
255      $G4BIN, $G4BINDIR <emphasis role="bold">(*)</emphasis>
256    </term>
257    <listitem>
258      Used by the system to specify the place where to store executables.
259      By default they're set to <literal>$G4WORKDIR/bin</literal> and
260      <literal>$G4BIN/$G4SYSTEM</literal> respectively. The path to
261      <literal>$G4WORKDIR/bin/$G4SYSTEM</literal> should be added to
262      <literal>$PATH</literal> in the user environment.
263      <literal>$G4BIN</literal> can be overridden.
264    </listitem>
265  </varlistentry>
266  <varlistentry>
267    <term>
268      $G4TMP, $G4TMPDIR <emphasis role="bold">(*)</emphasis>
269    </term>
270    <listitem>
271      Used by the system to specify the place where to store temporary
272      files products of the compilation/build of a user application or
273      test. By default they're set to <literal>$G4WORKDIR/tmp</literal> 
274      and <literal>$G4TMP/$G4SYSTEM</literal> respectively.
275      <literal>$G4TMP</literal> can be overridden.
276    </listitem>
277  </varlistentry>
278  <varlistentry>
279    <term>
280      $G4LIB, $G4LIBDIR <emphasis role="bold">(*)</emphasis>
281    </term>
282    <listitem>
283      Used by the system to specify the place where to install libraries.
284      By default they're set to <literal>$G4INSTALL/lib</literal> and
285      <literal>$G4LIB/$G4SYSTEM</literal> respectively.
286      <literal>$G4LIB</literal> can be overridden.
287    </listitem>
288  </varlistentry>
289</variablelist>
290</para>
291
292<!-- ******* Bridgehead ******* -->
293<bridgehead renderas='sect4'>
294Build specific
295</bridgehead>
296
297<para>
298<variablelist>
299  <varlistentry>
300    <term>
301      $G4TARGET
302    </term>
303    <listitem>
304      Specifies the target (name of the source file defining the main())
305      of the application/example to be built. This variable is set
306      automatically for the examples and tests placed in
307      <literal>$G4INSTALL/examples</literal>.
308    </listitem>
309  </varlistentry>
310  <varlistentry>
311    <term>
312      $G4DEBUG
313    </term>
314    <listitem>
315      Specifies to compile the code (libraries or examples) including
316      symbolic information in the object code for debugging. The size of
317      the generated object code can increase considerably. By default,
318      code is compiled in optimised mode (<literal>$G4OPTIMISE</literal> set).
319    </listitem>
320  </varlistentry>
321  <varlistentry>
322    <term>
323      $G4OPTDEBUG
324    </term>
325    <listitem>
326      Only available for the <literal>g++</literal> compiler, specifies to
327      compile the code (libraries or examples) in optimised mode, but
328      including symbolic information in the object code for debugging.
329    </listitem>
330  </varlistentry>
331  <varlistentry>
332    <term>
333      $G4NO_OPTIMISE
334    </term>
335    <listitem>
336      Specifies to compile the code (libraries or examples) without
337      compiler optimisation.
338    </listitem>
339  </varlistentry>
340  <varlistentry>
341    <term>
342      $G4PROFILE
343    </term>
344    <listitem>
345      On <literal>Linux</literal> systems with the <literal>g++</literal>
346      compiler, it allows to build libraries with profiling setup for
347      monitoring with the <literal>gprof</literal> tool.
348    </listitem>
349  </varlistentry>
350  <varlistentry>
351    <term>
352      $G4_NO_VERBOSE
353    </term>
354    <listitem>
355      Geant4 code is compiled by default in high verbosity mode
356      (<literal>$G4VERBOSE</literal> flag set). For better performance,
357      verbosity code can be left out by defining <literal>$G4_NO_VERBOSE</literal>.
358    </listitem>
359  </varlistentry>
360  <varlistentry>
361    <term>
362      $G4LIB_BUILD_SHARED
363    </term>
364    <listitem>
365      Flag specifying if to build kernel libraries as shared libraries
366      (libraries will be then used by default). If not set, static
367      archive libraries are built by default.
368    </listitem>
369  </varlistentry>
370  <varlistentry>
371    <term>
372      $G4LIB_BUILD_STATIC
373    </term>
374    <listitem>
375      Flag specifying if to build kernel libraries as static archive
376      libraries in addition to shared libraries (in case
377      <literal>$G4LIB_BUILD_SHARED</literal> is set as well).
378    </listitem>
379  </varlistentry>
380  <varlistentry>
381    <term>
382      $G4LIB_BUILD_DLL <emphasis role="bold">(*)</emphasis>
383    </term>
384    <listitem>
385      Internal flag for specifying to build DLL kernel libraries for
386      Windows systems. The flag is automatically set when requested to
387      build DLLs.
388    </listitem>
389  </varlistentry>
390  <varlistentry>
391    <term>
392      $G4LIB_USE_DLL
393    </term>
394    <listitem>
395      For Windows systems only. Flag to specify to build an application
396      using the installed DLL kernel libraries for Windows systems. It is
397      required to have this flag set in the environment in order to
398      successfully build an application if the DLL libraries have been
399      installed.
400    </listitem>
401  </varlistentry>
402  <varlistentry>
403    <term>
404      $G4LIB_USE_GRANULAR
405    </term>
406    <listitem>
407      To force usage of "granular" libraries against "compound" libraries
408      at link time in case both have been installed. The Geant4 building
409      system chooses "compound" libraries by default, if installed.
410    </listitem>
411  </varlistentry>
412  <varlistentry>
413    <term>
414     
415    </term>
416    <listitem>
417     
418    </listitem>
419  </varlistentry>
420</variablelist>
421</para>
422
423<!-- ******* Bridgehead ******* -->
424<bridgehead renderas='sect4'>
425UI specific
426</bridgehead>
427
428<para>
429The most relevant flags for User Interface drivers are just
430listed here. A more detailed description is given also in section
4312. of this User's Guide.
432</para>
433
434<para>
435<variablelist>
436  <varlistentry>
437    <term>
438      G4UI_USE_TERMINAL
439    </term>
440    <listitem>
441      Specifies to use dumb terminal interface in the application to be
442      built (default).
443    </listitem>
444  </varlistentry>
445  <varlistentry>
446    <term>
447      G4UI_USE_TCSH
448    </term>
449    <listitem>
450      Specifies to use the tcsh-shell like interface in the application
451      to be built.
452    </listitem>
453  </varlistentry>
454  <varlistentry>
455    <term>
456      G4UI_BUILD_XM_SESSION
457    </term>
458    <listitem>
459      Specifies to include in kernel library the <emphasis>XM</emphasis>.
460    </listitem>
461  </varlistentry>
462  <varlistentry>
463    <term>
464      G4UI_USE_XM
465    </term>
466    <listitem>
467      Specifies to use the <emphasis>XM</emphasis> 
468      interfaces in the application to be built.
469    </listitem>
470  </varlistentry>
471  <varlistentry>
472    <term>
473      G4UI_BUILD_WIN32_SESSION
474    </term>
475    <listitem>
476      Specifies to include in kernel library the WIN32 terminal interface
477      for Windows systems.
478    </listitem>
479  </varlistentry>
480  <varlistentry>
481    <term>
482      G4UI_USE_WIN32
483    </term>
484    <listitem>
485      Specifies to use the WIN32 interfaces in the application to be
486      built on Windows systems.
487    </listitem>
488  </varlistentry>
489  <varlistentry>
490    <term>
491      G4UI_BUILD_QT_SESSION
492    </term>
493    <listitem>
494      Specifies to include in kernel library the Qt terminal interface.
495      <literal>$QTHOME</literal> should specify the path where Qt libraries
496      and headers are installed
497    </listitem>
498  </varlistentry>
499  <varlistentry>
500    <term>
501      G4UI_USE_QT
502    </term>
503    <listitem>
504      Specifies to use the Qt interfaces in the application to be
505      built.
506    </listitem>
507  </varlistentry>
508  <varlistentry>
509    <term>
510      G4UI_NONE
511    </term>
512    <listitem>
513      If set, no UI sessions nor any UI libraries are built. This can be
514      useful when running a pure batch job or in a user framework having
515      its own UI system.
516    </listitem>
517  </varlistentry>
518</variablelist>
519</para>
520
521<!-- ******* Bridgehead ******* -->
522<bridgehead renderas='sect4'>
523Visualization specific
524</bridgehead>
525
526<para>
527The most relevant flags for visualization graphics drivers are
528just listed here. A description of these variables is given also in
529section 2. of this User's Guide.
530</para>
531
532<para>
533<variablelist>
534  <varlistentry>
535    <term>
536      $G4VIS_BUILD_OPENGLX_DRIVER
537    </term>
538    <listitem>
539      Specifies to build kernel library for visualization including the
540      OpenGL driver with X11 extension. It requires <literal>$OGLHOME</literal> 
541      set (path to OpenGL installation).
542    </listitem>
543  </varlistentry>
544  <varlistentry>
545    <term>
546      $G4VIS_USE_OPENGLX
547    </term>
548    <listitem>
549      Specifies to use OpenGL graphics with X11 extension in the
550      application to be built.
551    </listitem>
552  </varlistentry>
553  <varlistentry>
554    <term>
555      $G4VIS_BUILD_OPENGLXM_DRIVER
556    </term>
557    <listitem>
558      Specifies to build kernel library for visualization including the
559      OpenGL driver with XM extension. It requires <literal>$OGLHOME</literal> 
560      set (path to OpenGL installation).
561    </listitem>
562  </varlistentry>
563  <varlistentry>
564    <term>
565      $G4VIS_USE_OPENGLXM
566    </term>
567    <listitem>
568      Specifies to use OpenGL graphics with XM extension in the
569      application to be built.
570    </listitem>
571  </varlistentry>
572  <varlistentry>
573    <term>
574      G4VIS_BUILD_OPENGLQT_DRIVER
575    </term>
576    <listitem>
577      Specifies to build kernel library for visualization including the
578      OpenGL driver with Qt extension. It requires <literal>$QTHOME</literal>
579      set to specify the path where Qt libraries and headers are installed.
580    </listitem>
581  </varlistentry>
582  <varlistentry>
583    <term>
584      G4VIS_USE_OPENGLQT
585    </term>
586    <listitem>
587      Specifies to use OpenGL graphics with Qt extension in the
588      application to be built.
589    </listitem>
590  </varlistentry>
591  <varlistentry>
592    <term>
593      $G4VIS_BUILD_OI_DRIVER
594    </term>
595    <listitem>
596      Specifies to build kernel library for visualization including the
597      OpenInventor driver. It requires <literal>$OIHOME</literal> set
598      (paths to the <literal>OpenInventor</literal> installation).
599    </listitem>
600  </varlistentry>
601  <varlistentry>
602    <term>
603      $G4VIS_USE_OI
604    </term>
605    <listitem>
606      Specifies to use OpenInventor graphics in the application to be
607      built.
608    </listitem>
609  </varlistentry>
610  <varlistentry>
611    <term>
612      $G4VIS_BUILD_OIX_DRIVER
613    </term>
614    <listitem>
615      Specifies to build the driver for the free X11 version of
616      OpenInventor.
617    </listitem>
618  </varlistentry>
619  <varlistentry>
620    <term>
621      $G4VIS_USE_OIX
622    </term>
623    <listitem>
624      Specifies to use the free X11 version of OpenInventor.
625    </listitem>
626  </varlistentry>
627  <varlistentry>
628    <term>
629      $G4VIS_BUILD_RAYTRACERX_DRIVER
630    </term>
631    <listitem>
632      Specifies to build kernel library for visualization including the
633      Ray-Tracer driver with X11 extension. It requires <literal>X11</literal>
634      installed in the system.
635    </listitem>
636  </varlistentry>
637  <varlistentry>
638    <term>
639      $G4VIS_USE_RAYTRACERX
640    </term>
641    <listitem>
642      Specifies to use the X11 version of the Ray-Tracer driver.
643    </listitem>
644  </varlistentry>
645  <varlistentry>
646    <term>
647      $G4VIS_BUILD_OIWIN32_DRIVER
648    </term>
649    <listitem>
650      Specifies to build the driver for the free X11 version of
651      OpenInventor on Windows systems.
652    </listitem>
653  </varlistentry>
654  <varlistentry>
655    <term>
656      $G4VIS_USE_OIWIN32
657    </term>
658    <listitem>
659      Specifies to use the free X11 version of OpenInventor on Windows
660      systems.
661    </listitem>
662  </varlistentry>
663  <varlistentry>
664    <term>
665      $G4VIS_BUILD_DAWN_DRIVER
666    </term>
667    <listitem>
668      Specifies to build kernel library for visualization including the
669      driver for DAWN.
670    </listitem>
671  </varlistentry>
672  <varlistentry>
673    <term>
674      $G4VIS_USE_DAWN
675    </term>
676    <listitem>
677      Specifies to use DAWN as a possible graphics renderer in the
678      application to be built.
679    </listitem>
680  </varlistentry>
681  <varlistentry>
682    <term>
683      $G4DAWN_HOST_NAME
684    </term>
685    <listitem>
686      To specify the hostname for use with the DAWN-network driver.
687    </listitem>
688  </varlistentry>
689  <varlistentry>
690    <term>
691      $G4VIS_NONE
692    </term>
693    <listitem>
694      If specified, no visualization drivers will be built or used.
695    </listitem>
696  </varlistentry>
697</variablelist>
698</para>
699
700<!-- ******* Bridgehead ******* -->
701<bridgehead renderas='sect4'>
702Hadronic physics specific
703</bridgehead>
704
705<para>
706<variablelist>
707  <varlistentry>
708    <term>
709      $G4NEUTRONHP_USE_ONLY_PHOTONEVAPORATION
710    </term>
711    <listitem>
712      When using high precision neutron code, user may choose to force the
713      use of Photon Evaporation model instead of using the neutron capture
714      final state data.
715    </listitem>
716  </varlistentry>
717  <varlistentry>
718    <term>
719      $G4NEUTRONHP_SKIP_MISSING_ISOTOPES
720    </term>
721    <listitem>
722      User can force high precison neutron code to use only exact isotope
723      data files instead of allowing nearby isotope files to be used. If the
724      exact file is not available, the cross section will be set to zero and a
725      warning message will be printed.
726    </listitem>
727  </varlistentry>
728  <varlistentry>
729    <term>
730      $G4NEUTRONHP_NEGLECT_DOPPLER
731    </term>
732    <listitem>
733      Sets neglecting doppler broadening mode for boosting performance.
734    </listitem>
735  </varlistentry>
736</variablelist>
737</para>
738
739<!-- ******* Bridgehead ******* -->
740<bridgehead renderas='sect4'>
741<literal>GDML</literal>, <literal>zlib</literal> and <literal>g3tog4</literal> modules
742</bridgehead>
743
744<para>
745<variablelist>
746  <varlistentry>
747    <term>
748      $G4LIB_BUILD_GDML
749    </term>
750    <listitem>
751      If set, triggers compilation of a plugin module <literal>gdml</literal> 
752      for allowing import/export of detector description setups (geometrical
753      volumes, solids, materials, etc.). By default, the flag is not set; if
754      set, the path to the installation of XercesC package must be specified
755      through the variable <literal>$XERCESCROOT</literal>.
756    </listitem>
757  </varlistentry>
758  <varlistentry>
759    <term>
760      $G4LIB_USE_GDML
761    </term>
762    <listitem>
763      Specifies to use the <literal>gdml</literal> module. The flag is
764      automatically set if <literal>$G4LIB_BUILD_GDML</literal> is set in the environment.
765    </listitem>
766  </varlistentry>
767  <varlistentry>
768    <term>
769      $G4LIB_BUILD_ZLIB
770    </term>
771    <listitem>
772      If set, triggers compilation of a specific <literal>zlib</literal> 
773      module for the compression of output files (mainly in use currently
774      for the HepRep graphics driver). By default, the flag is not set and
775      the built-in system library for compression is adopted instead. Setting
776      this flag will also implicitely set the flag below.
777      On Windows systems, if OpenGL or OpenInventor visualization drivers
778      are built, this module is automatically built.
779    </listitem>
780  </varlistentry>
781  <varlistentry>
782    <term>
783      $G4LIB_USE_ZLIB
784    </term>
785    <listitem>
786      Specifies to use the <literal>zlib</literal> module, either system
787      built-in or Geant4 specific.
788    </listitem>
789  </varlistentry>
790  <varlistentry>
791    <term>
792      $G4LIB_BUILD_G3TOG4
793    </term>
794    <listitem>
795      If set, triggers compilation of the <literal>g3tog4</literal> module for
796      conversions of simple legacy geometries descriptions to Geant4. By
797      default, the flag is not set and the module's library is not built.
798      Setting this flag will also implicitely set the flag below.
799    </listitem>
800  </varlistentry>
801  <varlistentry>
802    <term>
803      $G4LIB_USE_G3TOG4
804    </term>
805    <listitem>
806      Specifies to use the <literal>g3tog4</literal> module, assuming the related
807      library has been already installed.
808    </listitem>
809  </varlistentry>
810</variablelist>
811</para>
812
813<!-- ******* Bridgehead ******* -->
814<bridgehead renderas='sect4'>
815Analysis specific
816</bridgehead>
817
818<para>
819<variablelist>
820  <varlistentry>
821    <term>
822      $G4ANALYSIS_USE
823    </term>
824    <listitem>
825      Specifies to activate the appropriate environment for analysis, if
826      an application includes code for histogramming based on
827      <emphasis>AIDA</emphasis>. Additional setup variables are required
828      (<literal>$G4ANALYSIS_AIDA_CONFIG_CFLAGS</literal>,
829      <literal>$G4ANALYSIS_AIDA_CONFIG_LIBS</literal>) to define config options
830      for AIDA ("<literal>aida-config --cflags</literal>" and
831      "<literal>aida-config --libs</literal>"). See installation instructions
832      of the specific analysis tools for details.
833    </listitem>
834  </varlistentry>
835</variablelist>
836</para>
837
838<!-- ******* Bridgehead ******* -->
839<bridgehead renderas='sect4'>
840Directory paths to Physics Data
841</bridgehead>
842
843<para>
844<variablelist>
845  <varlistentry>
846    <term>
847      $G4NEUTRONHPDATA
848    </term>
849    <listitem>
850      Path to external data set for Neutron Scattering processes.
851    </listitem>
852  </varlistentry>
853  <varlistentry>
854    <term>
855      $G4LEDATA
856    </term>
857    <listitem>
858      Path to external data set for low energy electromagnetic
859      processes.
860    </listitem>
861  </varlistentry>
862  <varlistentry>
863    <term>
864      $G4LEVELGAMMADATA
865    </term>
866    <listitem>
867      Path to the data set for Photon Evaporation.
868    </listitem>
869  </varlistentry>
870  <varlistentry>
871    <term>
872      $G4RADIOACTIVEDATA
873    </term>
874    <listitem>
875      Path to the data set for Radiative Decay processes.
876    </listitem>
877  </varlistentry>
878  <varlistentry>
879    <term>
880      $G4ABLADATA
881    </term>
882    <listitem>
883      Path to nuclear shell effects data set for INCL/ABLA hadronic model.
884    </listitem>
885  </varlistentry>
886  <varlistentry>
887    <term>
888      $G4REALSURFACEDATA
889    </term>
890    <listitem>
891      Path to the data set for measured optical surface reflectance for
892      precise optical physics.
893    </listitem>
894  </varlistentry>
895  <varlistentry>
896    <term>
897      $G4REALSURFACEDATA
898    </term>
899    <listitem>
900      Path to the Look-Up-Tables for the LUT model of optical photon
901      boundary reflection.
902    </listitem>
903  </varlistentry>
904</variablelist>
905</para>
906
907
908</sect2>
909
910
911<!-- ******************* Section (Level#2) ****************** -->
912<sect2 id="sect.MkflEnvVar.LnkExtLib">
913<title>
914Linking External Libraries with Geant4
915</title>
916
917<para>
918The Geant4 GNUmake infrastructure allows to extend the link list of
919libraries with external (or user defined) packages which may be
920required for some user's applications to generate the final
921executable.
922</para>
923
924<!-- ******************* Section (Level#3) ****************** -->
925<sect3 id="sect.MkflEnvVar.LnkExtLib.AddExtlibNoG4">
926<title>
927Adding external libraries which do *not* use Geant4
928</title>
929
930<para>
931In the <literal>GNUmakefile</literal> of your application, before including
932<literal>binmake.gmk</literal>, specify the extra library in
933<literal>EXTRALIBS</literal> either using the <literal>-L...-l...</literal> 
934syntax or by specifying the full pathname, e.g.:
935
936<informalexample>
937<programlisting>
938  EXTRALIBS := -L&lt;your-path&gt;/lib -l&lt;myExtraLib&gt;
939</programlisting>
940</informalexample>
941or
942<informalexample>
943<programlisting>
944  EXTRALIBS := &lt;your-path&gt;/lib/lib&lt;myExtraLib&gt;.a
945</programlisting>
946</informalexample>
947</para>
948
949<para>
950You may also specify <literal>EXTRA_LINK_DEPENDENCIES</literal>, which is
951added to the dependency of the target executable, and you may also
952specify a rule for making it, e.g.:
953
954<informalexample>
955<programlisting>
956  EXTRA_LINK_DEPENDENCIES := &lt;your-path&gt;/lib/lib&lt;myExtraLib&gt;.a
957
958  &lt;your-path&gt;/lib/lib&lt;myExtraLib&gt;.a:
959        cd &lt;your-path&gt;/lib; $(MAKE)
960</programlisting>
961</informalexample>
962</para>
963
964<para>
965Note that you almost certainly need to augment <literal>CPPFLAGS</literal>
966for the header files of the external library, e.g.:
967
968<informalexample>
969<programlisting>
970  CPPFLAGS+=-I&lt;your-path&gt;/include
971</programlisting>
972</informalexample>
973
974See <xref linkend="programlist_MkflEnvVar_1" />.
975</para>
976
977<para>
978<example id="programlist_MkflEnvVar_1">
979<title>
980An example of a customised GNUmakefile for an application or
981example using an external module not bound to Geant4.
982</title>
983
984<programlisting>
985 # --------------------------------------------------------------------
986 # GNUmakefile for the application "sim" depending on module "Xplotter"
987 # --------------------------------------------------------------------
988
989 name := sim
990 G4TARGET := $(name)
991 G4EXLIB := true
992
993 CPPFLAGS  += -I$(HOME)/Xplotter/include
994 EXTRALIBS += -L$(HOME)/Xplotter/lib -lXplotter
995 EXTRA_LINK_DEPENDENCIES := $(HOME)/Xplotter/lib/libXplotter.a
996
997 .PHONY: all
998
999 all: lib bin
1000
1001 include $(G4INSTALL)/config/binmake.gmk
1002
1003 $(HOME)/Xplotter/lib/libXplotter.a:
1004         cd $(HOME)/Xplotter; $(MAKE)
1005</programlisting>
1006</example>
1007</para>
1008
1009</sect3>
1010
1011
1012<!-- ******************* Section (Level#3) ****************** -->
1013<sect3 id="sect.MkflEnvVar.LnkExtLib.AddExtlibWithG4">
1014<title>
1015Adding external libraries which use Geant4
1016</title>
1017
1018<para>
1019In addition to the above, specify, in <literal>EXTRALIBSSOURCEDIRS</literal>,
1020a list of directories containing source files in its <literal>src/</literal>
1021subdirectory. Thus, your <literal>GNUmakefile</literal> might contain:
1022
1023<informalexample>
1024<programlisting>
1025  EXTRALIBS += $(G4WORKDIR)/tmp/$(G4SYSTEM)/&lt;myApp&gt;/lib&lt;myApp&gt;.a \
1026               -L&lt;your-path&gt;/lib -l&lt;myExtraLib&gt;
1027  EXTRALIBSSOURCEDIRS += &lt;your-path&gt;/&lt;myApp&gt; &lt;your-path&gt;/&lt;MyExtraModule&gt;
1028  EXTRA_LINK_DEPENDENCIES := $(G4WORKDIR)/tmp/$(G4SYSTEM)/&lt;myApp&gt;/lib&lt;myApp&gt;.a
1029
1030  MYSOURCES := $(wildcard &lt;your-path&gt;/&lt;myApp&gt;/src/*cc)
1031  $(G4WORKDIR)/tmp/$(G4SYSTEM)/&lt;myApp&gt;/lib&lt;myApp&gt;.a: $(MYSOURCES)
1032        cd &lt;your-path&gt;/&lt;myApp&gt;; $(MAKE)
1033</programlisting>
1034</informalexample>
1035</para>
1036
1037<para>
1038See <xref linkend="programlist_MkflEnvVar_2" />.
1039</para>
1040
1041<para>
1042<example id="programlist_MkflEnvVar_2">
1043<title>
1044An example of a customised GNUmakefile for an
1045application or example using external modules bound to Geant4.
1046</title>
1047
1048<programlisting>
1049# -----------------------------------------------------------------
1050# GNUmakefile for the application "phys" depending on module "reco"
1051# -----------------------------------------------------------------
1052
1053name := phys
1054G4TARGET := $(name)
1055G4EXLIB := true
1056
1057EXTRALIBS += $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)/libphys.a \
1058             -L$(HOME)/reco/lib -lreco
1059EXTRALIBSSOURCEDIRS += $(HOME)/phys $(HOME)/reco
1060EXTRA_LINK_DEPENDENCIES := $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)/libphys.a
1061
1062.PHONY: all
1063all: lib bin
1064
1065include $(G4INSTALL)/config/binmake.gmk
1066
1067MYSOURCES := $(wildcard $(HOME)/phys/src/*cc)
1068$(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)/libphys.a: $(MYSOURCES)
1069        cd $(HOME)/phys; $(MAKE)
1070</programlisting>
1071</example>
1072</para>
1073
1074</sect3>
1075
1076</sect2>
1077</sect1>
Note: See TracBrowser for help on using the repository browser.