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