[7] | 1 | /* -*- mode: C++; indent-tabs-mode: nil; -*- |
---|
| 2 | * |
---|
| 3 | * This file is a part of LEMON, a generic C++ optimization library. |
---|
| 4 | * |
---|
| 5 | * Copyright (C) 2003-2008 |
---|
| 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 | */ |
---|
| 18 | |
---|
| 19 | /** |
---|
| 20 | \page install Installation Guide |
---|
| 21 | |
---|
[9] | 22 | In this section we detail how to start using LEMON, from downloading it |
---|
| 23 | to your computer, through the steps of installation, to showing how to |
---|
| 24 | compile programs that use LEMON. We assume that you |
---|
[7] | 25 | have a basic knowledge of your operating system and C++ programming |
---|
| 26 | language. The procedure is pretty straightforward, but if you have any |
---|
| 27 | difficulties do not hesitate to |
---|
| 28 | <a href="mailto:lemon-user@lemon.cs.elte.hu"><b>ask</b></a>. |
---|
| 29 | |
---|
| 30 | \section requirements_lemon Hardware and Software Requirements |
---|
| 31 | |
---|
| 32 | In LEMON we use C++ templates heavily, thus compilation takes a |
---|
| 33 | considerable amount of time and memory. So some decent box would be |
---|
| 34 | advantageousm, but otherwise there are no special hardware requirements. |
---|
| 35 | |
---|
| 36 | You will need a recent C++ compiler. Our primary target is the GNU C++ |
---|
| 37 | Compiler (g++), from version 3.3 upwards. We also checked the Intel C++ |
---|
| 38 | Compiler (icc) and Microsoft Visual C++ (on Windows). |
---|
| 39 | If you want to develop with LEMON under Windows, you can use a Windows |
---|
| 40 | installer or you can consider using Cygwin. |
---|
| 41 | |
---|
| 42 | In this description we will suppose a Linux environment and GNU C++ Compiler. |
---|
| 43 | If you would like to develop under Windows and use a Windows installer, |
---|
[9] | 44 | you could skip the following sections and continue reading |
---|
| 45 | \ref basic_concepts. |
---|
[7] | 46 | However keep in mind that you have to make appropriate steps instead of |
---|
[9] | 47 | the instructions detailed here to be able to use LEMON with your compiler. |
---|
[7] | 48 | |
---|
| 49 | \subsection requirements_lp LP Solver Requirements |
---|
| 50 | |
---|
| 51 | The LEMON LP solver interface can use the GLPK (GNU Linear Programming |
---|
| 52 | Kit), CPLEX and SoPlex solver. If you want to use it, you will need at |
---|
| 53 | least one of these. |
---|
| 54 | See the <b><tt>INSTALL</tt></b> file how to enable these at compile time. |
---|
| 55 | |
---|
| 56 | \section install_from_source Install from Source |
---|
| 57 | |
---|
| 58 | You can download LEMON from the web site: |
---|
| 59 | <a href="http://lemon.cs.elte.hu/">http://lemon.cs.elte.hu/</a>. |
---|
| 60 | There you will find released versions in form of <tt>.tar.gz</tt> files |
---|
| 61 | (and Windows installers). |
---|
| 62 | If you want a developer version (for example you want to contribute in |
---|
| 63 | developing LEMON) then you might want to use our Mercurial repository. |
---|
[11] | 64 | This case is detailed \ref install_hg "later", so from now on we |
---|
[7] | 65 | suppose that you downloaded a <tt>.tar.gz</tt> file. |
---|
| 66 | |
---|
| 67 | Thus you have to do the following steps. |
---|
| 68 | |
---|
| 69 | Download the tarball either from the browser or just issuing |
---|
| 70 | |
---|
| 71 | \verbatim |
---|
| 72 | wget http://lemon.cs.elte.hu/pub/sources/lemon-1.0.tar.gz |
---|
| 73 | \endverbatim |
---|
| 74 | |
---|
| 75 | \note The tarball is named <tt>lemon-x.y.z.tar.gz</tt> where \c x, \c |
---|
| 76 | y and \c z (which is missing if it is 0) are numbers indicating the |
---|
| 77 | version of the library, in our example we will have |
---|
| 78 | <tt>lemon-1.0.tar.gz</tt>. |
---|
| 79 | |
---|
| 80 | Then issue the following commands: |
---|
| 81 | |
---|
| 82 | \verbatim |
---|
| 83 | tar xvzf lemon-1.0.tar.gz |
---|
| 84 | cd lemon-1.0 |
---|
| 85 | ./configure |
---|
| 86 | make |
---|
| 87 | make check # This is optional, but recommended. It runs a bunch of tests. |
---|
| 88 | make install |
---|
| 89 | \endverbatim |
---|
| 90 | |
---|
| 91 | These commands install LEMON under \c /usr/local (you will |
---|
| 92 | need root privileges to be able to install to that |
---|
| 93 | directory). If you want to install it to some other place, then |
---|
| 94 | pass the \c --prefix=DIRECTORY flag to <tt>./configure</tt>, for example: |
---|
| 95 | |
---|
| 96 | \verbatim |
---|
| 97 | ./configure --prefix=/home/username/lemon |
---|
| 98 | \endverbatim |
---|
| 99 | |
---|
| 100 | We briefly explain these commands below. |
---|
| 101 | |
---|
| 102 | \verbatim |
---|
| 103 | tar xvzf lemon-1.0.tar.gz |
---|
| 104 | \endverbatim |
---|
| 105 | This command untars the <tt>tar.gz</tt> file into a directory named |
---|
| 106 | <tt>lemon-1.0</tt>. |
---|
| 107 | |
---|
| 108 | \verbatim |
---|
| 109 | cd lemon-1.0 |
---|
| 110 | \endverbatim |
---|
| 111 | This command enters the directory. |
---|
| 112 | |
---|
| 113 | \verbatim |
---|
| 114 | ./configure |
---|
| 115 | \endverbatim |
---|
| 116 | This command runs the configure shell script, which does some checks and |
---|
| 117 | creates the makefiles. |
---|
| 118 | |
---|
| 119 | \verbatim |
---|
| 120 | make |
---|
| 121 | \endverbatim |
---|
| 122 | This command compiles the non-template part of LEMON into <tt>libemon.a</tt> |
---|
| 123 | file. It also compiles the programs in the tools and demo subdirectories |
---|
| 124 | when enabled. |
---|
| 125 | |
---|
| 126 | \verbatim |
---|
| 127 | make check |
---|
| 128 | \endverbatim |
---|
| 129 | This step is optional, but recommended. It performes a bunch of library |
---|
| 130 | self-tests. |
---|
| 131 | |
---|
| 132 | \verbatim |
---|
| 133 | make install |
---|
| 134 | \endverbatim |
---|
| 135 | This command will copy the directory structure to its final destination |
---|
| 136 | (e.g. to \c /usr/local) so that your system can access it. |
---|
| 137 | This command should be issued as "root", unless you provided a |
---|
| 138 | \c --prefix switch to the \c configure to install the library in |
---|
| 139 | non-default location. |
---|
| 140 | |
---|
| 141 | Several other configure flags can be passed to <tt>./configure</tt>. |
---|
| 142 | For more information see the <b><tt>INSTALL</tt></b> file. |
---|
| 143 | |
---|
[9] | 144 | \subsection install_hg Install the Latest Development Version |
---|
[7] | 145 | |
---|
| 146 | You can also use the latest (developer) version of LEMON from our Mercurial |
---|
[9] | 147 | repository. You need a couple additional tool for that. |
---|
[7] | 148 | |
---|
| 149 | - <a href="http://www.selenic.com/mercurial">Mercurial</a> |
---|
| 150 | - for obtaining the latest code (and for contributing into it) |
---|
| 151 | - <a href="http://www.gnu.org/software/automake/">automake</a> (1.7 or newer) |
---|
| 152 | - <a href="http://www.gnu.org/software/autoconf/">autoconf</a> (2.59 or newer) |
---|
| 153 | - <a href="http://www.gnu.org/software/libtool/">libtool</a> |
---|
| 154 | - <a href="http://pkgconfig.freedesktop.org/">pkgconfig</a> |
---|
| 155 | - for initializing the build framework |
---|
| 156 | - <a href="http://doxygen.org">Doxygen</a> |
---|
| 157 | - for generating the documentations (optional, but recommended) |
---|
| 158 | |
---|
| 159 | Once you have all these tools installed, the process is fairly easy. |
---|
[9] | 160 | First, you have to get the copy of the latest version. |
---|
[7] | 161 | |
---|
| 162 | \verbatim |
---|
| 163 | hg clone http://lemon.cs.elte.hu/hg/lemon-main lemon-src |
---|
| 164 | \endverbatim |
---|
| 165 | |
---|
| 166 | The next step is to initialize the build system. |
---|
| 167 | |
---|
| 168 | \verbatim |
---|
| 169 | autoreconf -vif |
---|
| 170 | \endverbatim |
---|
| 171 | |
---|
| 172 | Then the process is the same as in case of using the release tarball. |
---|
| 173 | |
---|
| 174 | \verbatim |
---|
| 175 | ./configure |
---|
| 176 | make |
---|
| 177 | make check # This is optional, but recommended. It runs a bunch of tests. |
---|
| 178 | make install |
---|
| 179 | \endverbatim |
---|
| 180 | |
---|
[9] | 181 | To generate the documentation, just run |
---|
[7] | 182 | \verbatim |
---|
| 183 | make html |
---|
| 184 | \endverbatim |
---|
[9] | 185 | \todo Is <tt><b>make html</b></tt> really necessary after |
---|
| 186 | <tt><b>make install</b></tt>? |
---|
| 187 | |
---|
| 188 | |
---|
| 189 | \section install_rpm Install from rpm |
---|
| 190 | |
---|
| 191 | \todo Write this section (\ref install_rpm). |
---|
| 192 | |
---|
| 193 | |
---|
| 194 | \section install_user Install Locally to the User |
---|
| 195 | |
---|
| 196 | \todo Write this section (\ref install_user). |
---|
| 197 | |
---|
| 198 | |
---|
| 199 | \section compile_codes Compile Codes that Use LEMON |
---|
| 200 | |
---|
| 201 | Now let us see how to use the library after installing it. |
---|
| 202 | |
---|
| 203 | \subsection compile_system_wide If LEMON is Installed System-Wide |
---|
| 204 | |
---|
| 205 | If your installation of LEMON into directory \c /usr/local was |
---|
| 206 | successful, then you have to issue a command like this to compile a |
---|
| 207 | source file that uses LEMON. |
---|
| 208 | |
---|
| 209 | \verbatim |
---|
| 210 | g++ -lemon [other options] <source file> |
---|
| 211 | \endverbatim |
---|
| 212 | |
---|
| 213 | The argument <tt>-lemon</tt> tells the compiler that we are using the |
---|
| 214 | installed library LEMON. |
---|
| 215 | |
---|
| 216 | \subsection compile_user_local If LEMON is Installed User-Local |
---|
| 217 | |
---|
| 218 | You have to give more options to the compiler if LEMON is installed |
---|
[11] | 219 | user-local into a directory (denoted by <tt><dir></tt>) |
---|
[9] | 220 | or if you just skipped the step <tt>make install</tt>. |
---|
[11] | 221 | In the later case <tt><dir></tt> denotes the directory in which the |
---|
[9] | 222 | the \c make command have been performed. |
---|
| 223 | |
---|
| 224 | \verbatim |
---|
| 225 | g++ -lemon -I <dir> -L <dir>/lemon/.libs [other options] <source file> |
---|
| 226 | \endverbatim |
---|
| 227 | |
---|
| 228 | \subsubsection compile_use_pkg_config Use pkg-config |
---|
| 229 | |
---|
| 230 | \todo Write this sub-subsection (\ref compile_use_pkg_config). |
---|
[7] | 231 | |
---|
| 232 | */ |
---|