\chapter{Technical Information} 
\label{TechnicalInformation}

\section{Installation} 
\label{Installation}

As mentioned before, you can either get the source code package or 
the object code package.  Both have to be unpacked as follows.
Suppose the downloaded file is LEDA-3.5.tgz. Place it into 
a directory for which you have write permission and type
\begin{center}
gunzip LEDA-3.5.tgz
\end{center}
and 
\begin{center}
tar xvf LEDA-3.5.tar
\end{center}

\noindent
If you have the source code of LEDA just continue reading, otherwise go 
to section \ref{ObjectCodePackage}

\subsection{Source Code Package} \label{SourceCodePackage}

The source code package is only distributed for unix installation (see section
\ref{Platforms} for details).
In this subsection we use {\em LEDAROOT} to denote the path name of the LEDA main 
directory (in the source code package the name usually consists of the prefix
{\em LEDA} followed by the version number, for instance {\em LEDA-35}).
It should contain the following files and subdirectories: 

\begin{center}
\begin{tabular}{ll}
README                   & information about LEDA\\
INSTALL                  & this file\\
CHANGES  (please read !) & most recent changes\\
FIXES                    & bug fixes since last release\\
Manual/                  & user manual\\
Makefile                 & make script\\
confdir/                 & configuration directory\\
lconfig                  & configuration command\\
incl/                    & include directory\\
src/                     & source files\\
test/                    & example and test programs\\
demo/                    & demo programs
\end{tabular}
\end{center}

\subsubsection{Configuration}

\begin{enumerate}

\item
Go to {\em LEDAROOT}

\item
Type: lconfig {\tt <}cc{\tt >}  [static | shared]\\
\ \\
where {\tt <}cc{\tt >} is the name (or command) of your \CC compiler
and the optional second parameter defines the kind of libraries
to be generated. Note that in the current release shared
libraries can be made only under SunOS 5.x (Solaris)  with
SunPro \CC and g{\tt ++} and under LINUX with g{\tt ++}.\\ 
\ \\
Examples: lconfig CC, lconfig g{\tt ++}, lconfig sunpro shared\\
\ \\
lconfig without arguments prints a list of known compilers.\\
If your compiler is not in the list you might have to
edit the {\tt <}LEDA/system.h{\tt >} header file.

\item
LEDA contains an experimental mechanism for avoiding name conflicts with other 
libraries. It is possible to redefine LEDA type names using the prefix {\em leda\_}. 
If you decide to use this feature you must uncomment the corresponding lines in two 
special header files {\tt <}LEDA/REDEFINE\_NAMES.H{\tt >} and 
{\tt <}LEDA/UNDEFINE\_NAMES.h{\tt >} BEFORE compiling the libraries (see below). 
Note that both files have to be CONSISTENT, in the sense that all type names 
redefined in REDEFINE\_NAMES.H have to be undefined in UNDEFINE\_NAMES.h.

\end{enumerate}
       
\subsubsection{Compilation}

Now just type\\ 

\begin{center}
{\em make}
\end{center}

\noindent
to make the following libraries (cf. section \ref{Libraries}):\\

\begin{center}
\begin{tabular}{ll}
libL.a   (libL.so)  & main  library\\
libG.a   (libG.so)  & graph library\\
libP.a   (libP.so)  & plane library\\
libW.a   (libW.so)  & window library\\  
libD3.a  (libD3.so) & 3D library
\end{tabular}
\end{center}

\noindent
(*.so if shared libraries are used)

The graphics library libW is based on X11. It can be made only if
the main X11 include directory is located in one of the standard include 
directories of your compiler (e.g. /usr/include/X11). If this is not the 
case you have to tell the compiler where it is by using the -I option 
in src/Make.src, e.g., -I/usr/openwin/include should work on most SUN 
workstations.
  
Now you are in a situation similar to people having downloaded the object code
package. So please read on!  


\subsection{Object Code Package} \label{ObjectCodePackage}


\noindent
Now your current working directory should contain the files libL.a, libG.a, 
libP.a, libW.a and lib3D.a in the static case, and the files libL.so, libG.so, 
libP.so, libW.so and lib3D.so in the shared case,  and the sub-directories 
{\em incl, test, demo }. The {\em incl} directory contains a subdirectory
{\em LEDA}. This directory should be copied (or moved) to the standard include 
directory of your \CC compiler.

\bigskip\noindent
Example for GNU g{\tt ++}: 
cp -r {\em LEDAROOT}/incl/LEDA /usr/local/lib/g{\tt ++}-include     

\bigskip\noindent
Copy the libraries to /usr/lib  or /usr/local/lib, e.g.:\\
\ \\
Example for static libraries: cp {\em LEDAROOT}/lib*.a  /usr/lib\\
{\phantom {Example for static libraries:}} 
ranlib /usr/lib/lib[L,G,P,W]*.a  (if required by your system)

Example for shared libraries: cp {\em LEDAROOT}/lib*.so /usr/lib

\bigskip\noindent
Remark: Of course you can also use LEDA if you do not have access to the standard 
directories of the compiler you're using. Section \ref{Libraries} will tell you how.

\section{Usage} \label{Usage}


\subsection{Header Files}

\label{Header Files}
LEDA data types and algorithms can be used in any \CC program as described 
in this manual (for the general layout of a manual page please see chapter
\ref{LEDA Manual Page}). The specifications (class declarations) are contained
in header files. To use a specific data type its header file has to be 
included into the program. In general the header file for data type xyz is 
\<LEDA/xyz.h\>. Exceptions to this rule can be found in Tables 
\ref{Table Data Types} and \ref{Table Algorithms}.


