Open Graph Drawing Framework
current version:
v.2015.05 (Baobab)

Installation (Linux/Mac OS)

Recall that OGDF is a pure library, i.e., using OGDF is a two-step process: first, you have to build the library. Then you can use the library (by linking against it) within your own program.

Building OGDF

  • Download the OGDF package from here and unpack in the directory, where you want to install OGDF.
  • Build OGDF (gcc Compiler):
    1. Edit makeMakefile.config for your configuration (if necessary): check the [GENERAL] section.
    2. Execute to generate a suitable Makefile.
    3. Call make to build the OGDF library (you may also call make debug to generate a debuggable version).

Configuration Options

You can adjust some configuration options by editing makeMakefile.config before executing These options are explained in makeMakefile.config; here we discuss some interesting usage scenarios.

  • For choosing a different compiler, set compilerCommand (or sharedLibCommand) to the corresponding call, e.g., to clang++.
  • For building OGDF and COIN as shared libraries ('.so'), set sharedLib to true.
  • By default, OGDF is build with integrated COIN and ABACUS support; you can disable this by setting useCoin (in the COIN section) to false.
  • You can choose the default LP-solver for OGDF and ABACUS by setting the defaultSolver option in the COIN section (default is COIN's CLP, but you can also choose an external solver such as CPLEX or Gurobi). If you specify an external solver as default solver, it is not necessary to also specify it as external solver.
  • If you want to use an external solver (CPLEX or Gurobi), you can add it under externalSolvers; in this case, you also have to specify the include directory under solverIncludes. The following example sets CPLEX as default solver:
#* Default solver (one of CLP, SYM, CPX, GRB)
defaultSolver = CPX

#* External solvers (separated by semicolon)
externalSolvers = CPX

#* Additional include directories (separated by semicolon)
solverIncludes = /somewhere/ILOG/cplex90/include/ilcplex

Compiling and Linking against OGDF

If you want to use the OGDF library in your own projects, proceed as follows.

  1. Add the path to the OGDF header files to the include path (-I compiler option). This is the include directory of the OGDF installation which contains the directories coin and ogdf.
  2. If you want to link against the debug version of OGDF, add the preprocessor definition OGDF_DEBUG (-D compiler option).
  3. Link against the OGDF and COIN libraries (-l compiler option)
    Make sure to link the correct version for each configuration (e.g. _debug/libOGDF.a, _release/libOGDF.a, etc.). You can set the path to the library with the -L compiler option.
  4. Link against the pthread library (-pthread).

The following example calls compiles a source file test.cpp and links it against the release versions of OGDF and COIN (assuming OGDF is installed in OGDF_INSTALL_DIR):

g++ -IOGDF_INSTALL_DIR/include -O2 test.cpp -o test -LOGDF_INSTALL_DIR/_release -lOGDF -lCOIN -pthread

Build Documentation

It is also possible to create the source code documentation directly from the source files if you have Doxygen installed. You will also need to have LaTeX and Ghostscript installed so that Doxygen can create images from formulas. To build the OGDF HTML documentation, type

make doc

in the root directory of the OGDF installation. The documentation will then be written to doc/html.

tech/installgcc.txt · Last modified: 2015/05/30 17:20 by stephan
This page is driven by DokuWiki