<!-- ******************************************************** -->
<!--                                                          -->
<!--  [History]                                               -->
<!--    1st version created:  Katsuya Amako, Dec-2006         -->
<!--                                                          -->
<!-- ******************************************************** -->


<!-- ********************* QandA Section ******************** -->
<section id="qanda.Installation">
<title>
Installation
</title>

<qandaset defaultlabel="qanda">


<!-- ******* QandA Entry ******** -->
<qandaentry id="qanda.Installation.UpkTar">

<question><para>
  When I download the source from the web, and unpack the tar file, 
  some files unpack into the top level directory.
</para></question>

<answer><para>
  The problem you describe usually is the result of using "UNIX" tar to 
  unpack the gtar ("GNU-tar") file, or vice versa, or using zip on either 
  the gtar or tar file. Please make certain that you download the correct 
  file for your system, and that you use the correct unpacking tool. 
  Note that for Linux you must download the gtar.gz file.
</para></answer>

</qandaentry>

<!-- ******* QandA Entry ******** -->
<qandaentry  id="qanda.Installation.NoCLHEP">

<question><para>
  I cannot find CLHEP files or library and I have it installed in my system.
</para></question>

<answer><para>
  If the standard CLHEP installation procedure has been adopted, the variable 
  <literal>CLHEP_BASE_DIR</literal> should point to the area where 
  <literal>include/</literal> and <literal>lib/</literal> directories for 
  CLHEP headers &amp; library are installed in your system. In case the library 
  file name is different than the one expected (<literal>libCLHEP.a</literal>), 
  you should either create a symbolic link with the expected name, or define 
  the variable <literal>CLHEP_LIB</literal> in your environment which 
  explicitly sets the name of the CLHEP library. If a non-standard CLHEP 
  installation has been adopted, define variables 
  <literal>CLHEP_INCLUDE_DIR</literal>, <literal>CLHEP_LIB_DIR</literal> 
  (and <literal>CLHEP_LIB</literal>) to refer explicitly to the place where 
  headers, library (and library-name) respectively are placed in your system.
  On Windows systems, the full library file name (with extension) should be 
  specified as <literal>CLHEP_LIB</literal>, while for UNIX-like systems, 
  just the name is required (i.e. <literal>CLHEP</literal> for 
  <literal>libCLHEP.a</literal>).
</para></answer>

</qandaentry>

<!-- ******* QandA Entry ******** -->
<qandaentry id="qanda.Installation.noCERNLib">

<question><para>
  While installing the Geant4 libraries I get the following message printed:

  <informalexample><programlisting>
         gmake[1]: cernlib: Command not found
  </programlisting></informalexample>

  Has Geant4 been installed properly ? What to do to solve this error ?
</para></question>

<answer><para>
  The message:
  <informalexample><programlisting>
         gmake[1]: cernlib: Command not found
  </programlisting></informalexample>

  shows that you don't have the 'cernlib' command installed in your system; 
  'cernlib' is a command from the CERN program library (cernlib) returning a 
  list of libraries needed to link a cernlib application. This command is only 
  used in the 'g3tog4' module, however, if you do not make use of the 'g3tog4' 
  tool, it's harmless. The cernlib script (and the needed cernlib libraries) 
  are available from: http://cern.ch/cernlib.
</para></answer>

</qandaentry>

<!-- ******* QandA Entry ******** -->
<qandaentry id="qanda.Installation.FileDepend">

<question><para>
  Trying building the Geant4 libraries I see several of these errors appearing 
  and my installation fails:
  <informalexample><programlisting>
         .....G4Exception.d:1: *** missing separator. Stop.
         ...../G4DalitzDecayChannel.d:1: *** missing separator. Stop.
           :
           :
  </programlisting></informalexample>
  Has Geant4 been installed properly ? What to do to solve this error ? 
</para></question>

<answer><para>
  It looks like some file dependencies (.d) are corrupted, possibly due 
  to previous build attempts which failed for some reason.
  You need to remove each of them. A quick recipe for doing this is to:
  <itemizedlist spacing="compact">
    <listitem><para>
      Configure the environment with the installation to be repaired
    </para></listitem>
    <listitem><para>
      Unset the G4WORKDIR environment variable (in case it is eventually set)
    </para></listitem>
    <listitem><para>
      Type:
      <informalexample><programlisting>
        gmake clean dependencies=''
      </programlisting></informalexample>

      from the affected module (i.e. for this case, from 
      $G4INSTALL/source/global/management and $G4INSTALL/source/particles/management)
       and rebuild. Alternatively, you may use:
      <informalexample><programlisting>
        gmake clean dependencies=''
      </programlisting></informalexample>

      from $G4INSTALL/source and rebuild.
    </para></listitem>
  </itemizedlist>
</para></answer>

</qandaentry>


</qandaset>
</section>
