next up previous contents index
Next: Static Libraries for MS Up: Technical Information Previous: Usage of Header Files   Contents   Index

Subsections


Object Code on UNIX

Remark: This section describes the situation in a GUI package of LEDA. If you have the geometry, graph, or basic package only the corresponding libraries are provided.

Files and Directories

To compile and link your programs with LEDA, the LEDA main directory should contain at least the following files and subdirectories:
Readme.txt Readme File
Install/unix.txt txt-version of this section
incl/ the LEDA include directory
libL.a (libL.so) basic library
libG.a (libG.so) graph library
libP.a (libP.so) plane geometry library
libD3.a (libD3.so) 3D geometry library
libW.a (libW.so) window library
libGeoW.a (libGeoW.so) GeoWin library

Static libraries have extension .a. If shared libraries are provided they have extension .so.

Preparations

Unpacking the LEDA distribution file LEDA-complete-<ver>-<sys>-<cc>.tar.gz will create the LEDA root directory "LEDA-complete-<ver>-<sys>-<cc>". You might want to rename it or move it to some different place. Let <LEDA> denote the final complete path name of the LEDA root directory.

To install and use the Unix object code of LEDA you have to modify your environment as follows:

Compiling and Linking Application Programs

  1. Use the -I compiler flag to tell the compiler where to find the LEDA header files.
          CC (g++) -I$LEDAROOT/incl -c file.c
    

  2. Use the -L compiler flag to tell the compiler where to find the libraries (libL.a/so, libG.a/so, ...)
          CC (g++)  -L$LEDAROOT file.o  <libs>
    

    <libs>: -lL -lm (basic data types)
      -lG -lL -lm (graph data types)
      -lP -lG -lL -lm (planar geometry)
      -lD3 -lP -lG -lL -lm (3d geometry)
      -lW -lP -lG -lL -lX11 -lm (graphics)
      -lGeoW -lD3 -lW -lP -lG -lL -lX11 -lm (GeoWin)

    When using graphics on Solaris systems you might have to link with the system socket library and the network services library as well:

          CC (g++)  ... -lW -lP -lG -lL -lX11 -lsocket -lnsl -lm
    
    Remark: The libraries must be given in the above order.

  3. Compile and link simultaneously with
          CC (g++)  -I$LEDAROOT/incl -L$LEDAROOT file.c  <libs>
    

You may want to ask your system administrator to install the header files and libraries in the system's default directories. Then you no longer have to specify header and library search paths on the compiler command line.

Example programs and demos

The source code of all example and demo programs can be found in $LEDAROOT/test and $LEDAROOT/demo. Goto $LEDAROOT/test or $LEDAROOT/demo and type make to compile and link all test or demo programs, respectively.


next up previous contents index
Next: Static Libraries for MS Up: Technical Information Previous: Usage of Header Files   Contents   Index
root 2007-03-08