INSTALL
author Alpar Juttner <alpar@cs.elte.hu>
Sun, 05 Dec 2010 17:35:23 +0100
changeset 2 4c8956a7bdf4
permissions -rw-r--r--
Set up CMAKE build environment
alpar@1
     1
INSTALLING GLPK ON YOUR COMPUTER
alpar@1
     2
********************************
alpar@1
     3
alpar@1
     4
Unpacking the distribution file
alpar@1
     5
-------------------------------
alpar@1
     6
The GLPK package (like all other GNU software) is distributed in the
alpar@1
     7
form of a packed archive. It is one file named `glpk-X.Y.tar.gz', where
alpar@1
     8
`X' is the major version number and `Y' is the minor version number;
alpar@1
     9
for example, the archive name might be `glpk-4.15.tar.gz'.
alpar@1
    10
alpar@1
    11
In order to prepare the distribution for installation you should:
alpar@1
    12
alpar@1
    13
1. Copy the GLPK distribution file to a working directory.
alpar@1
    14
alpar@1
    15
2. Unpack the distribution file with the following command:
alpar@1
    16
alpar@1
    17
      gzip -d glpk-X.Y.tar.gz
alpar@1
    18
alpar@1
    19
   After unpacking the distribution file is automatically renamed to
alpar@1
    20
   `glpk-X.Y.tar'.
alpar@1
    21
alpar@1
    22
3. Unarchive the distribution file with the following command:
alpar@1
    23
alpar@1
    24
      tar -x < glpk-X.Y.tar
alpar@1
    25
alpar@1
    26
   It automatically creates the subdirectory `glpk-X.Y' containing the
alpar@1
    27
   GLPK distribution.
alpar@1
    28
alpar@1
    29
Configuring the package
alpar@1
    30
-----------------------
alpar@1
    31
After unpacking and unarchiving the GLPK distribution you should
alpar@1
    32
configure the package, i.e. automatically tune it for your platform.
alpar@1
    33
alpar@1
    34
Normally, you should just `cd' to the directory `glpk-X.Y' and run the
alpar@1
    35
`configure' script, e.g.
alpar@1
    36
alpar@1
    37
      ./configure
alpar@1
    38
alpar@1
    39
The `configure' shell script attempts to guess correct values for
alpar@1
    40
various system-dependent variables used during compilation. It uses
alpar@1
    41
those values to create a `Makefile' in each directory of the package.
alpar@1
    42
It also creates file `config.h' containing platform-dependent
alpar@1
    43
definitions. Finally, it creates a shell script `config.status' that
alpar@1
    44
you can run in the future to recreate the current configuration, a file
alpar@1
    45
`config.cache' that saves the results of its tests to speed up
alpar@1
    46
reconfiguring, and a file `config.log' containing compiler output
alpar@1
    47
(useful mainly for debugging `configure').
alpar@1
    48
alpar@1
    49
Running `configure' takes about a few seconds. While it is running, it
alpar@1
    50
displays some messages that tell you what it is doing. If you don't want
alpar@1
    51
to see the messages, run `configure' with its standard output redirected
alpar@1
    52
to `dev/null'; for example, `./configure > /dev/null'.
alpar@1
    53
alpar@1
    54
By default both static and shared versions of the GLPK library will be
alpar@1
    55
compiled. Compilation of the shared librariy can be turned off by
alpar@1
    56
specifying the `--disable-shared' option to `configure', e.g.
alpar@1
    57
alpar@1
    58
      ./configure --disable-shared
alpar@1
    59
alpar@1
    60
If you encounter problems building the library try using the above
alpar@1
    61
option, because some platforms do not support shared libraries.
alpar@1
    62
alpar@1
    63
The GLPK package has some optional features listed below. By default
alpar@1
    64
all these features are disabled. To enable a feature the corresponding
alpar@1
    65
option should be passed to the configure script.
alpar@1
    66
alpar@1
    67
--with-gmp           Enable using the GNU MP bignum library
alpar@1
    68
alpar@1
    69
   This feature allows the exact simplex solver to use the GNU MP
alpar@1
    70
   bignum library. If it is disabled, the exact simplex solver uses the
alpar@1
    71
   GLPK bignum module, which provides the same functionality as GNU MP,
alpar@1
    72
   however, it is much less efficient.
alpar@1
    73
alpar@1
    74
   For details about the GNU MP bignum library see its web page at
alpar@1
    75
   <http://gmplib.org/>.
alpar@1
    76
alpar@1
    77
--with-zlib          Enable using the zlib data compression library
alpar@1
    78
alpar@1
    79
   This feature allows GLPK API routines and the stand-alone solver to
alpar@1
    80
   read and write compressed data files performing compression and
