
alpar@1: %* glpk07.tex *%
alpar@1: 
alpar@1: \chapter{Installing GLPK on Your Computer}
alpar@1: \label{install}
alpar@1: 
alpar@1: \section{Downloading the distribution tarball}
alpar@1: 
alpar@1: The distribution tarball of the most recent version of the GLPK
alpar@1: package can be found on \url{http://ftp.gnu.org/gnu/glpk/} [via http]
alpar@1: and \url{ftp://ftp.gnu.org/gnu/glpk/} [via FTP]. It can also be found
alpar@1: on one of the FTP mirrors; see \url{http://www.gnu.org/prep/ftp.html}.
alpar@1: Please use a mirror if possible.
alpar@1: 
alpar@1: To make sure that the GLPK distribution tarball you have downloaded is
alpar@1: intact you need to download the corresponding `\verb|.sig|' file and
alpar@1: run a command like this:
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    gpg --verify glpk-4.38.tar.gz.sig
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: \noindent
alpar@1: If that command fails because you do not have the required public key,
alpar@1: run the following command to import it:
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    gpg --keyserver keys.gnupg.net --recv-keys 5981E818
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: \noindent
alpar@1: and then re-run the previous command.
alpar@1: 
alpar@1: \section{Unpacking the distribution tarball}
alpar@1: 
alpar@1: The GLPK package (like all other GNU software) is distributed in the
alpar@1: form of packed archive. This is one file named \verb|glpk-X.Y.tar.gz|,
alpar@1: where {\it X} is the major version number and {\it Y} is the minor
alpar@1: version number.
alpar@1: 
alpar@1: In order to prepare the distribution for installation you should:
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: 1. Copy the GLPK distribution file to a working subdirectory.
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: 2. Unpack the distribution file with the following command:
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    gzip -d glpk-X.Y.tar.gz
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: \noindent
alpar@1: that renames the distribution file to \verb|glpk-X.Y.tar|.
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: 3. Unarchive the distribution file with the following command:
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    tar -x < glpk-X.Y.tar
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: \noindent
alpar@1: that automatically creates the subdirectory \verb|glpk-X.Y| containing
alpar@1: the GLPK distribution.
alpar@1: 
alpar@1: 
alpar@1: \section{Configuring the package}
alpar@1: 
alpar@1: After unpacking and unarchiving the GLPK distribution you should
alpar@1: configure the package, i.e. automatically tune it for your platform.
alpar@1: 
alpar@1: Normally, you should just \verb|cd| to the subdirectory
alpar@1: \verb|glpk-X.Y| and run the configure script, e.g.
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    ./configure
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: The `\verb|configure|' shell script attempts to guess correct values
alpar@1: for various system-dependent variables used during compilation. It uses
alpar@1: those values to create a `\verb|Makefile|' in each directory of the
alpar@1: package. It also creates file `\verb|config.h|' containing
alpar@1: platform-dependent definitions. Finally, it creates a shell script
alpar@1: `\verb|config.status|' that you can run in the future to recreate the
alpar@1: current configuration, a file `\verb|config.cache|' that saves the
alpar@1: results of its tests to speed up reconfiguring, and a file
alpar@1: `\verb|config.log|' containing compiler output (useful mainly for
alpar@1: debugging `\verb|configure|').
alpar@1: 
alpar@1: Running `\verb|configure|' takes about a few minutes. While it is
alpar@1: running, it displays some informational messages that tell you what it
alpar@1: is doing. If you don't want to see these messages, run
alpar@1: `\verb|configure|' with its standard output redirected to
alpar@1: `\verb|dev/null|'; for example, `\verb|./configure > /dev/null|'.
alpar@1: 
alpar@1: By default both static and shared versions of the GLPK library will be
alpar@1: compiled. Compilation of the shared librariy can be turned off by
alpar@1: specifying the `\verb|--disable-shared|' option to `\verb|configure|',
alpar@1: e.g.
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    ./configure --disable-shared
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: \noindent
alpar@1: If you encounter problems building the library try using the above
alpar@1: option, because some platforms do not support shared libraries.
alpar@1: 
alpar@1: \newpage
alpar@1: 
alpar@1: The GLPK package has some optional features listed below. By default
alpar@1: all these features are disabled. To enable a feature the corresponding
alpar@1: option should be passed to the configure script.
alpar@1: 
alpar@1: \bigskip
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|--with-gmp         | Enable using the GNU MP bignum library
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: This feature allows the exact simplex solver to use the GNU MP bignum
alpar@1: library. If it is disabled, the exact simplex solver uses the GLPK
alpar@1: bignum module, which provides the same functionality as GNU MP, however,
alpar@1: it is much less efficient.
alpar@1: 
alpar@1: For details about the GNU MP bignum library see its web page at
alpar@1: \url{http://gmplib.org/}.
alpar@1: 
alpar@1: \bigskip
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|--with-zlib        |
alpar@1: Enable using the zlib data compression library
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: This feature allows GLPK API routines and the stand-alone solver to
alpar@1: read and write compressed data files performing compression and
alpar@1: decompression ``on the fly'' (compressed data files are recognized by
alpar@1: suffix `\verb|.gz|' in the file name). It may be useful in case of
alpar@1: large MPS files to save the disk space.
alpar@1: 
alpar@1: For details about the zlib compression library see its web page at
alpar@1: \url{http://www.zlib.net/}.
alpar@1: 
alpar@1: \bigskip
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|--enable-dl        | The same as `\verb|--enable-dl=ltdl|'
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|--enable-dl=ltdl   | Enable shared library support (GNU)
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|--enable-dl=dlfcn  | Enable shared library support (POSIX)
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: Currently this feature is only needed to provide dynamic linking to
alpar@1: ODBC and MySQL shared libraries (see below).
alpar@1: 
alpar@1: For details about the GNU shared library support see the manual at
alpar@1: \url{http://www.gnu.org/software/libtool/manual/}.
alpar@1: 
alpar@1: \bigskip
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|--enable-odbc      |
alpar@1: Enable using ODBC table driver (\verb|libiodbc|)
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|--enable-odbc=unix |
alpar@1: Enable using ODBC table driver (\verb|libodbc|)
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: This feature allows transmitting data between MathProg model objects
alpar@1: and relational databases accessed through ODBC.
alpar@1: 
alpar@1: For more details about this feature see the supplement ``Using Data
alpar@1: Tables in the GNU MathProg Modeling Language'' (\verb|doc/tables.pdf|).
alpar@1: 
alpar@1: \bigskip
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|--enable-mysql     |
alpar@1: Enable using MySQL table driver (\verb|libmysql|)
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: This feature allows transmitting data between MathProg model objects
alpar@1: and MySQL relational databases.
alpar@1: 
alpar@1: For more details about this feature see the supplement ``Using Data
alpar@1: Tables in the GNU MathProg Modeling Language'' (\verb|doc/tables.pdf|).
alpar@1: 
alpar@1: \section{Compiling the package}
alpar@1: 
alpar@1: Normally, you can compile (build) the package by typing the command:
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    make
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: \noindent
alpar@1: It reads `\verb|Makefile|' generated by `\verb|configure|' and performs
alpar@1: all necessary jobs.
alpar@1: 
alpar@1: If you want, you can override the `\verb|make|' variables \verb|CFLAGS|
alpar@1: and \verb|LDFLAGS| like this:
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    make CFLAGS=-O2 LDFLAGS=-s
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: To compile the package in a different directory from the one containing
alpar@1: the source code, you must use a version of `\verb|make|' that supports
alpar@1: `\verb|VPATH|' variable, such as GNU `\verb|make|'. `\verb|cd|' to the
alpar@1: directory where you want the object files and executables to go and run
alpar@1: the `\verb|configure|' script. `\verb|configure|' automatically checks
alpar@1: for the source code in the directory that `\verb|configure|' is in and
alpar@1: in `\verb|..|'. If for some reason `\verb|configure|' is not in the
alpar@1: source code directory that you are configuring, then it will report that
alpar@1: it can't find the source code. In that case, run `\verb|configure|' with
alpar@1: the option `\verb|--srcdir=DIR|', where \verb|DIR| is the directory that
alpar@1: contains the source code.
alpar@1: 
alpar@1: Some systems require unusual options for compilation or linking that
alpar@1: the `\verb|configure|' script does not know about. You can give
alpar@1: `\verb|configure|' initial values for variables by setting them in the
alpar@1: environment. Using a Bourne-compatible shell, you can do that on the
alpar@1: command line like this:
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: \noindent
alpar@1: Or on systems that have the `\verb|env|' program, you can do it like
alpar@1: this:
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: Here are the `\verb|make|' variables that you might want to override
alpar@1: with environment variables when running `\verb|configure|'.
alpar@1: 
alpar@1: For these variables, any value given in the environment overrides the
alpar@1: value that `\verb|configure|' would choose:
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|CC      | C compiler program. The default is `\verb|cc|'.
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|INSTALL | Program used to install files. The default value is
alpar@1: `\verb|install|' if
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|        | you have it, otherwise `\verb|cp|'.
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: For these variables, any value given in the environment is added to the
alpar@1: value that `\verb|configure|' chooses:
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|DEFS    | Configuration options, in the form
alpar@1: `\verb|-Dfoo -Dbar| \dots'.
alpar@1: 
alpar@1: \medskip
alpar@1: 
alpar@1: \noindent
alpar@1: \verb|LIBS    | Libraries to link with, in the form
alpar@1: `\verb|-lfoo -lbar| \dots'.
alpar@1: 
alpar@1: \section{Checking the package}
alpar@1: 
alpar@1: To check the package, i.e. to run some tests included in the package,
alpar@1: you can use the following command:
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    make check
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: \section{Installing the package}
alpar@1: 
alpar@1: Normally, to install the GLPK package you should type the following
alpar@1: command:
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    make install
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: \noindent
alpar@1: By default, `\verb|make install|' will install the package's files in
alpar@1: `\verb|usr/local/bin|', `\verb|usr/local/lib|', etc. You can specify an
alpar@1: installation prefix other than `\verb|/usr/local|' by giving
alpar@1: `\verb|configure|' the option `\verb|--prefix=PATH|'. Alternately, you
alpar@1: can do so by consistently giving a value for the `\verb|prefix|'
alpar@1: variable when you run `\verb|make|', e.g.
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    make prefix=/usr/gnu
alpar@1:    make prefix=/usr/gnu install
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: After installing you can remove the program binaries and object files
alpar@1: from the source directory by typing `\verb|make clean|'. To remove all
alpar@1: files that `\verb|configure|' created (`\verb|Makefile|',
alpar@1: `\verb|config.status|', etc.), just type `\verb|make distclean|'.
alpar@1: 
alpar@1: The file `\verb|configure.ac|' is used to create `\verb|configure|' by
alpar@1: a program called `\verb|autoconf|'. You only need it if you want to
alpar@1: remake `\verb|configure|' using a newer version of `\verb|autoconf|'.
alpar@1: 
alpar@1: \section{Uninstalling the package}
alpar@1: 
alpar@1: To uninstall the GLPK package, i.e. to remove all the package's files
alpar@1: from the system places, you can use the following command:
alpar@1: 
alpar@1: \begin{verbatim}
alpar@1:    make uninstall
alpar@1: \end{verbatim}
alpar@1: 
alpar@1: %* eof *%




