COIN-OR::LEMON - Graph Library

source: lemon-tutorial/getting_started.dox @ 20:3ffc47b666b1

Last change on this file since 20:3ffc47b666b1 was 20:3ffc47b666b1, checked in by Peter Kovacs <kpeter@…>, 12 years ago

Happy New Year

File size: 2.5 KB
[3]1/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 *
3 * This file is a part of LEMON, a generic C++ optimization library.
4 *
[20]5 * Copyright (C) 2003-2009
[3]6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
8 *
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
12 *
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
15 * purpose.
16 *
17 */
[11]19namespace lemon {
[10]21[PAGE]hello_lemon[PAGE] Compile Your First Code
[11]23First of all you have to install LEMON on your system (see
[19]24<a href=""><b>our
25web page</b></a> for instructions).
[11]26After that you can paste the following code segment into a file
27<tt></tt> to have a first working program that uses LEMON.
30\skip #include
31\until }
[16]33In this small example a directed graph is created with two nodes and
34an arc added to it.
[16]36Now let us compile this code.
37(We suppose that you have it in a file called <tt></tt>.)
[16]39If LEMON is installed <b>system-wide</b> (into directory \c /usr/local),
[9]40then it is very easy to compile this program with the
[6]41following command (the argument <tt>-lemon</tt> tells the compiler
[16]42that we are using the installed LEMON).
[19]45g++ -lemon -o hello_lemon
48As a result you will get the exacutable \c hello_lemon in the current
49directory, which you can run by the following command.
[16]55If LEMON is installed <b>user-local</b> into a directory
[18]56(e.g. <tt>~/lemon</tt>), then compiling the code is a bit more difficult.
[6]57You have to issue a command like this.
[19]60g++ -lemon -I ~/lemon/include -L ~/lemon/lib -o hello_lemon
63If everything has gone well, then our program prints out the followings.
[16]66Hello World! This is LEMON library here.
67We have a directed graph with 2 nodes and 1 arc.
70If you managed to compile and run this example code without any problems,
[16]71you may go on reading this tutorial to get to know the basic notions,
72features and tools of LEMON. However if you encountered problems that
73you did not manage to solve, do not hesitate to
[6]74<a href=""><b>contact us</b></a>.
Note: See TracBrowser for help on using the repository browser.