alpar@1
    81
   decompression "on the fly" (compressed data files are recognized by
alpar@1
    82
   suffix `.gz' in the file name). It may be useful in case of large
alpar@1
    83
   MPS files to save the disk space.
alpar@1
    84
alpar@1
    85
   For details about the zlib compression library see its web page at
alpar@1
    86
   <http://www.zlib.net/>.
alpar@1
    87
alpar@1
    88
--enable-dl          The same as --enable-dl=ltdl
alpar@1
    89
--enable-dl=ltdl     Enable shared library support (GNU)
alpar@1
    90
--enable-dl=dlfcn    Enable shared library support (POSIX)
alpar@1
    91
alpar@1
    92
   Currently this feature is only needed to provide dynamic linking to
alpar@1
    93
   ODBC and MySQL shared libraries (see below).
alpar@1
    94
alpar@1
    95
   For details about the GNU shared library support see the manual at
alpar@1
    96
   <http://www.gnu.org/software/libtool/manual/>.
alpar@1
    97
alpar@1
    98
--enable-odbc        Enable using ODBC table driver (libiodbc)
alpar@1
    99
--enable-odbc=unix   Enable using ODBC table driver (libodbc)
alpar@1
   100
alpar@1
   101
   This feature allows transmitting data between MathProg model objects
alpar@1
   102
   and relational databases accessed through ODBC.
alpar@1
   103
alpar@1
   104
   For more details about this feature see the supplement "Using Data
alpar@1
   105
   Tables in the GNU MathProg Modeling Language" (doc/tables.*).
alpar@1
   106
alpar@1
   107
--enable-mysql       Enable using MySQL table driver (libmysql)
alpar@1
   108
alpar@1
   109
   This feature allows transmitting data between MathProg model objects
alpar@1
   110
   and MySQL relational databases.
alpar@1
   111
alpar@1
   112
   For more details about this feature see the supplement "Using Data
alpar@1
   113
   Tables in the GNU MathProg Modeling Language" (doc/tables.*).
alpar@1
   114
alpar@1
   115
Compiling the package
alpar@1
   116
---------------------
alpar@1
   117
Normally, you can compile (build) the package by typing the command:
alpar@1
   118
alpar@1
   119
      make
alpar@1
   120
alpar@1
   121
It reads `Makefile' generated by `configure' and performs all necessary
alpar@1
   122
jobs.
alpar@1
   123
alpar@1
   124
If you want, you can override the `make' variables CFLAGS and LDFLAGS
alpar@1
   125
like this:
alpar@1
   126
alpar@1
   127
      make CFLAGS=-O2 LDFLAGS=-s
alpar@1
   128
alpar@1
   129
To compile the package in a different directory from the one containing
alpar@1
   130
the source code, you must use a version of `make' that supports `VPATH'
alpar@1
   131
variable, such as GNU `make'. `cd' to the directory where you want the
alpar@1
   132
object files and executables to go and run the `configure' script.
alpar@1
   133
`configure' automatically checks for the source code in the directory
alpar@1
   134
that `configure' is in and in `..'. If for some reason `configure' is
alpar@1
   135
not in the source code directory that you are configuring, then it will
alpar@1
   136
report that it can't find the source code. In that case, run `configure'
alpar@1
   137
with the option `--srcdir=DIR', where DIR is the directory that contains
alpar@1
   138
the source code.
alpar@1
   139
alpar@1
   140
Some systems require unusual options for compilation or linking that
alpar@1
   141
the `configure' script does not know about. You can give `configure'
alpar@1
   142
initial values for variables by setting them in the environment. Using
alpar@1
   143
a Bourne-compatible shell, you can do that on the command line like
alpar@1
   144
this:
alpar@1
   145
alpar@1
   146
      CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
alpar@1
   147
alpar@1
   148
Or on systems that have the `env' program, you can do it like this:
alpar@1
   149
alpar@1
   150
      env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
alpar@1
   151
alpar@1
   152
Here are the `make' variables that you might want to override with
alpar@1
   153
environment variables when running `configure'.
alpar@1
   154
alpar@1
   155
For these variables, any value given in the environment overrides the
alpar@1
   156
value that `configure' would choose:
alpar@1
   157
alpar@1
   158
CC:      C compiler program. The default is `cc'.
alpar@1
   159
alpar@1
   160
INSTALL: Program used to install files. The default value is `install'
alpar@1
   161
         if you have it, otherwise `cp'.
alpar@1
   162
alpar@1
   163
For these variables, any value given in the environment is added to the
alpar@1
   164
value that `configure' chooses:
alpar@1
   165
alpar@1
   166
DEFS:    Configuration options, in the form `-Dfoo -Dbar ...'.
alpar@1
   167
alpar@1
   168
LIBS:    Libraries to link with, in the form `-lfoo -lbar ...'.
alpar@1
   169
alpar@1
   170
Checking the package
alpar@1
   171
--------------------
alpar@1
   172
To check the package, i.e. to run some tests included in the package,
alpar@1
   173
you can use the following command:
alpar@1
   174
alpar@1
   175
      make check
alpar@1
   176
alpar@1
   177
Installing the package
alpar@1
   178
----------------------
alpar@1
   179
Normally, to install the GLPK package you should type the following
alpar@1
   180
command:
alpar@1
   181
alpar@1
   182
      make install
alpar@1
   183
alpar@1
   184
By default, `make install' will install the package's files in
alpar@1
   185
`usr/local/bin', `usr/local/lib', etc. You can specify an installation
alpar@1
   186
prefix other than `/usr/local' by giving `configure' the option
alpar@1
   187
`--prefix=PATH'. Alternately, you can do so by consistently giving a
alpar@1
   188
value for the `prefix' variable when you run `make', e.g.
alpar@1
   189
alpar@1
   190
      make prefix=/usr/gnu
alpar@1
   191
      make prefix=/usr/gnu install
alpar@1
   192
alpar@1
   193
After installing you can remove the program binaries and object files
alpar@1
   194
from the source directory by typing `make clean'. To remove all files
alpar@1
   195
that `configure' created (`Makefile', `config.status', etc.), just type
alpar@1
   196
`make distclean'.
alpar@1
   197
alpar@1
   198
The file `configure.ac' is used to create `configure' by a program
alpar@1
   199
called `autoconf'. You only need it if you want to remake `configure'
alpar@1
   200
using a newer version of `autoconf'.
alpar@1
   201
alpar@1
   202
Uninstalling the package
alpar@1
   203
------------------------
alpar@1
   204
To uninstall the GLPK package, i.e. to remove all the package's files
alpar@1
   205
from the system places, you can use the following command:
alpar@1
   206
alpar@1
   207
      make uninstall
alpar@1
   208
alpar@1
   209
========================================================================