%------------------------------------------
% Copyright (C) 2001-2003, CompHEP Collaboration
%------------------------------------------
% $Id: compile.tex,v 1.1 2003/06/25 12:29:27 kryukov Exp $
%
% $Log: compile.tex,v $
% Revision 1.1  2003/06/25 12:29:27  kryukov
% New directory for manual
%
% Revision 1.2  2003/06/25 11:25:56  kryukov
% Update for 4.2 Installation section
%
%
%------------------------------------------
  In order to compile the \CompHEP~ source code you need a \C~ compiler
with the X11 graphics library. The compilation of the \CompHEP~ 
consists of from two steps: configureation and ccompilation of source codes.

To make firts step user have to launch the 
\vskip 0.2cm
{\tt     ./configure  }
\vskip 0.2cm

The second step is started by the make command
\vskip 0.2cm
{\tt     make  }
\vskip 0.2cm

\noindent
The commands should be started from the \CompHEP~ root directory.

If the configuration step is passed successfully  you will see the message:

\vskip 0.2cm
{\tt
\begin{verbatim}
=======================================
To compile CompHEP input make command
=======================================
\end{verbatim}
}

If the  sources are compiled successfully  you will see the message:

\vskip 0.2cm
{\tt
\begin{verbatim}
****************************************************************** 
*        CompHEP-4.2.0 has been successfully installed           *
*                                                                *
*  Please create a user working directory using the command      *
*         make setup WDIR=path_to_your_user_work_dir             *
*  NOTE: Do not use '~' to refer to home directory               *
*        Use environment variable HOME instead of                *
******************************************************************
\end{verbatim}
}
\vskip 0.2cm

Otherwise  the corresponding error message comes out.
See the next section for a discussion of possible problems.

  The files in the \CompHEP~ root directory will be
used only for reading and execution during the user session. 
It provides us with a possibility to have one \CompHEP~ root
directory for several users. 

Each user has to create his own directory to work with \CompHEP. 
See an instruction for the user installation  in the next section.


\subsubsection*{Possible problems} 
           
  The {\it /configure} command tests the Linux environment and
create the files contained the assembling parameters:
\begin{itemize}
\item CC \- available compiler
\item CLFAGS \- compilarion flags
\item CLIBS \- list of libraries
\end{itemize}

User can modify the content these files with respect to current UN*X 
environment. For example, user may add the specific path to ISAJET 
library that is necessary for MSSM models.

   The options listed below must be supported by \C~ compiler:
\begin{itemize}
\itemm     the  ANSI mode of function prototypes;
\itemm     the  signed  char type;
\itemm     an  access to the X11 include and library
            files.
\end{itemize}
\noindent
The contents of the {\it CFLAGS} file for Linux platform 
is presented below:
\begin{center}
{\tt -g -Wall -DNUM\_DOUBLE -DCOMPHEP}
\end{center}

Next example is the content of the {\it CLIBS}:
\begin{center}
{\tt -g -L/usr/X11R6/lib -L/cern/pro/lib -lisajet758 -lmathlib -lX11 -lm}
\end{center}

If all tests are passed on successfully the message appears:
\begin{center}
{\tt
\begin{verbatim}
======================================= 
To compile CompHEP input make command 
=======================================
\end{verbatim}
}
\end{center}

If your UN*X platform is another then RedHat you have to modily these files 
in proper way. 
For example, you could switch on an optimization flag. 

Please contact your System Administrator or Authors for futher consultations.

\subsubsection*{\C~ compiler tuning}
       
  There are few  {\it macro}   definitions in the \C~ code, which could
be useful to tune:

  The first one is {\it STRSIZ}. This is a maximum size of strings 
in the \CompHEP~ models.  
By default {\it STRSIZ=2048}. If you would like to embed in \CompHEP~
some new interaction with a very cumbersome vertex you have to 
increase this size by the

\vskip 0.2cm
{\tt  -DSTRSIZ=<new value>}
\vskip 0.2cm
\noindent
option.

  The second {\it macro} defines a type of integer numbers which are used in
symbolic calculations by \CompHEP. By default \CompHEP~ uses the 'long'
type.
\vskip 0.2cm
{\it -DNUM\_LONG\_LONG} forces the compiler to use  {\it 'long long'}. 
 This type is not the ANSI standard  and, perhaps, it is  not
 supported in your case. Different realizations of the {\it 'long~long'} type
use different formats for reading and writing such numbers. The user may 
specify  this format  defining the {\it 'NUM\_STR'}. By default \CompHEP~ uses

{\tt \#define  NUM\_STR "lld"}  

\vskip 0.2cm
{\it -DNUM\_DOUBLE} option forces \CompHEP~ to emulate integer numbers via
 {\it 'double'} float ones. 

The third {\it macro} defines do CERN libraries use or not. This macro is set 
by ./configure command when it can not find CERN libraries:
\vskip 0.2cm
{\tt  -DNO\_CERN\_LIB}
\vskip 0.2cm
\noindent
However, user can forced switch off the CERN library using to set this 
{\it macro} in CLAGS file.
