doc/glpk07.tex
changeset 1 c445c931472f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/doc/glpk07.tex	Mon Dec 06 13:09:21 2010 +0100
     1.3 @@ -0,0 +1,336 @@
     1.4 +%* glpk07.tex *%
     1.5 +
     1.6 +\chapter{Installing GLPK on Your Computer}
     1.7 +\label{install}
     1.8 +
     1.9 +\section{Downloading the distribution tarball}
    1.10 +
    1.11 +The distribution tarball of the most recent version of the GLPK
    1.12 +package can be found on \url{http://ftp.gnu.org/gnu/glpk/} [via http]
    1.13 +and \url{ftp://ftp.gnu.org/gnu/glpk/} [via FTP]. It can also be found
    1.14 +on one of the FTP mirrors; see \url{http://www.gnu.org/prep/ftp.html}.
    1.15 +Please use a mirror if possible.
    1.16 +
    1.17 +To make sure that the GLPK distribution tarball you have downloaded is
    1.18 +intact you need to download the corresponding `\verb|.sig|' file and
    1.19 +run a command like this:
    1.20 +
    1.21 +\begin{verbatim}
    1.22 +   gpg --verify glpk-4.38.tar.gz.sig
    1.23 +\end{verbatim}
    1.24 +
    1.25 +\noindent
    1.26 +If that command fails because you do not have the required public key,
    1.27 +run the following command to import it:
    1.28 +
    1.29 +\begin{verbatim}
    1.30 +   gpg --keyserver keys.gnupg.net --recv-keys 5981E818
    1.31 +\end{verbatim}
    1.32 +
    1.33 +\noindent
    1.34 +and then re-run the previous command.
    1.35 +
    1.36 +\section{Unpacking the distribution tarball}
    1.37 +
    1.38 +The GLPK package (like all other GNU software) is distributed in the
    1.39 +form of packed archive. This is one file named \verb|glpk-X.Y.tar.gz|,
    1.40 +where {\it X} is the major version number and {\it Y} is the minor
    1.41 +version number.
    1.42 +
    1.43 +In order to prepare the distribution for installation you should:
    1.44 +
    1.45 +\medskip
    1.46 +
    1.47 +1. Copy the GLPK distribution file to a working subdirectory.
    1.48 +
    1.49 +\medskip
    1.50 +
    1.51 +2. Unpack the distribution file with the following command:
    1.52 +
    1.53 +\begin{verbatim}
    1.54 +   gzip -d glpk-X.Y.tar.gz
    1.55 +\end{verbatim}
    1.56 +
    1.57 +\noindent
    1.58 +that renames the distribution file to \verb|glpk-X.Y.tar|.
    1.59 +
    1.60 +\medskip
    1.61 +
    1.62 +3. Unarchive the distribution file with the following command:
    1.63 +
    1.64 +\begin{verbatim}
    1.65 +   tar -x < glpk-X.Y.tar
    1.66 +\end{verbatim}
    1.67 +
    1.68 +\noindent
    1.69 +that automatically creates the subdirectory \verb|glpk-X.Y| containing
    1.70 +the GLPK distribution.
    1.71 +
    1.72 +
    1.73 +\section{Configuring the package}
    1.74 +
    1.75 +After unpacking and unarchiving the GLPK distribution you should
    1.76 +configure the package, i.e. automatically tune it for your platform.
    1.77 +
    1.78 +Normally, you should just \verb|cd| to the subdirectory
    1.79 +\verb|glpk-X.Y| and run the configure script, e.g.
    1.80 +
    1.81 +\begin{verbatim}
    1.82 +   ./configure
    1.83 +\end{verbatim}
    1.84 +
    1.85 +The `\verb|configure|' shell script attempts to guess correct values
    1.86 +for various system-dependent variables used during compilation. It uses
    1.87 +those values to create a `\verb|Makefile|' in each directory of the
    1.88 +package. It also creates file `\verb|config.h|' containing
    1.89 +platform-dependent definitions. Finally, it creates a shell script
    1.90 +`\verb|config.status|' that you can run in the future to recreate the
    1.91 +current configuration, a file `\verb|config.cache|' that saves the
    1.92 +results of its tests to speed up reconfiguring, and a file
    1.93 +`\verb|config.log|' containing compiler output (useful mainly for
    1.94 +debugging `\verb|configure|').
    1.95 +
    1.96 +Running `\verb|configure|' takes about a few minutes. While it is
    1.97 +running, it displays some informational messages that tell you what it
    1.98 +is doing. If you don't want to see these messages, run
    1.99 +`\verb|configure|' with its standard output redirected to
   1.100 +`\verb|dev/null|'; for example, `\verb|./configure > /dev/null|'.
   1.101 +
   1.102 +By default both static and shared versions of the GLPK library will be
   1.103 +compiled. Compilation of the shared librariy can be turned off by
   1.104 +specifying the `\verb|--disable-shared|' option to `\verb|configure|',
   1.105 +e.g.
   1.106 +
   1.107 +\begin{verbatim}
   1.108 +   ./configure --disable-shared
   1.109 +\end{verbatim}
   1.110 +
   1.111 +\noindent
   1.112 +If you encounter problems building the library try using the above
   1.113 +option, because some platforms do not support shared libraries.
   1.114 +
   1.115 +\newpage
   1.116 +
   1.117 +The GLPK package has some optional features listed below. By default
   1.118 +all these features are disabled. To enable a feature the corresponding
   1.119 +option should be passed to the configure script.
   1.120 +
   1.121 +\bigskip
   1.122 +
   1.123 +\noindent
   1.124 +\verb|--with-gmp         | Enable using the GNU MP bignum library
   1.125 +
   1.126 +\medskip
   1.127 +
   1.128 +This feature allows the exact simplex solver to use the GNU MP bignum
   1.129 +library. If it is disabled, the exact simplex solver uses the GLPK
   1.130 +bignum module, which provides the same functionality as GNU MP, however,
   1.131 +it is much less efficient.
   1.132 +
   1.133 +For details about the GNU MP bignum library see its web page at
   1.134 +\url{http://gmplib.org/}.
   1.135 +
   1.136 +\bigskip
   1.137 +
   1.138 +\noindent
   1.139 +\verb|--with-zlib        |
   1.140 +Enable using the zlib data compression library
   1.141 +
   1.142 +\medskip
   1.143 +
   1.144 +This feature allows GLPK API routines and the stand-alone solver to
   1.145 +read and write compressed data files performing compression and
   1.146 +decompression ``on the fly'' (compressed data files are recognized by
   1.147 +suffix `\verb|.gz|' in the file name). It may be useful in case of
   1.148 +large MPS files to save the disk space.
   1.149 +
   1.150 +For details about the zlib compression library see its web page at
   1.151 +\url{http://www.zlib.net/}.
   1.152 +
   1.153 +\bigskip
   1.154 +
   1.155 +\noindent
   1.156 +\verb|--enable-dl        | The same as `\verb|--enable-dl=ltdl|'
   1.157 +
   1.158 +\noindent
   1.159 +\verb|--enable-dl=ltdl   | Enable shared library support (GNU)
   1.160 +
   1.161 +\noindent
   1.162 +\verb|--enable-dl=dlfcn  | Enable shared library support (POSIX)
   1.163 +
   1.164 +\medskip
   1.165 +
   1.166 +Currently this feature is only needed to provide dynamic linking to
   1.167 +ODBC and MySQL shared libraries (see below).
   1.168 +
   1.169 +For details about the GNU shared library support see the manual at
   1.170 +\url{http://www.gnu.org/software/libtool/manual/}.
   1.171 +
   1.172 +\bigskip
   1.173 +
   1.174 +\noindent
   1.175 +\verb|--enable-odbc      |
   1.176 +Enable using ODBC table driver (\verb|libiodbc|)
   1.177 +
   1.178 +\noindent
   1.179 +\verb|--enable-odbc=unix |
   1.180 +Enable using ODBC table driver (\verb|libodbc|)
   1.181 +
   1.182 +\medskip
   1.183 +
   1.184 +This feature allows transmitting data between MathProg model objects
   1.185 +and relational databases accessed through ODBC.
   1.186 +
   1.187 +For more details about this feature see the supplement ``Using Data
   1.188 +Tables in the GNU MathProg Modeling Language'' (\verb|doc/tables.pdf|).
   1.189 +
   1.190 +\bigskip
   1.191 +
   1.192 +\noindent
   1.193 +\verb|--enable-mysql     |
   1.194 +Enable using MySQL table driver (\verb|libmysql|)
   1.195 +
   1.196 +\medskip
   1.197 +
   1.198 +This feature allows transmitting data between MathProg model objects
   1.199 +and MySQL relational databases.
   1.200 +
   1.201 +For more details about this feature see the supplement ``Using Data
   1.202 +Tables in the GNU MathProg Modeling Language'' (\verb|doc/tables.pdf|).
   1.203 +
   1.204 +\section{Compiling the package}
   1.205 +
   1.206 +Normally, you can compile (build) the package by typing the command:
   1.207 +
   1.208 +\begin{verbatim}
   1.209 +   make
   1.210 +\end{verbatim}
   1.211 +
   1.212 +\noindent
   1.213 +It reads `\verb|Makefile|' generated by `\verb|configure|' and performs
   1.214 +all necessary jobs.
   1.215 +
   1.216 +If you want, you can override the `\verb|make|' variables \verb|CFLAGS|
   1.217 +and \verb|LDFLAGS| like this:
   1.218 +
   1.219 +\begin{verbatim}
   1.220 +   make CFLAGS=-O2 LDFLAGS=-s
   1.221 +\end{verbatim}
   1.222 +
   1.223 +To compile the package in a different directory from the one containing
   1.224 +the source code, you must use a version of `\verb|make|' that supports
   1.225 +`\verb|VPATH|' variable, such as GNU `\verb|make|'. `\verb|cd|' to the
   1.226 +directory where you want the object files and executables to go and run
   1.227 +the `\verb|configure|' script. `\verb|configure|' automatically checks
   1.228 +for the source code in the directory that `\verb|configure|' is in and
   1.229 +in `\verb|..|'. If for some reason `\verb|configure|' is not in the
   1.230 +source code directory that you are configuring, then it will report that
   1.231 +it can't find the source code. In that case, run `\verb|configure|' with
   1.232 +the option `\verb|--srcdir=DIR|', where \verb|DIR| is the directory that
   1.233 +contains the source code.
   1.234 +
   1.235 +Some systems require unusual options for compilation or linking that
   1.236 +the `\verb|configure|' script does not know about. You can give
   1.237 +`\verb|configure|' initial values for variables by setting them in the
   1.238 +environment. Using a Bourne-compatible shell, you can do that on the
   1.239 +command line like this:
   1.240 +
   1.241 +\begin{verbatim}
   1.242 +   CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
   1.243 +\end{verbatim}
   1.244 +
   1.245 +\noindent
   1.246 +Or on systems that have the `\verb|env|' program, you can do it like
   1.247 +this:
   1.248 +
   1.249 +\begin{verbatim}
   1.250 +   env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
   1.251 +\end{verbatim}
   1.252 +
   1.253 +Here are the `\verb|make|' variables that you might want to override
   1.254 +with environment variables when running `\verb|configure|'.
   1.255 +
   1.256 +For these variables, any value given in the environment overrides the
   1.257 +value that `\verb|configure|' would choose:
   1.258 +
   1.259 +\medskip
   1.260 +
   1.261 +\noindent
   1.262 +\verb|CC      | C compiler program. The default is `\verb|cc|'.
   1.263 +
   1.264 +\medskip
   1.265 +
   1.266 +\noindent
   1.267 +\verb|INSTALL | Program used to install files. The default value is
   1.268 +`\verb|install|' if
   1.269 +
   1.270 +\noindent
   1.271 +\verb|        | you have it, otherwise `\verb|cp|'.
   1.272 +
   1.273 +\medskip
   1.274 +
   1.275 +For these variables, any value given in the environment is added to the
   1.276 +value that `\verb|configure|' chooses:
   1.277 +
   1.278 +\medskip
   1.279 +
   1.280 +\noindent
   1.281 +\verb|DEFS    | Configuration options, in the form
   1.282 +`\verb|-Dfoo -Dbar| \dots'.
   1.283 +
   1.284 +\medskip
   1.285 +
   1.286 +\noindent
   1.287 +\verb|LIBS    | Libraries to link with, in the form
   1.288 +`\verb|-lfoo -lbar| \dots'.
   1.289 +
   1.290 +\section{Checking the package}
   1.291 +
   1.292 +To check the package, i.e. to run some tests included in the package,
   1.293 +you can use the following command:
   1.294 +
   1.295 +\begin{verbatim}
   1.296 +   make check
   1.297 +\end{verbatim}
   1.298 +
   1.299 +\section{Installing the package}
   1.300 +
   1.301 +Normally, to install the GLPK package you should type the following
   1.302 +command:
   1.303 +
   1.304 +\begin{verbatim}
   1.305 +   make install
   1.306 +\end{verbatim}
   1.307 +
   1.308 +\noindent
   1.309 +By default, `\verb|make install|' will install the package's files in
   1.310 +`\verb|usr/local/bin|', `\verb|usr/local/lib|', etc. You can specify an
   1.311 +installation prefix other than `\verb|/usr/local|' by giving
   1.312 +`\verb|configure|' the option `\verb|--prefix=PATH|'. Alternately, you
   1.313 +can do so by consistently giving a value for the `\verb|prefix|'
   1.314 +variable when you run `\verb|make|', e.g.
   1.315 +
   1.316 +\begin{verbatim}
   1.317 +   make prefix=/usr/gnu
   1.318 +   make prefix=/usr/gnu install
   1.319 +\end{verbatim}
   1.320 +
   1.321 +After installing you can remove the program binaries and object files
   1.322 +from the source directory by typing `\verb|make clean|'. To remove all
   1.323 +files that `\verb|configure|' created (`\verb|Makefile|',
   1.324 +`\verb|config.status|', etc.), just type `\verb|make distclean|'.
   1.325 +
   1.326 +The file `\verb|configure.ac|' is used to create `\verb|configure|' by
   1.327 +a program called `\verb|autoconf|'. You only need it if you want to
   1.328 +remake `\verb|configure|' using a newer version of `\verb|autoconf|'.
   1.329 +
   1.330 +\section{Uninstalling the package}
   1.331 +
   1.332 +To uninstall the GLPK package, i.e. to remove all the package's files
   1.333 +from the system places, you can use the following command:
   1.334 +
   1.335 +\begin{verbatim}
   1.336 +   make uninstall
   1.337 +\end{verbatim}
   1.338 +
   1.339 +%* eof *%