COIN-OR::LEMON - Graph Library

Changeset 1519:17e367a93cbb in lemon-0.x for doc/getstart.dox


Ignore:
Timestamp:
06/27/05 21:47:09 (14 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2004
Message:

getstart improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/getstart.dox

    r1517 r1519  
    22\page getstart How to start using LEMON
    33
    4 In this page we detail how to start using LEMON, from downloading it to
    5 your computer, through the steps of installation to showing a simple
    6 "Hello World" type program that already uses LEMON. We assume that you have a
    7 basic knowledge of your operating system and \c C++ or \c C
    8 programming language.
     4In this page we detail how to start using LEMON, from downloading it to
     5your computer, through the steps of installation, to showing a simple
     6"Hello World" type program that already uses LEMON. We assume that you
     7have a basic knowledge of your operating system and \c C++ programming
     8language. The procedure is pretty straightforward, but if you have any
     9difficulties don't hesitate to
     10<a href="http://lemon.cs.elte.hu/mailinglists.html">ask</a>.
    911
    1012\section requirementsLEMON Hardware and software requirements
    1113
    12 Hardware requirements ...
     14In LEMON we use C++ templates heavily, thus compilation takes a
     15considerable amount of time and memory. So some decent box would be
     16advantageous. But otherwise there are no special hardware requirements.
    1317
    14 You will also need a C++ compiler. We mostly used the Gnu C++ Compiler (g++),
    15 from version 3.0 upwards. We also checked the Intel C compiler
    16 (icc). Unfortunately, Visual C++ compiler knows not enough to compile the
    17 library, so if you are using Microsoft Windows, then try to compile under
    18 Cygwin.
     18You will need a recent C++ compiler. Our primary target is the GNU C++
     19Compiler (g++), from version 3.3 upwards. We also checked the Intel C
     20compiler (icc). Microsoft Visual C++ .NET version was also reported to
     21work (but not the earlier versions). If you want to develop with LEMON
     22under Windows you could consider using Cygwin.
    1923
    20 Ide kell írni:
    21  
    22 -Hol fordul (Windows-os fordító nem fordítja, unix/linux alatt gcc hanyas verziója kell)
    23 -
    2424
    25 In this description we will suppose a linux environment and Gnu C Compiler.
     25In this description we will suppose a linux environment and GNU C Compiler.
    2626
    2727\section downloadLEMON How to download LEMON
    2828
    2929You can download LEMON from the LEMON web site:
    30 http://lemon.cs.elte.hu/dowload.html
    31 . There you will find the issued distributions
    32 in form of <tt> .tar.gz </tt> files. If you want a developer version  (for example you want to contribute in developing the library LEMON) then you might want to use our Subversion repository. This case is not detailed here, so from now on we suppose that you downloaded a tar.gz file.
     30http://lemon.cs.elte.hu/dowload.html.
     31There you will find released versions in form of <tt>.tar.gz</tt> files.
     32If you want a developer version (for example you want to contribute in
     33developing the library LEMON) then you might want to use our Subversion
     34repository. This case is not detailed here, so from now on we suppose that
     35you downloaded a tar.gz file.
    3336
    3437
     
    3841In order to install LEMON you have to do the following
    3942
    40 Download the tarball (named <tt>lemon-x.y.z.tar.gz</tt> where \c x,\c y and \c z are
    41 numbers indicating the version of the library: in our example we will have lemon-0.3.1) and issue the following commands:
     43Download the tarball (named <tt>lemon-x.y.z.tar.gz</tt> where \c x,\c y
     44and \c z are numbers indicating the version of the library: in our example
     45we will have <tt>lemon-0.3.1.tar.gz</tt>) and issue the following
     46commands:
    4247
    43 \code
     48\verbatim
    4449tar xvzf lemon-0.3.1.tar.gz
    4550cd lemon-0.3.1
    4651./configure
    4752make
    48 make check (This is optional, but recomended. It runs a bunch of tests.)
     53make check   #(This is optional, but recomended. It runs a bunch of tests.)
    4954make install
    50 \endcode
     55\endverbatim
    5156
    52 These commands install LEMON under \c /usr/local (you will probably need \c root
    53 privileges to be able to install to that directory). If you want to install it
    54 to some other place, then pass the \c --prefix=DIR flag to \c ./configure. In
    55 what follows we will assume that you were able to install to directory \c
    56 /usr/local, otherwise some extra care is to be taken to use the library.
     57These commands install LEMON under \c /usr/local (you will
     58need root privileges to be able to install to that
     59directory). If you want to install it to some other place, then
     60pass the \c --prefix=DIR flag to \c ./configure. In what follows
     61we will assume that you were able to install to directory
     62\c /usr/local, otherwise some extra care is to be taken to use the
     63library.
    5764
    5865We briefly explain these commands below.
    5966
    60 \code
     67\verbatim
    6168tar xvzf lemon-0.3.1.tar.gz
    62 \endcode
    63 This command untars the <tt>tar.gz</tt> file into a directory named <tt> lemon-0.3.1</tt>.
     69\endverbatim
     70This command untars the <tt>tar.gz</tt> file into a directory named <tt>
     71lemon-0.3.1</tt>.
    6472
    65 \code
     73\verbatim
    6674cd lemon-0.3.1
    67 \endcode
     75\endverbatim
    6876Enters the directory.
    6977
    70 \code
     78\verbatim
    7179./configure
    72 \endcode
     80\endverbatim
    7381Does some configuration (creates makefiles etc).
     82\todo Explain the most important switches here (gui, doc, glpk, cplex).
    7483
    75 \code
     84\verbatim
    7685make
    77 \endcode
    78 This command compiles the <tt> .cc</tt> files of the library package (the
    79 implementation of non-template functions and classes and some test and demo
    80 programs) and creates the very important <b> libemon.la </b> file. When
    81 linking your program that uses LEMON it needs to access this file.
     86\endverbatim
     87This command compiles the non-template part of LEMON into
     88<b>libemon.a</b> file. It also compiles some benchmark and demo
     89programs.
    8290
    83 \code
    84 make check (This is optional, but recomended. It runs a bunch of tests.)
    85 \endcode
    86 This is an optional step: it runs the test programs that we developed for
    87 LEMON to check
    88 whether the library works properly on your platform.
     91\verbatim
     92make check
     93\endverbatim
     94This is an optional step: it runs the test programs that we
     95developed for LEMON to check whether the library works properly on
     96your platform.
    8997
    90 \code
     98\verbatim
    9199make install
    92 \endcode
     100\endverbatim
    93101This will copy the directory structure to its final destination (e.g. to \c
    94 /usr/local) so that your system can access it.
     102/usr/local) so that your system can access it. This command should
     103be issued as "root", unless you provided a \c --prefix switch to
     104the \c cofugure to install the library in non-default location.
    95105
    96106\section helloworld My first program using LEMON
    97107
    98 If you have installed LEMON on your system you
    99 can paste the following code
    100 segment into a file to have a first working program that uses library LEMON.
     108If you have installed LEMON on your system you can paste the
     109following code segment into a file (named e.g. \c hello_lemon.cc)
     110to have a first working program that uses library LEMON.
    101111
    102112\code
     
    104114#include <lemon/list_graph.h>
    105115
    106 using namespace lemon;
    107 
    108116int main()
    109117{
    110   typedef ListGraph Graph;
     118  typedef lemon::ListGraph Graph;
    111119  typedef Graph::EdgeIt EdgeIt;
    112120  typedef Graph::NodeIt NodeIt;
     121  using lemon::INVALID;
    113122
    114123  Graph g;
     
    130139    std::cout << " (" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")";
    131140  std::cout << std::endl;
    132 
     141}
    133142\endcode
    134143
     
    151160\c source member functions can be used to access the endpoints of an edge.
    152161
    153 If you have saved the preceding code into a file named, say,  \c hemon.cc and your installation of LEMON into directory \c /usr/local was
    154 successful then it is very easy to compile this program with the following
    155 command (the argument <tt>-lemon</tt> tells the compiler that we are using the
    156 installed library LEMON):
    157 \code
    158 g++ hemon.cc -o hemon -lemon
    159 \endcode
     162If you have saved the preceding code into a file named, say, \c
     163hello_lemon.cc and your installation of LEMON into directory \c
     164/usr/local was successful then it is very easy to compile this
     165program with the following command (the argument <tt>-lemon</tt>
     166tells the compiler that we are using the installed library LEMON):
    160167
    161 As a result you will get the exacutable \c hemon in
     168\verbatim
     169g++ hello_lemon.cc -o hello_lemon -lemon
     170\endverbatim
     171
     172As a result you will get the exacutable \c hello_lemon in
    162173this directory that you can run by the command
    163 \code
    164 ./hemon
    165 \endcode
     174\verbatim
     175./hello_lemon
     176\endverbatim
    166177
    167178
    168 If everything has gone well then the previous code fragment prints out the following:
     179If everything has gone well then the previous code fragment prints
     180out the following:
    169181
    170 \code
     182\verbatim
    171183Nodes: 2 1 0
    172184
    173185Edges: (0,2) (1,2) (0,1) (2,1) (1,0) (2,0)
    174 \endcode
     186\endverbatim
    175187
    176188Congratulations!
    177189
    178 If you want to see more features, go to the \ref quicktour "Quick Tour to
    179 LEMON", if you want to see see some demo programs then go to our
     190If you want to see more features, go to the
     191\ref quicktour "Quick Tour to LEMON",
     192if you want to see see some demo programs then go to our
    180193\ref demoprograms "Demo Programs" page!
    181194
Note: See TracChangeset for help on using the changeset viewer.