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.
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.
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:
- Set the environment variable LEDAROOT to the LEDA root
directory:
csh/tcsh: |
setenv LEDAROOT <LEDA> |
|
|
sh/bash: |
LEDAROOT=<LEDA> |
|
export LEDAROOT |
- Include $LEDAROOT/Manual/cmd into your command search path
(environment variable path (csh) or PATH (sh)) and call rehash
(if required by your system).
- Shared Libraries: (for solaris, linux, irix, osf1)
If you planning to use shared libraries include
$LEDAROOT into
the LD_LIBRARY_PATH search path. Then go to
$LEDARROOT and type make shared. This will
construct the shared libraries from the static libraries.
- xlman and demos:
Go to $LEDAROOT and type make xlman to compile and
link LEDA's interactive manual reader xlman.
Now you can start xlman for reading and printing manual pages,
starting demo programs and browsing more release notes.
- Use the -I compiler flag to tell the compiler where to find the LEDA
header files.
CC (g++) -I$LEDAROOT/incl -c file.c
- 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.
- 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.
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: Static Libraries for MS
Up: Technical Information
Previous: Usage of Header Files
Contents
Index
root
2007-03-08