INSTALLING GLPK ON YOUR COMPUTER
================================

Unpacking the distribution file
-------------------------------
The GLPK package (like all other GNU software) is distributed in the
form of a packed archive. It is one file named `glpk-X.Y.tar.gz', where
`X' is the major version number and `Y' is the minor version number;
for example, the archive name could be `glpk-4.15.tar.gz'.

In order to prepare the distribution for installation you should:

1. Copy the GLPK distribution file to a working directory.

2. Unpack the distribution file using the following command:

      gzip -d glpk-X.Y.tar.gz

   After unpacking the distribution file will be automatically renamed
   to `glpk-X.Y.tar'.

3. Unarchive the distribution using the following command:

      tar -x < glpk-X.Y.tar

   It will automatically create the subdirectory `glpk-X.Y' containing
   the GLPK distribution.

Configuring the package
-----------------------
After unpacking and unarchiving the GLPK distribution you should
configure the package, i.e. automatically tune it for your platform.

Normally, you should just `cd' to the directory `glpk-X.Y' and run the
`configure' script, e.g.

      ./configure

Note: If you are using `csh' on an old version of System V, you might
need to type `sh configure' instead to prevent `csh' from trying execute
`configure' itself.

The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').

Running `configure' takes about a few seconds. While it is running, it
displays some messages that tell you what it is doing. If you don't want
to see the messages, run `configure' with its standard output redirected
to `dev/null'; for example, `./configure > /dev/null'.

By default both static and shared versions of the GLPK library will be
compiled. Compilation of the shared librariy can be turned off by
specifying the `--disable-shared' option to `configure', e.g.

      ./configure --disable-shared

If you encounter problems building the library try using the above
option, because some platforms do not support shared libraries.

Compiling the package
---------------------
Normally, you can compile (build) the package by typing the command:

      make

It reads `Makefile' generated by `configure' and performs all necessary
jobs.

If you want, you can override the `make' variables CFLAGS and LDFLAGS
like this:

      make CFLAGS=-O2 LDFLAGS=-s

To compile the package in a different directory from the one containing
the source code, you must use a version of `make' that supports `VPATH'
variable, such as GNU `make'. `cd' to the directory where you want the
object files and executables to go and run the `configure' script.
`configure' automatically checks for the source code in the directory
that `configure' is in and in `..'. If for some reason `configure' is
not in the source code directory that you are configuring, then it will
report that it can't find the source code. In that case, run `configure'
with the option `--srcdir=DIR', where DIR is the directory that contains
the source code.

Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:

      CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure

Or on systems that have the `env' program, you can do it like this:

      env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure

Here are the `make' variables that you might want to override with
environment variables when running `configure'.

For these variables, any value given in the environment overrides the
value that `configure' would choose:

CC:      C compiler program. The default is `cc'.

INSTALL: Program used to install files. The default value is `install'
         if you have it, otherwise `cp'.

For these variables, any value given in the environment is added to the
value that `configure' chooses:

DEFS:    Configuration options, in the form `-Dfoo -Dbar ...'.

LIBS:    Libraries to link with, in the form `-lfoo -lbar ...'.

Checking the package
--------------------
To check the package, i.e. to run some tests included in the package,
you can use the following command:

      make check

Installing the package
----------------------
Normally, to install the GLPK package you should type the following
command:

      make install

By default, `make install' will install the package's files in
`usr/local/bin', `usr/local/lib', etc. You can specify an installation
prefix other than `/usr/local' by giving `configure' the option
`--prefix=PATH'. Alternately, you can do so by consistently giving a
value for the `prefix' variable when you run `make', e.g.

      make prefix=/usr/gnu
      make prefix=/usr/gnu install

After installing you can remove the program binaries and object files
from the source directory by typing `make clean'. To remove all files
that `configure' created (`Makefile', `config.status', etc.), just type
`make distclean'.

The file `configure.ac' is used to create `configure' by a program
called `autoconf'. You only need it if you want to remake `configure'
using a newer version of `autoconf'.

Uninstalling the package
------------------------
To uninstall the GLPK package, i.e. to remove all the package's files
from the system places, you can use the following command:

      make uninstall

========================================================================
