Using LEDA 4.2 in the Geometry Lab

LEDA is available on the linux and dec systems. Using GNU make is recommended, but not required. Other makes will work as well, although the examples below may need to be modified.

You must use GNU C++ (i.e., g++) to compile LEDA programs. If not using linux, set the compiler with the CXX variable in the makefile:

	CXX = g++
GNU make understands foo.C or foo.cc as C++ programs. If you use some other suffix, the makefile example will need modification.

On the compiler command line, add the flag '-I/labs/cgm/include'. This is typically done in a Makefile using the CXXFLAGS variable. For example:

	CXXFLAGS = -I/labs/cgm/include -O2

Also, on the linker command line, add the flag '-L/labs/cgm/lib', as well as any LEDA libraries required. This is typically done in a Makefile using the LDFLAGS and LDLIBS variables For example:

	LDFLAGS = -L/labs/cgm/lib
	LDLIBS = -lL -lm
Finally, you must specify which source files are combined to form the binary. The following example specifies two programs: foo is built from foo.C (by issuing the command make foo) and bar is built from bar.cc (make bar).
	foo: foo.C
	bar: bar.cc
The LEDA is split into several separate libraries. Here is a quick synopsis of what to use in LDLIBS. See the LEDA manual (local access only) for more details.
        use in LDLIBS              for this functionality
        -------------              ----------------------
        -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  (windows)
Save the example Makefile described in this document and use it as a starting point for your LEDA projects.

Information on obtaining the current version of LEDA can be found on the LEDA web site.