
\chapter{Technical Information}
\label{Chapter Technical Information}

\section{System Requirements}

The AGD--Library is based on LEDA version 3.7 or higher, so you
must have installed
LEDA on your system, before you can install the AGD--Library.
More information about LEDA are available at the LEDA homepage
\begin{center}
http://www.mpi-sb.mpg.de/LEDA/leda.html
\end{center}

The AGD--Library also provides some optimal branch-and-cut
algorithms in a separate library {\tt libAGDopt}. Creating
and using this library requires that ABACUS~\cite{JT97} (version 2.1)
is installed on your system.

Table~\ref{platforms} shows, for which platforms the AGD--Library is
available.

\begin{table}[hb]
\centerline{
\begin{tabular}{|l|l|l|}\hline
{\bf machine} & {\bf operating system} & {\bf compiler} \\\hline\hline
SUN Sparc   & SunOS   & SunPRO CC, g{\tt++} \\\hline
SUN Sparc   & Solaris & SunPRO CC, g{\tt++} \\\hline
Intel 80x86 & Linux   & g{\tt ++} \\\hline
Intel 80x86 & Windows 95, & Borland 5.x, \\
 & Windows NT & Microsoft Visual C{\tt++} 4.2, 5.0\\\hline
\end{tabular}}
\caption{Available platforms}
\label{platforms}
\end{table}


\section{Installation}

The AGD--Library is available at the AGD homepage
\begin{center}
http://www.mpi-sb.mpg.de/\symbol{126}mutzel/dfgdraw/agdlib.html
\end{center}
It comes as a source code package in a file
{\tt AGD-0.8.3.tar.gz}. Place this file into a directory for
which you have write permission and type
\begin{center}
\tt gunzip AGD-0.8.3.tar.gz
\end{center}
and 
\begin{center}
\tt tar xf AGD-0.8.3.tar
\end{center}

This will create a directory {\tt AGD-0.8.1}. In the sequel, we will refer
with {\it AGDROOT} to the path name of this directory.

\begin{itemize}
\item {\bf Installation on a UNIX platform}
\begin{enumerate}
\item
Type: {\tt cd \it AGDROOT}

\item
Type: {\tt lconfig <{\it cc}>}\\[1ex]
where {\tt <}{\it cc}{\tt >} is the name (or command) of your \CC compiler.

Examples: {\tt lconfig CC}, {\tt lconfig g++}\\[1ex]
{\tt lconfig} without arguments prints a list of known compilers.

\item
If the LEDA header files and libraries are not in the standard path
of your compiler (e.g., the include, or lib directory of the
compiler), you must tell lconfig the corresponding path names.
Therefore, lconfig will ask you at the end of the configuration,
if you want to enter the path names of the include and library
directory of your LEDA installation. Type {\tt y} and follow
the instructions, if these directories are not in the standard path
of your compiler, otherwise type {\tt n}.

If you also want to create the library {\tt libAGDopt}, which
contains some optimal branch-and-cut algorithms, you must tell
{\tt lconfig} the path name of your ABACUS and CPLEX installations.
Then, type {\tt y} and follow the instructions, otherwise type
{\tt n}.

\item
Now just type: {\tt make}\\[1ex]
to create the library {\tt libAGD.a} in the directory {\it AGDROOT}
and the demo program {\tt agd\_demo} in the directory
{\it AGDROOT}/demo.

Type: {\tt make opt}\\[1ex]
to create the library {\tt libAGDopt.a} in the directory {\it AGDROOT}
and the demo program {\tt agd\_opt\_demo} in the directory
{\it AGDROOT}/demo. This requires an ABACUS and CPLEX installation on
your system.

\item
Now, you can copy the AGD subdirectory of {\it AGDROOT}/incl
to the standard include directory of your compiler. The library
libAGD.a should be copied (or moved) to the standard library
directory of your compiler (e.g., usr/lib or usr/local/lib).
\end{enumerate}

{\bf Remarks:}
\begin{itemize}
\item
You can also use the AGD--Library without copying the include and
library files to the default directories by using the {\tt -I} and
{\tt -L} option of your compiler. This is described in the following
section.

\item
The makefile in {\it AGDROOT} provides the following targets:

