/** \page getstart How to start using LEMON In this page we detail how to start using LEMON, from downloading it to your computer, through the steps of installation, to showing a simple "Hello World" type program that already uses LEMON. We assume that you have a basic knowledge of your operating system and \c C++ programming language. The procedure is pretty straightforward, but if you have any difficulties don't hesitate to ask. \section requirementsLEMON Hardware and software requirements In LEMON we use C++ templates heavily, thus compilation takes a considerable amount of time and memory. So some decent box would be advantageous. But otherwise there are no special hardware requirements. You will need a recent C++ compiler. Our primary target is the GNU C++ Compiler (g++), from version 3.3 upwards. We also checked the Intel C++ Compiler (icc). Microsoft Visual C++ .NET 2003 was also reported to work (but not the earlier versions). If you want to develop with LEMON under Windows you could consider using Cygwin. In this description we will suppose a Linux environment and GNU C++ Compiler. \subsection requirementsLP LP solver requirements The LEMON LP solver interface can use the GLPK (GNU Linear Programming Kit) and CPLEX solvers (was tested with CPLEX 7.5). If you want to use it you will need at least one of these. See \ref configureFlags how to enable these at compile time. \subsection requirementsGUI GUI requirements To compile the graphical graph editor you will need libgnomecanvasmm (2.6.0 or newer). See \ref configureFlags how to enable it. \section downloadLEMON How to download LEMON You can download LEMON from the LEMON web site: http://lemon.cs.elte.hu/download.html . There you will find released versions in form of .tar.gz 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. \section installLEMON How to install LEMON In order to install LEMON you have to do the following steps. Download the tarball (named lemon-x.y.z.tar.gz where \c x,\c y and \c z are numbers indicating the version of the library: in our example we will have lemon-0.3.1.tar.gz) and issue the following commands: \verbatim tar xvzf lemon-0.3.1.tar.gz cd lemon-0.3.1 ./configure make make check #(This is optional, but recommended. It runs a bunch of tests.) make install \endverbatim These commands install LEMON under \c /usr/local (you will need root privileges to be able to install to that directory). If you want to install it to some other place, then pass the \c --prefix=DIRECTORY flag to \c ./configure, for example: \verbatim ./configure --prefix=/home/user1/lemon \endverbatim In what follows we will assume that you were able to install to directory \c /usr/local, otherwise some extra care is to be taken to use the library. We briefly explain these commands below. \verbatim tar xvzf lemon-0.3.1.tar.gz \endverbatim This command untars the tar.gz file into a directory named lemon-0.3.1. \verbatim cd lemon-0.3.1 \endverbatim Enters the directory. \verbatim ./configure \endverbatim Does some configuration (creates makefiles etc). \verbatim make \endverbatim This command compiles the non-template part of LEMON into libemon.a file. It also compiles some benchmark and demo programs. \verbatim make check \endverbatim This is an optional step: it runs the test programs that we developed for LEMON to check whether the library works properly on your platform. \verbatim make install \endverbatim This will copy the directory structure to its final destination (e.g. to \c /usr/local) so that your system can access it. This command should be issued as "root", unless you provided a \c --prefix switch to the \c configure to install the library in non-default location. \subsection configureFlags Configure flags You can pass the following flags to \c ./configure (see \c ./configure --help for more): \verbatim --enable-gui \endverbatim Build the GUI. \verbatim --disable-gui \endverbatim Do not build the GUI (default). \verbatim --with-glpk[=PREFIX] \endverbatim Enable GLPK support (default). You should specify the prefix too if you installed it to some non-standard location (e.g. your home directory). If GLPK is not found, then GLPK support will be disabled. \verbatim --with-glpk-includedir=DIR \endverbatim The directory where the GLPK header files are located. This is only useful when the GLPK headers and libraries are not under the same prefix (which is unlikely). \verbatim --with-glpk-libdir=DIR \endverbatim The directory where the GLPK libraries are located. This is only useful when the GLPK headers and libraries are not under the same prefix (which is unlikely). \verbatim --without-glpk \endverbatim Disable GLPK support. \verbatim --with-cplex[=PREFIX] \endverbatim Enable CPLEX support (default). You should specify the prefix too if you installed it to some non-standard location (e.g. \c /opt/ilog/cplex75). If CPLEX is not found, then CPLEX support will be disabled. \verbatim --with-cplex-includedir=DIR \endverbatim The directory where the CPLEX header files are located. This is only useful when the CPLEX headers and libraries are not under the same prefix. \verbatim --with-cplex-libdir=DIR \endverbatim The directory where the CPLEX libraries are located. This is only useful when the CPLEX headers and libraries are not under the same prefix. \verbatim --without-cplex \endverbatim Disable CPLEX support. \section svnCheckout How to checkout LEMON form our Subversion repository You can obtain the latest version of LEMON from our Subversion repository. To do this issue the following command: \verbatim svn co https://lemon.cs.elte.hu/svn/hugo/trunk lemon \endverbatim Use "lemon" as username, the password is empty. \section svnCompile How to compile the source from the repository You can compile the code from the repository similarly to the packaged version, but you will need to run \c ./bootstrap before \c ./configure. See \c ./bootstrap \c --help for options. For bootstrapping you will need the following tools: - automake (1.7 or newer) - autoconf (2.59 or newer) - libtool - pkgconfig - gettext To generate the documentation, run \c make \c doc. You will need Doxygen for this. You can pass the \c --enable-doc=full flag to \c ./configure to generate the internal documentation too. If you pass the \c --disable-doc flag to \c ./configure then the documentation won't be installed, when you run \c make \c install (this speeds things up a bit). \section helloworld My first program using LEMON If you have installed LEMON on your system you can paste the following code segment into a file (you can find it as \c demo/hello_lemon.cc in the LEMON package) to have a first working program that uses library LEMON. \dontinclude hello_lemon.cc \skip include \until } First let us briefly explain how this program works. ListGraph is one of LEMON's graph classes. It is based on linked lists, therefore iterating throuh its edges and nodes is fast. After some convenience typedefs we create a graph and add three nodes to it. Then we add edges to it to form a complete graph. Then we iterate through all nodes of the graph. We use a constructor of the node iterator to initialize it to the first node. The operator++ is used to step to the next node. Using operator++ on the iterator pointing to the last node invalidates the iterator i.e. sets its value to \ref lemon::INVALID "INVALID". This is what we exploit in the stop condition. We can also iterate through all edges of the graph very similarly. The \c target and \c source member functions can be used to access the endpoints of an edge. If your installation of LEMON into directory \c /usr/local was successful, then it is very easy to compile this program with the following command (the argument -lemon tells the compiler that we are using the installed library LEMON): \verbatim g++ hello_lemon.cc -o hello_lemon -lemon \endverbatim As a result you will get the exacutable \c hello_lemon in this directory that you can run by the command \verbatim ./hello_lemon \endverbatim If everything has gone well then the previous code fragment prints out the following: \verbatim Nodes: 2 1 0 Edges: (0,2) (1,2) (0,1) (2,1) (1,0) (2,0) \endverbatim Congratulations! If you want to see more features, go to the \ref quicktour "Quick Tour to LEMON", if you want to see see some demo programs then go to our \ref demoprograms "Demo Programs" page! */