\subsection{Libraries}

\label{Libraries}
The implementions of all LEDA data types and algorithms are precompiled and 
contained in the 5 libraries mentioned above (libL.a, libG.a, libP.a, libW.a, 
lib3D.a).
They can be linked with \CC application programs. In the following
description it is assumed that these libraries are installed in one of the 
systems default library directories (e.g. /usr/lib), which allows to use 
the ``-l\dots'' compiler option.

a)\ {\bf libL.a}\\
is the main LEDA library, it contains the implementations of all simple 
data types (chapter \ref{Simple Data Types}), basic data types 
(chapter \ref{Basic Data Types}), dictionaries and priority
queues (chapter \ref{Dictionaries and Related Types} and 
\ref{Priority Queues and Related Types}). A program 
$prog.c$ using any of these data types has to be
linked with the libL.a library like this:

\smallskip
CC $prog.c$ -lL -lm

\smallskip
b)\ {\bf libG.a}\\
is the LEDA graph library. It contains the implementations of all graph 
data types and algorithms (chapter \ref{Graphs and Related Data Types}). 
To compile a program using any graph 
data type or algorithm the libG.a and libL.a library have to be used:

\smallskip
CC $prog.c$ -lG -lL -lm

\smallskip
c)\ {\bf libP.a}\\
is the LEDA library for geometry in the plane. It contains the 
implementations of all data types and algorithms for 
geometry 
(chapter \ref{Basic Data Types for Two-Dimensional Computational Geometry}
and \ref{Advanced Data Types for Two-Dimensional Geometry}). 
To compile a program using geometric data 
types or algorithms the libP.a, libG.a, libL.a and maths libraries have 
to be used:

\smallskip
CC $prog.c$ -lP -lG -lL -lm 

\smallskip
\medskip
d)\ {\bf libW.a}\\
is the LEDA library for graphic windows under the X11 
window system. Application programs using data type $window$ 
(cf. section \ref{Panels}) have to be linked with this library:\\

\smallskip
CC $prog.c$ -lW -lP -lG -lL -lX11 -lm


\smallskip
\medskip
e)\ {\bf libD3.a}\\
is the LEDA library for three-dimensional geometry.
Application programs using three-dimensional data types
(cf. chapter \ref{Basic Data Types for Three-Dimensional Geometry})
have to be linked with this library:\\

\smallskip
CC $prog.c$ -lD3 -lW -lP -lG -lL -lX11 -lm

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

\bigskip
Remarks:


\begin{itemize}

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

\item
If you cannot write /usr/(local/)include and /usr/(local/)lib
on your system, you have to use the -I and -L compiler flags to 
compile and link LEDA programs:\\
\ \\
CC (g{\tt ++}) -I{\em LEDAROOT}/incl -L{\em LEDAROOT}  ...

\item
If using shared libraries you either have to include {\em LEDAROOT} 
into the dynamic library search path for ld:\\
\ \\
setenv LD\_LIBRARY\_PATH {\em LEDAROOT}:\$LD\_LIBRARY\_PATH\\
\ \\
or you have to use the -R option\\
\ \\
CC (g{\tt ++}) -I{\em LEDAROOT}/incl -L{\em LEDAROOT} -R{\em LEDAROOT}  ...

\end{itemize}

\section{Platforms} \label{Platforms}

When this manual was printed LEDA was available as object code for the
following platforms (please the the web pages for the current details):


\bigskip
\begin{center}
\begin{tabular} {|l|l|l|}
\hline
\multicolumn{3}{|c|}{\bf Platforms} \\
\hline
{\bf Machine}             & {\bf Operating System} & {\bf Compiler} \\
\hline
\hline
SUN Sparc         & SunOS, Solaris         & SunPRO CC, g{\tt ++}, CSet{\tt ++}\\
\hline
Silicon Graphics  & IRIX                   & CC, g{\tt ++}\\
\hline
Silicon Graphics  & IRIX64                 & CC\\
\hline
80486             & Linux                  & g{\tt ++}\\
\hline
\end{tabular}
\end{center}

On the following platforms LEDA can be compiled using the source code package
and following the operation guidelines.

\bigskip
\begin{center}
\begin{tabular} {|l|l|l|}
\hline
\multicolumn{3}{|c|}{\bf Platforms} \\
\hline
{\bf Machine}             & {\bf Operating System} & {\bf Compiler} \\
\hline
\hline
Hewlett Packard   & HP-UX                & HP C{\tt ++}, g{\tt ++}\\
\hline
DEC               & Digital Unix         & cxx, g{\tt ++}\\
\hline
IBM               & AIX                  & CSet{\tt ++}, g{\tt ++}\\
\hline
\end{tabular}
\end{center}

If the platform you're using is not listed here, please contact us. 

\bigskip\noindent
For the following platforms LEDA is available from LEDA Software GmbH.
Note, that LEDA Software GmbH sells student licenses and university licenses to
special prices.

\bigskip
\begin{center}
\begin{tabular} {|l|l|l|}
\hline
\multicolumn{3}{|c|}{\bf Platforms} \\
\hline
{\bf Machine}           & {\bf Operating System} & {\bf Compiler} \\
\hline
\hline
80x86                   & Windows NT or          & Borland 5.x\\
\                       & Windows 95             & Microsoft Visual 4.x\\
\                       & DLLs                   & Watcom 10.x\\
\hline
80x86                   & OS/2                   & Watcom 10.x, g{\tt ++}\\
\hline
\end{tabular}
\end{center}

