kpeter@3: /* -*- mode: C++; indent-tabs-mode: nil; -*-
kpeter@3: *
kpeter@3: * This file is a part of LEMON, a generic C++ optimization library.
kpeter@3: *
kpeter@20: * Copyright (C) 2003-2009
kpeter@3: * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
kpeter@3: * (Egervary Research Group on Combinatorial Optimization, EGRES).
kpeter@3: *
kpeter@3: * Permission to use, modify and distribute this software is granted
kpeter@3: * provided that this copyright notice appears in all copies. For
kpeter@3: * precise terms see the accompanying LICENSE file.
kpeter@3: *
kpeter@3: * This software is provided "AS IS" with no warranty of any kind,
kpeter@3: * express or implied, and with no claim as to its suitability for any
kpeter@3: * purpose.
kpeter@3: *
kpeter@3: */
kpeter@3:
kpeter@11: namespace lemon {
kpeter@3: /**
alpar@10: [PAGE]hello_lemon[PAGE] Compile Your First Code
kpeter@6:
kpeter@11: First of all you have to install LEMON on your system (see
kpeter@19: our
kpeter@19: web page for instructions).
kpeter@11: After that you can paste the following code segment into a file
kpeter@11: hello_lemon.cc to have a first working program that uses LEMON.
kpeter@6:
kpeter@6: \dontinclude hello_lemon.cc
kpeter@6: \skip #include
kpeter@6: \until }
kpeter@6:
kpeter@16: In this small example a directed graph is created with two nodes and
kpeter@16: an arc added to it.
kpeter@6:
kpeter@16: Now let us compile this code.
kpeter@16: (We suppose that you have it in a file called hello_lemon.cc.)
kpeter@6:
kpeter@16: If LEMON is installed system-wide (into directory \c /usr/local),
kpeter@9: then it is very easy to compile this program with the
kpeter@6: following command (the argument -lemon tells the compiler
kpeter@16: that we are using the installed LEMON).
kpeter@6:
kpeter@6: \verbatim
deba@23: g++ -o hello_lemon hello_lemon.cc -lemon
kpeter@6: \endverbatim
kpeter@6:
kpeter@6: As a result you will get the exacutable \c hello_lemon in the current
kpeter@6: directory, which you can run by the following command.
kpeter@6:
kpeter@6: \verbatim
kpeter@6: ./hello_lemon
kpeter@6: \endverbatim
kpeter@6:
kpeter@16: If LEMON is installed user-local into a directory
kpeter@18: (e.g. ~/lemon), then compiling the code is a bit more difficult.
kpeter@6: You have to issue a command like this.
kpeter@6:
kpeter@6: \verbatim
deba@23: g++ -o hello_lemon -I ~/lemon/include hello_lemon.cc -L ~/lemon/lib -lemon
kpeter@6: \endverbatim
kpeter@6:
kpeter@6: If everything has gone well, then our program prints out the followings.
kpeter@6:
kpeter@6: \verbatim
kpeter@16: Hello World! This is LEMON library here.
kpeter@16: We have a directed graph with 2 nodes and 1 arc.
kpeter@6: \endverbatim
kpeter@6:
kpeter@6: If you managed to compile and run this example code without any problems,
kpeter@16: you may go on reading this tutorial to get to know the basic notions,
kpeter@16: features and tools of LEMON. However if you encountered problems that
kpeter@16: you did not manage to solve, do not hesitate to
kpeter@6: contact us.
kpeter@6:
alpar@10: [TRAILER]
kpeter@3: */
kpeter@11: }