rev |
line source |
alpar@9
|
1 %* glpk07.tex *%
|
alpar@9
|
2
|
alpar@9
|
3 \chapter{Installing GLPK on Your Computer}
|
alpar@9
|
4 \label{install}
|
alpar@9
|
5
|
alpar@9
|
6 \section{Downloading the distribution tarball}
|
alpar@9
|
7
|
alpar@9
|
8 The distribution tarball of the most recent version of the GLPK
|
alpar@9
|
9 package can be found on \url{http://ftp.gnu.org/gnu/glpk/} [via http]
|
alpar@9
|
10 and \url{ftp://ftp.gnu.org/gnu/glpk/} [via FTP]. It can also be found
|
alpar@9
|
11 on one of the FTP mirrors; see \url{http://www.gnu.org/prep/ftp.html}.
|
alpar@9
|
12 Please use a mirror if possible.
|
alpar@9
|
13
|
alpar@9
|
14 To make sure that the GLPK distribution tarball you have downloaded is
|
alpar@9
|
15 intact you need to download the corresponding `\verb|.sig|' file and
|
alpar@9
|
16 run a command like this:
|
alpar@9
|
17
|
alpar@9
|
18 \begin{verbatim}
|
alpar@9
|
19 gpg --verify glpk-4.38.tar.gz.sig
|
alpar@9
|
20 \end{verbatim}
|
alpar@9
|
21
|
alpar@9
|
22 \noindent
|
alpar@9
|
23 If that command fails because you do not have the required public key,
|
alpar@9
|
24 run the following command to import it:
|
alpar@9
|
25
|
alpar@9
|
26 \begin{verbatim}
|
alpar@9
|
27 gpg --keyserver keys.gnupg.net --recv-keys 5981E818
|
alpar@9
|
28 \end{verbatim}
|
alpar@9
|
29
|
alpar@9
|
30 \noindent
|
alpar@9
|
31 and then re-run the previous command.
|
alpar@9
|
32
|
alpar@9
|
33 \section{Unpacking the distribution tarball}
|
alpar@9
|
34
|
alpar@9
|
35 The GLPK package (like all other GNU software) is distributed in the
|
alpar@9
|
36 form of packed archive. This is one file named \verb|glpk-X.Y.tar.gz|,
|
alpar@9
|
37 where {\it X} is the major version number and {\it Y} is the minor
|
alpar@9
|
38 version number.
|
alpar@9
|
39
|
alpar@9
|
40 In order to prepare the distribution for installation you should:
|
alpar@9
|
41
|
alpar@9
|
42 \medskip
|
alpar@9
|
43
|
alpar@9
|
44 1. Copy the GLPK distribution file to a working subdirectory.
|
alpar@9
|
45
|
alpar@9
|
46 \medskip
|
alpar@9
|
47
|
alpar@9
|
48 2. Unpack the distribution file with the following command:
|
alpar@9
|
49
|
alpar@9
|
50 \begin{verbatim}
|
alpar@9
|
51 gzip -d glpk-X.Y.tar.gz
|
alpar@9
|
52 \end{verbatim}
|
alpar@9
|
53
|
alpar@9
|
54 \noindent
|
alpar@9
|
55 that renames the distribution file to \verb|glpk-X.Y.tar|.
|
alpar@9
|
56
|
alpar@9
|
57 \medskip
|
alpar@9
|
58
|
alpar@9
|
59 3. Unarchive the distribution file with the following command:
|
alpar@9
|
60
|
alpar@9
|
61 \begin{verbatim}
|
alpar@9
|
62 tar -x < glpk-X.Y.tar
|
alpar@9
|
63 \end{verbatim}
|
alpar@9
|
64
|
alpar@9
|
65 \noindent
|
alpar@9
|
66 that automatically creates the subdirectory \verb|glpk-X.Y| containing
|
alpar@9
|
67 the GLPK distribution.
|
alpar@9
|
68
|
alpar@9
|
69
|
alpar@9
|
70 \section{Configuring the package}
|
alpar@9
|
71
|
alpar@9
|
72 After unpacking and unarchiving the GLPK distribution you should
|
alpar@9
|
73 configure the package, i.e. automatically tune it for your platform.
|
alpar@9
|
74
|
alpar@9
|
75 Normally, you should just \verb|cd| to the subdirectory
|
alpar@9
|
76 \verb|glpk-X.Y| and run the configure script, e.g.
|
alpar@9
|
77
|
alpar@9
|
78 \begin{verbatim}
|
alpar@9
|
79 ./configure
|
alpar@9
|
80 \end{verbatim}
|
alpar@9
|
81
|
alpar@9
|
82 The `\verb|configure|' shell script attempts to guess correct values
|
alpar@9
|
83 for various system-dependent variables used during compilation. It uses
|
alpar@9
|
84 those values to create a `\verb|Makefile|' in each directory of the
|
alpar@9
|
85 package. It also creates file `\verb|config.h|' containing
|
alpar@9
|
86 platform-dependent definitions. Finally, it creates a shell script
|
alpar@9
|
87 `\verb|config.status|' that you can run in the future to recreate the
|
alpar@9
|
88 current configuration, a file `\verb|config.cache|' that saves the
|
alpar@9
|
89 results of its tests to speed up reconfiguring, and a file
|
alpar@9
|
90 `\verb|config.log|' containing compiler output (useful mainly for
|
alpar@9
|
91 debugging `\verb|configure|').
|
alpar@9
|
92
|
alpar@9
|
93 Running `\verb|configure|' takes about a few minutes. While it is
|
alpar@9
|
94 running, it displays some informational messages that tell you what it
|
alpar@9
|
95 is doing. If you don't want to see these messages, run
|
alpar@9
|
96 `\verb|configure|' with its standard output redirected to
|
alpar@9
|
97 `\verb|dev/null|'; for example, `\verb|./configure > /dev/null|'.
|
alpar@9
|
98
|
alpar@9
|
99 By default both static and shared versions of the GLPK library will be
|
alpar@9
|
100 compiled. Compilation of the shared librariy can be turned off by
|
alpar@9
|
101 specifying the `\verb|--disable-shared|' option to `\verb|configure|',
|
alpar@9
|
102 e.g.
|
alpar@9
|
103
|
alpar@9
|
104 \begin{verbatim}
|
alpar@9
|
105 ./configure --disable-shared
|
alpar@9
|
106 \end{verbatim}
|
alpar@9
|
107
|
alpar@9
|
108 \noindent
|
alpar@9
|
109 If you encounter problems building the library try using the above
|
alpar@9
|
110 option, because some platforms do not support shared libraries.
|
alpar@9
|
111
|
alpar@9
|
112 \newpage
|
alpar@9
|
113
|
alpar@9
|
114 The GLPK package has some optional features listed below. By default
|
alpar@9
|
115 all these features are disabled. To enable a feature the corresponding
|
alpar@9
|
116 option should be passed to the configure script.
|
alpar@9
|
117
|
alpar@9
|
118 \bigskip
|
alpar@9
|
119
|
alpar@9
|
120 \noindent
|
alpar@9
|
121 \verb|--with-gmp | Enable using the GNU MP bignum library
|
alpar@9
|
122
|
alpar@9
|
123 \medskip
|
alpar@9
|
124
|
alpar@9
|
125 This feature allows the exact simplex solver to use the GNU MP bignum
|
alpar@9
|
126 library. If it is disabled, the exact simplex solver uses the GLPK
|
alpar@9
|
127 bignum module, which provides the same functionality as GNU MP, however,
|
alpar@9
|
128 it is much less efficient.
|
alpar@9
|
129
|
alpar@9
|
130 For details about the GNU MP bignum library see its web page at
|
alpar@9
|
131 \url{http://gmplib.org/}.
|
alpar@9
|
132
|
alpar@9
|
133 \bigskip
|
alpar@9
|
134
|
alpar@9
|
135 \noindent
|
alpar@9
|
136 \verb|--with-zlib |
|
alpar@9
|
137 Enable using the zlib data compression library
|
alpar@9
|
138
|
alpar@9
|
139 \medskip
|
alpar@9
|
140
|
alpar@9
|
141 This feature allows GLPK API routines and the stand-alone solver to
|
alpar@9
|
142 read and write compressed data files performing compression and
|
alpar@9
|
143 decompression ``on the fly'' (compressed data files are recognized by
|
alpar@9
|
144 suffix `\verb|.gz|' in the file name). It may be useful in case of
|
alpar@9
|
145 large MPS files to save the disk space.
|
alpar@9
|
146
|
alpar@9
|
147 For details about the zlib compression library see its web page at
|
alpar@9
|
148 \url{http://www.zlib.net/}.
|
alpar@9
|
149
|
alpar@9
|
150 \bigskip
|
alpar@9
|
151
|
alpar@9
|
152 \noindent
|
alpar@9
|
153 \verb|--enable-dl | The same as `\verb|--enable-dl=ltdl|'
|
alpar@9
|
154
|
alpar@9
|
155 \noindent
|
alpar@9
|
156 \verb|--enable-dl=ltdl | Enable shared library support (GNU)
|
alpar@9
|
157
|
alpar@9
|
158 \noindent
|
alpar@9
|
159 \verb|--enable-dl=dlfcn | Enable shared library support (POSIX)
|
alpar@9
|
160
|
alpar@9
|
161 \medskip
|
alpar@9
|
162
|
alpar@9
|
163 Currently this feature is only needed to provide dynamic linking to
|
alpar@9
|
164 ODBC and MySQL shared libraries (see below).
|
alpar@9
|
165
|
alpar@9
|
166 For details about the GNU shared library support see the manual at
|
alpar@9
|
167 \url{http://www.gnu.org/software/libtool/manual/}.
|
alpar@9
|
168
|
alpar@9
|
169 \bigskip
|
alpar@9
|
170
|
alpar@9
|
171 \noindent
|
alpar@9
|
172 \verb|--enable-odbc |
|
alpar@9
|
173 Enable using ODBC table driver (\verb|libiodbc|)
|
alpar@9
|
174
|
alpar@9
|
175 \noindent
|
alpar@9
|
176 \verb|--enable-odbc=unix |
|
alpar@9
|
177 Enable using ODBC table driver (\verb|libodbc|)
|
alpar@9
|
178
|
alpar@9
|
179 \medskip
|
alpar@9
|
180
|
alpar@9
|
181 This feature allows transmitting data between MathProg model objects
|
alpar@9
|
182 and relational databases accessed through ODBC.
|
alpar@9
|
183
|
alpar@9
|
184 For more details about this feature see the supplement ``Using Data
|
alpar@9
|
185 Tables in the GNU MathProg Modeling Language'' (\verb|doc/tables.pdf|).
|
alpar@9
|
186
|
alpar@9
|
187 \bigskip
|
alpar@9
|
188
|
alpar@9
|
189 \noindent
|
alpar@9
|
190 \verb|--enable-mysql |
|
alpar@9
|
191 Enable using MySQL table driver (\verb|libmysql|)
|
alpar@9
|
192
|
alpar@9
|
193 \medskip
|
alpar@9
|
194
|
alpar@9
|
195 This feature allows transmitting data between MathProg model objects
|
alpar@9
|
196 and MySQL relational databases.
|
alpar@9
|
197
|
alpar@9
|
198 For more details about this feature see the supplement ``Using Data
|
alpar@9
|
199 Tables in the GNU MathProg Modeling Language'' (\verb|doc/tables.pdf|).
|
alpar@9
|
200
|
alpar@9
|
201 \section{Compiling the package}
|
alpar@9
|
202
|
alpar@9
|
203 Normally, you can compile (build) the package by typing the command:
|
alpar@9
|
204
|
alpar@9
|
205 \begin{verbatim}
|
alpar@9
|
206 make
|
alpar@9
|
207 \end{verbatim}
|
alpar@9
|
208
|
alpar@9
|
209 \noindent
|
alpar@9
|
210 It reads `\verb|Makefile|' generated by `\verb|configure|' and performs
|
alpar@9
|
211 all necessary jobs.
|
alpar@9
|
212
|
alpar@9
|
213 If you want, you can override the `\verb|make|' variables \verb|CFLAGS|
|
alpar@9
|
214 and \verb|LDFLAGS| like this:
|
alpar@9
|
215
|
alpar@9
|
216 \begin{verbatim}
|
alpar@9
|
217 make CFLAGS=-O2 LDFLAGS=-s
|
alpar@9
|
218 \end{verbatim}
|
alpar@9
|
219
|
alpar@9
|
220 To compile the package in a different directory from the one containing
|
alpar@9
|
221 the source code, you must use a version of `\verb|make|' that supports
|
alpar@9
|
222 `\verb|VPATH|' variable, such as GNU `\verb|make|'. `\verb|cd|' to the
|
alpar@9
|
223 directory where you want the object files and executables to go and run
|
alpar@9
|
224 the `\verb|configure|' script. `\verb|configure|' automatically checks
|
alpar@9
|
225 for the source code in the directory that `\verb|configure|' is in and
|
alpar@9
|
226 in `\verb|..|'. If for some reason `\verb|configure|' is not in the
|
alpar@9
|
227 source code directory that you are configuring, then it will report that
|
alpar@9
|
228 it can't find the source code. In that case, run `\verb|configure|' with
|
alpar@9
|
229 the option `\verb|--srcdir=DIR|', where \verb|DIR| is the directory that
|
alpar@9
|
230 contains the source code.
|
alpar@9
|
231
|
alpar@9
|
232 Some systems require unusual options for compilation or linking that
|
alpar@9
|
233 the `\verb|configure|' script does not know about. You can give
|
alpar@9
|
234 `\verb|configure|' initial values for variables by setting them in the
|
alpar@9
|
235 environment. Using a Bourne-compatible shell, you can do that on the
|
alpar@9
|
236 command line like this:
|
alpar@9
|
237
|
alpar@9
|
238 \begin{verbatim}
|
alpar@9
|
239 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
alpar@9
|
240 \end{verbatim}
|
alpar@9
|
241
|
alpar@9
|
242 \noindent
|
alpar@9
|
243 Or on systems that have the `\verb|env|' program, you can do it like
|
alpar@9
|
244 this:
|
alpar@9
|
245
|
alpar@9
|
246 \begin{verbatim}
|
alpar@9
|
247 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
alpar@9
|
248 \end{verbatim}
|
alpar@9
|
249
|
alpar@9
|
250 Here are the `\verb|make|' variables that you might want to override
|
alpar@9
|
251 with environment variables when running `\verb|configure|'.
|
alpar@9
|
252
|
alpar@9
|
253 For these variables, any value given in the environment overrides the
|
alpar@9
|
254 value that `\verb|configure|' would choose:
|
alpar@9
|
255
|
alpar@9
|
256 \medskip
|
alpar@9
|
257
|
alpar@9
|
258 \noindent
|
alpar@9
|
259 \verb|CC | C compiler program. The default is `\verb|cc|'.
|
alpar@9
|
260
|
alpar@9
|
261 \medskip
|
alpar@9
|
262
|
alpar@9
|
263 \noindent
|
alpar@9
|
264 \verb|INSTALL | Program used to install files. The default value is
|
alpar@9
|
265 `\verb|install|' if
|
alpar@9
|
266
|
alpar@9
|
267 \noindent
|
alpar@9
|
268 \verb| | you have it, otherwise `\verb|cp|'.
|
alpar@9
|
269
|
alpar@9
|
270 \medskip
|
alpar@9
|
271
|
alpar@9
|
272 For these variables, any value given in the environment is added to the
|
alpar@9
|
273 value that `\verb|configure|' chooses:
|
alpar@9
|
274
|
alpar@9
|
275 \medskip
|
alpar@9
|
276
|
alpar@9
|
277 \noindent
|
alpar@9
|
278 \verb|DEFS | Configuration options, in the form
|
alpar@9
|
279 `\verb|-Dfoo -Dbar| \dots'.
|
alpar@9
|
280
|
alpar@9
|
281 \medskip
|
alpar@9
|
282
|
alpar@9
|
283 \noindent
|
alpar@9
|
284 \verb|LIBS | Libraries to link with, in the form
|
alpar@9
|
285 `\verb|-lfoo -lbar| \dots'.
|
alpar@9
|
286
|
alpar@9
|
287 \section{Checking the package}
|
alpar@9
|
288
|
alpar@9
|
289 To check the package, i.e. to run some tests included in the package,
|
alpar@9
|
290 you can use the following command:
|
alpar@9
|
291
|
alpar@9
|
292 \begin{verbatim}
|
alpar@9
|
293 make check
|
alpar@9
|
294 \end{verbatim}
|
alpar@9
|
295
|
alpar@9
|
296 \section{Installing the package}
|
alpar@9
|
297
|
alpar@9
|
298 Normally, to install the GLPK package you should type the following
|
alpar@9
|
299 command:
|
alpar@9
|
300
|
alpar@9
|
301 \begin{verbatim}
|
alpar@9
|
302 make install
|
alpar@9
|
303 \end{verbatim}
|
alpar@9
|
304
|
alpar@9
|
305 \noindent
|
alpar@9
|
306 By default, `\verb|make install|' will install the package's files in
|
alpar@9
|
307 `\verb|usr/local/bin|', `\verb|usr/local/lib|', etc. You can specify an
|
alpar@9
|
308 installation prefix other than `\verb|/usr/local|' by giving
|
alpar@9
|
309 `\verb|configure|' the option `\verb|--prefix=PATH|'. Alternately, you
|
alpar@9
|
310 can do so by consistently giving a value for the `\verb|prefix|'
|
alpar@9
|
311 variable when you run `\verb|make|', e.g.
|
alpar@9
|
312
|
alpar@9
|
313 \begin{verbatim}
|
alpar@9
|
314 make prefix=/usr/gnu
|
alpar@9
|
315 make prefix=/usr/gnu install
|
alpar@9
|
316 \end{verbatim}
|
alpar@9
|
317
|
alpar@9
|
318 After installing you can remove the program binaries and object files
|
alpar@9
|
319 from the source directory by typing `\verb|make clean|'. To remove all
|
alpar@9
|
320 files that `\verb|configure|' created (`\verb|Makefile|',
|
alpar@9
|
321 `\verb|config.status|', etc.), just type `\verb|make distclean|'.
|
alpar@9
|
322
|
alpar@9
|
323 The file `\verb|configure.ac|' is used to create `\verb|configure|' by
|
alpar@9
|
324 a program called `\verb|autoconf|'. You only need it if you want to
|
alpar@9
|
325 remake `\verb|configure|' using a newer version of `\verb|autoconf|'.
|
alpar@9
|
326
|
alpar@9
|
327 \section{Uninstalling the package}
|
alpar@9
|
328
|
alpar@9
|
329 To uninstall the GLPK package, i.e. to remove all the package's files
|
alpar@9
|
330 from the system places, you can use the following command:
|
alpar@9
|
331
|
alpar@9
|
332 \begin{verbatim}
|
alpar@9
|
333 make uninstall
|
alpar@9
|
334 \end{verbatim}
|
alpar@9
|
335
|
alpar@9
|
336 %* eof *%
|