GNU R package glpkAPI: R Interface to C API of GLPK


The installation procedure for the glpkAPI package needs to know where to
find the GLPK include directory and where to find the callable library.


# ---------------------------------------------------------------------------- #
# Linux and MacOS X installation
# ---------------------------------------------------------------------------- #

There are basically three different ways of installing the glpkAPI package:

1) Use --with-glpk-<ARG>

   --with-glpk-include=PATH     with PATH being the include directory of GLPK

   --with-glpk-lib=PATH         with PATH being the directory containing the
                                callable library.

   R CMD INSTALL --configure-args=" \
       --with-glpk-include=/path/to/include/dir \
       --with-glpk-lib=/path/to/lib/dir" glpkAPI_X.X.X.tar.gz


   When using --with-glpk-<ARG>, both arguments must be given.

2) Use of environment variables

   PKG_CPPFLAGS                C preprocessor flags -I...

   PKG_LIBS                    libraries -l... -L...

3) Use --prefix

   --prefix=PATH               with path being the installation directory of
                               GLPK. The include directory is assumed to be
                               PATH/include and the callable library should be
                               in PATH/lib.

   If either --with-glpk-<ARG> nor --prefix is given, it is checked wether
   glpsol is in the PATH. If yes, PATH is used as prefix. If not,
   /usr/local/include and /usr/local/lib[64] and /usr/include and /usr/lib[64]
   are tested.


If one wants to use GNU BIGNUM in order to use glp_exact, use --enable-gmp
(default is set to yes).

The argument --enable-chkargs enables a mechanism checking column and row
indices, variable types and kinds given as arguments to glpkAPI functions.
If e.g. a desired column index does not exist, glpk will terminate abnormally,
which also will close the running R session. The --enable-chkarg options will
cause an overhead to the functions needing an index, because it checks if that
index is valid. This option is enabled by default.


# ---------------------------------------------------------------------------- #
# Windows installation
# ---------------------------------------------------------------------------- #

For the installation on Windows systems the file Makewars.win in src/ is
required. The file looks like this:

PKG_CPPFLAGS=-g -D_R_=1 -DUSE_R=1 -I${GLPK_HOME}/include -DCHECK_GLPK_ARGS
PKG_LIBS=-L${GLPK_HOME}/lib -lglpk -lgmp

with the environment variable GLPK_HOME being the installation directory
of GLPK and GNU BIGNUM.