\begin{tabular}{ll}
{\it target} & {\it description}\\\hline
{\tt all} & creates {\tt libAGD.a}, {\tt agd\_demo} and the test program \\
{\tt all\_g} & as above, but with debugging informations \\
{\tt opt} & creates {\tt libAGDopt.a} and {\tt agd\_opt\_demo} \\[0.5ex]
{\tt libAGD} & creates {\tt libAGD.a} \\
{\tt libAGD\_g} & creates {\tt libAGD.a} with debugging informations \\[0.5ex]
{\tt agd\_demo} & creates the demo program {\tt agd\_demo} \\
{\tt agd\_demo\_g} & creates the demo program with debugging informations \\
{\tt agd\_opt\_demo} & creates the demo program {\tt agd\_opt\_demo} \\[0.5ex]
{\tt agd\_test} & creates the test program \\
{\tt agd\_test\_g} & creates the test program with debugging informations
\end{tabular}
\end{itemize}

\item {\bf Installation on Windows95 or Windows NT}
\begin{enumerate}
\item
Go to {\it AGDROOT}

\item
Type: {\tt lconfig <{\it cc}>}\\[1ex]
where {\tt <}{\it cc}{\tt >} is the name (or command) of your \CC compiler.\\[1ex]
Examples: {\tt lconfig bcc}, {\tt lconfig msc}\\[1ex]
{\tt lconfig} without arguments prints a list of known compilers.

\item
Now just type:\\[1ex]
{\tt make\_lib\\
make\_demo}\\[1ex]
to make the library {\tt libAGD.lib} in the directory {\it AGDROOT}
and the demo program {\tt agd\_demo.exe} in the directory
{\it AGDROOT}/demo.

\item
You should copy the AGD subdirectory of {\it AGDROOT}/incl
to the standard include directory, and the library
libAGD.lib to the standard library
directory of your compiler.
\end{enumerate}

\end{itemize}

\section{Compiling Programs}

In the following description, we assume that the library {\tt libAGD.a}
and the include directory {\tt AGD} are in the default directories
of the compiler.

AGD programs must be linked with the LEDA libraries {\tt libL.a},
{\tt libG.a}, {\tt libP.a} and {\tt libW.a} (if LEDA windows are
used).

If the include files and libraries of LEDA are also contained
in the default directories of the compiler, you just have to type\\
\begin{center}
{\tt CC {\it prog.c} -lAGD -lG -lL -lm}
\end{center}
or
\begin{center}
{\tt CC {\it prog.c} -lAGD -lW -lP -lG -lL -lX11 -lm}
\end{center}
if LEDA windows are used.

Note that the libraries must be given in the above order.

{\bf Remarks:}
\begin{itemize}
\item
LEDA and the AGD--Library provide a mechanism to check many (not all!)
preconditions of operations. This mechanism can be turned off by defining
{\tt LEDA\_CHECKING\_OFF}, e.g.,\\
\ \\
{\tt CC -DLEDA\_CHECKING\_OFF ...}\\
\ \\
It is a good idea to turn checking off only in the final release version
of a program, because the error messages that occur if a check fails are
a good hint for errors in the program.

\item
If using LEDA windows on solaris systems you might have to link with the socket 
and thread libraries as well:\\
\ \\
{\tt CC {\it prog.c} -lAGD -lW -lP -lG -lL -lX11 -lsocket -lthread -lm}

\item
If the libraries or include files are not in the default directories of
the compiler, you have to use the {\tt -I} and {\tt -L} compiler flags:\\
\ \\
{\tt CC -I{\it LEDAROOT}/incl -I{\it AGDROOT}/incl {\it prog.c}
-L{\it AGDROOT} -lAGD ...}

\end{itemize}


\section{Documentation {\rm (Unix platforms only)}}

We use slightly modified versions of the LEDA tools for manual production
to extract the AGD manual from the AGD header files (see also
\cite{LEDA-Manual}). The commands for
the manual production are contained in the directory {\it AGDROOT}/Manual/cmd.
It is necessary to set the environment variable {\tt AGDROOT}
to the directory, where the AGD--Library is installed (e.g.,
{\tt setenv AGDROOT \it AGDROOT}).

The command {\tt Aman} can be used similar to LEDA's {\tt Lman} to
display the manual contained in a specific header file. You should
add the directory {\it AGDROOT}/Manual/cmd to your {\tt PATH}
variable. Then, you can type\\
\ \\
{\tt Aman LayoutModule} \\
\ \\
to display the documentation of the class {\tt LayoutModule}.
