Next: Static Libraries for MS
Up: Technical Information
Previous: Usage of Header Files
Contents
Index
Subsections
Object Code on UNIX
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 |
| libleda.a (libleda.so) |
the LEDA library |
The static library has the extension .a.
If a shared library is provided it has extension .so.
Unpacking the LEDA distribution file
LEDA-<ver>-<sys>-<cc>.tar.gz
will create the LEDA root directory
"LEDA-<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 Library: (for solaris, linux, irix, osf1)
If you planning to use the shared library include
$LEDAROOT into
the LD_LIBRARY_PATH search path. Then go to
$LEDARROOT and type make shared. This will
construct the shared library from the static library.
- 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
library.
CC (g++) -L$LEDAROOT file.o -lleda -lX11 -lm
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++) ... -lleda -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 -lleda -lX11 -lm
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
2008-01-09