\chapter{Installation of the ASCA\_ANL}
\label{sec:install}
You can install the ASCA\_ANL easily in a following way.
\begin{enumerate}
  \item Install FTOOLS, CERN libraries, etc.
  \item Get a copy of source files with ftp.
  \item Expand the sources on your computer system.
  \item Modify Makefile for your computer system.
  \item Make the ASCA\_ANL.
  \item Install the ASCA\_ANL.
  \item Install Test.
\end{enumerate}

\section{Install FTOOLS, CERN libraries, etc.}
You must install following packages before building ASCA\_ANL.\\
\begin{quote}
FTOOLS (includes FITSIO, CFITSIO)\\
	{\tt ftp://legacy.gsfc.nasa.gov/software/ftools/release/} \\

CERN libraries (includes hbook.h, cfortran.h)\\
	{\tt ftp://asis01.cern.ch/} \\

atFunctions\\
	{\tt ftp://ftp.astro.isas.ac.jp/astro-d/planning/program/} \\

COM + CLI [+ readline] (from DISPLAY45)\\
	{\tt ftp://ftp.astro.isas.ac.jp/pub/display/} (DISPLAY45) \\
	{\tt ftp://utsun.s.u-tokyo.ac.jp/ftpsync/prep/} (readline) \\

ascatool\\
	{\tt ftp://ftp.astro.isas.ac.jp/astro-d/planning/program/} \\
\end{quote}

\section{FTP}
The distribution kit of the ASCA\_ANL is placed on a site\footnote{
The site is not an anonymous ftp site.
Thus you are required to have your own account on the site.
}
which is announced with a release note.
The kit has a name like {\tt asca\_anl\_v\ANLversion .tar.gz}
which means ``ASCA\_ANL version \ANLversion''.
Transfer the kit to your computer system with ftp.

In the following part of this section,for simplicity,
we assume the version number of the ASCA\_ANL system as \ANLversion .

\section{Expand}
After you copy the kit to an appropriate directory on your computer system,
type
\begin{quote}
   {\tt \%  gzcat asca\_anl\_v\ANLversion .tar.gz | tar xvf $-$}
\end{quote}
A directory {\tt asca\_anl\_v\ANLversion /} are created
in the directory where you invoke the command.

The directory structure of below ``{\tt asca\_anl\_v\ANLversion /}''
are following:
\begin{tabbing}
mm\=mm\=**other directories**\=\kill
{\tt asca\_anl\_v\ANLversion/} \\
	\> {\tt src/}	 \>	\> $\cdots$ contains source files\\
	\> {\tt module/} \>	\> $\cdots$ contains modules\\
        \> {\tt include/}\>	\> $\cdots$ contains header files\\
	\> {\tt util/} 	 \>	\> $\cdots$ contains utilities\\
	\> {\tt tools/}  \>	\> $\cdots$ contains tools\\
	\> {\tt doc/} 	 \>	\> $\cdots$ contains documentations\\
	\> {\tt sample/} \>     \> $\cdots$ contains sample modules\\
\end{tabbing}

\section{Arrange Makefile}
Edit a file
\begin{quote}
   {\tt asca\_anl\_v\ANLversion/Includes.make}
\end{quote}
and change definitions of the following macro to specify a directory.\\
\begin{table}[htb]
\begin{center}
\begin{tabular}{ll}
\hline
   {\tt MACRO} & required contents in the directory\\
\hline
   {\tt ASCA\_ANL\_DIR}	& the ASCA\_ANL directory \\
   {\tt ASCA\_ANL\_INC}	& header files of the ASCA\_ANL \\
   {\tt ASCA\_ANL\_LIB}	& libraries of the ASCA\_ANL \\
   {\tt ASCA\_ANL\_BIN}	& executables for the ASCA\_ANL \\
   {\tt ASCA\_ANL\_LNK} & link option for the ASCA\_ANL \\
   {\tt ASCATOOL\_DIR}	& ascatool directory \\
   {\tt ASCATOOL\_INC}	& header files for ascatool \\
	& {\tt ascatool.h}, etc. \\
   {\tt ASCATOOL\_LNK}  & link option for ascatool\\
	& {\tt libascatool.a} \\
   {\tt COM\_CLI\_LNK}  & link option for CLI/COM \\
	& {\tt libCOM.a}, {\tt libCLI.a}, {\tt libreadline.a} \\
   {\tt ATFUNCTIONS\_INC}& header files for atFunctions \\
	& {\tt atFunctions.h} and {\tt atError.h} \\
   {\tt ATFUNCTIONS\_LNK} & link option for the atFunctions \\
	& {\tt libatFunctions.a} \\
   {\tt CERN\_DIR}	& CERN directory \\
   {\tt CERN\_INC}	& header files for CERN library \\
	& {\tt cfortran.h} and {\tt hbook.h} \\
   {\tt CERN\_LNK}      & link option for CERN library \\
	& {\tt libgraflib.a}, {\tt libgrafX11.a}, {\tt libpacklib.a}, \\
	& {\tt libkernlib.a}, {\tt libmathlib.a}, {\tt libX11.a} \\
   {\tt FITSIO\_LNK}    & link option for FITSIO \\
	& {\tt libfitsio.a} \\
   {\tt CC}             & default C compiler \\
   {\tt FC}             & default FORTRAN compiler \\
   {\tt DEFAULT\_F77\_LNK} & default FORTRAN library \\
\hline
\end{tabular}
\caption{Macros in {\tt Include.make}}
\label{tab:macros}
\end{center}
\end{table}

\section{Make}
In order to ``make'' the ASCA\_ANL,
just type
\begin{quote}
   {\tt \%  make}
\end{quote}
in a directory {\tt asca\_anl\_v\ANLversion /}.
It takes about 2 minutes to compile whole package on DEC 3000/600S AXP.

\section{Install}
Create install directories where you wrote in ``{\tt Includes.make}''
({\tt ASCA\_ANL\_INC}, {\tt ASCA\_ANL\_LIB}, {\tt ASCA\_ANL\_BIN}), and
type `{\tt make install}'.

After installing ASCA\_ANL package, you can erase object files and libraries
by typing `{\tt make clean}'.
  
\section{Install Test}
You are recommended to check your installation of ASCA\_ANL.\\
Type as follows:\\
\begin{quote}
	{\tt \% cd sample} \\
	{\tt \% make} \\
	{\tt \% make test} \\
\end{quote}
If something is wrong, `{\tt make}' or `{\tt make test}'
complains error messages.
Read those messages and check ``Includes.make'' again.
After test, you shuld clean sample directories for ASCA\_ANL users,
typing `{\tt make clean}' in ``{\tt ./sample/}'' directory.
