The source code and dockerfile for the GSW2024 AI Lab.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

258 lines
8.7 KiB

4 weeks ago
  1. %* glpk07.tex *%
  2. \chapter{Installing GLPK on Your Computer}
  3. \label{install}
  4. \section{Downloading the distribution tarball}
  5. The distribution tarball of the most recent version of the GLPK
  6. package can be found on \url{http://ftp.gnu.org/gnu/glpk/} [via http]
  7. and \url{ftp://ftp.gnu.org/gnu/glpk/} [via FTP]. It can also be found
  8. on one of the FTP mirrors; see \url{http://www.gnu.org/prep/ftp.html}.
  9. Please use a mirror if possible.
  10. To make sure that the GLPK distribution tarball you have downloaded is
  11. intact you need to download the corresponding `\verb|.sig|' file and
  12. run a command like this:
  13. \begin{verbatim}
  14. gpg --verify glpk-4.38.tar.gz.sig
  15. \end{verbatim}
  16. \noindent
  17. If that command fails because you do not have the required public key,
  18. run the following command to import it:
  19. \begin{verbatim}
  20. gpg --keyserver keys.gnupg.net --recv-keys 5981E818
  21. \end{verbatim}
  22. \noindent
  23. and then re-run the previous command.
  24. \section{Unpacking the distribution tarball}
  25. The GLPK package (like all other GNU software) is distributed in the
  26. form of packed archive. This is one file named \verb|glpk-X.Y.tar.gz|,
  27. where {\it X} is the major version number and {\it Y} is the minor
  28. version number.
  29. In order to prepare the distribution for installation you need to copy
  30. the GLPK distribution file to a working subdirectory and then unpack
  31. and unarchive the distribution file with the following command:
  32. \begin{verbatim}
  33. tar zx < glpk-X.Y.tar
  34. \end{verbatim}
  35. \newpage
  36. \section{Configuring the package}
  37. After unpacking and unarchiving the GLPK distribution you should
  38. configure the package,\linebreak i.e. automatically tune it for your
  39. platform.
  40. Normally, you should just \verb|cd| to the subdirectory \verb|glpk-X.Y|
  41. and run the configure script, e.g.
  42. \begin{verbatim}
  43. ./configure
  44. \end{verbatim}
  45. The `\verb|configure|' shell script attempts to guess correct values
  46. for various system-dependent variables used during compilation. It uses
  47. those values to create a `\verb|Makefile|' in each directory of the
  48. package. It also creates file `\verb|config.h|' containing
  49. platform-dependent definitions. Finally, it creates a shell script
  50. `\verb|config.status|' that you can run in the future to recreate the
  51. current configuration, a file `\verb|config.cache|' that saves the
  52. results of its tests to speed up reconfiguring, and a file
  53. `\verb|config.log|' containing compiler output (useful mainly for
  54. debugging `\verb|configure|').
  55. Running `\verb|configure|' takes about a minute. While it is running,
  56. it displays some informational messages that tell you what it
  57. is doing. If you don't want to see these messages, run
  58. `\verb|configure|' with its standard output redirected to
  59. `\verb|dev/null|'; for example, `\verb|./configure > /dev/null|'.
  60. By default both static and shared versions of the GLPK library will be
  61. compiled. Compilation of the shared librariy can be turned off by
  62. specifying the `\verb|--disable-shared|' option to `\verb|configure|':
  63. \begin{verbatim}
  64. ./configure --disable-shared
  65. \end{verbatim}
  66. \noindent
  67. If you encounter problems building the library try using the above
  68. option, because some platforms do not support shared libraries.
  69. The GLPK package has some optional features listed below. By default
  70. all these features are disabled. To enable a feature the corresponding
  71. option should be passed to the configure script.
  72. \verb|--with-gmp | Enable using the GNU MP bignum library
  73. This feature allows the exact simplex solver to use the GNU MP bignum
  74. library. If it is disabled, the exact simplex solver uses the GLPK
  75. bignum module, which provides the same functionality as GNU MP, however,
  76. it is much less efficient.
  77. For details about the GNU MP bignum library see its web page at
  78. \url{http://gmplib.org/}.
  79. \verb|--enable-dl | The same as `\verb|--enable-dl=ltdl|'
  80. \verb|--enable-dl=ltdl | Enable shared library support (GNU)
  81. \verb|--enable-dl=dlfcn | Enable shared library support (POSIX)
  82. Currently this feature is only needed to provide dynamic linking to
  83. ODBC and MySQL shared libraries (see below).
  84. For details about the GNU shared library support see the manual at
  85. \url{http://www.gnu.org/software/libtool/manual/}.
  86. \verb|--enable-odbc |
  87. Enable using ODBC table driver (\verb|libiodbc|)
  88. \verb|--enable-odbc=unix |
  89. Enable using ODBC table driver (\verb|libodbc|)
  90. This feature allows transmitting data between MathProg model objects
  91. and relational databases accessed through ODBC.
  92. For more details about this feature see the supplement ``Using Data
  93. Tables in the GNU MathProg Modeling Language'' (\verb|doc/tables.pdf|).
  94. \verb|--enable-mysql |
  95. Enable using MySQL table driver (\verb|libmysql|)
  96. This feature allows transmitting data between MathProg model objects
  97. and MySQL relational databases.
  98. For more details about this feature see the supplement ``Using Data
  99. Tables in the GNU MathProg Modeling Language'' (\verb|doc/tables.pdf|).
  100. \section{Compiling the package}
  101. Normally, you can compile (build) the package by typing the command:
  102. \begin{verbatim}
  103. make
  104. \end{verbatim}
  105. \noindent
  106. It reads `\verb|Makefile|' generated by `\verb|configure|' and performs
  107. all necessary jobs.
  108. If you want, you can override the `\verb|make|' variables \verb|CFLAGS|
  109. and \verb|LDFLAGS| like this:
  110. \begin{verbatim}
  111. make CFLAGS=-O2 LDFLAGS=-s
  112. \end{verbatim}
  113. To compile the package in a different directory from the one containing
  114. the source code, you must use a version of `\verb|make|' that supports
  115. `\verb|VPATH|' variable, such as GNU `\verb|make|'. `\verb|cd|' to the
  116. directory where you want the object files and executables to go and run
  117. the `\verb|configure|' script. `\verb|configure|' automatically checks
  118. for the source code in the directory that `\verb|configure|' is in and
  119. in `\verb|..|'. If for some reason `\verb|configure|' is not in the
  120. source code directory that you are configuring, then it will report
  121. that it can't find the source code. In that case, run `\verb|configure|'
  122. with the option `\verb|--srcdir=DIR|', where \verb|DIR| is the
  123. directory that contains the source code.
  124. Some systems require unusual options for compilation or linking that
  125. the `\verb|configure|' script does not know about. You can give
  126. `\verb|configure|' initial values for variables by setting them in the
  127. environment. Using a Bourne-compatible shell, you can do that on the
  128. command line like this:
  129. \begin{verbatim}
  130. CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
  131. \end{verbatim}
  132. \noindent
  133. Or on systems that have the `\verb|env|' program, you can do it like
  134. this:
  135. \begin{verbatim}
  136. env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
  137. \end{verbatim}
  138. Here are the `\verb|make|' variables that you might want to override
  139. with environment variables when running `\verb|configure|'.
  140. For these variables, any value given in the environment overrides the
  141. value that `\verb|configure|' would choose:
  142. \verb|CC | C compiler program. The default is `\verb|cc|'.
  143. \verb|INSTALL | Program used to install files. The default value is
  144. `\verb|install|' if you have it,\\
  145. \verb| | otherwise `\verb|cp|'.
  146. For these variables, any value given in the environment is added to the
  147. value that `\verb|configure|' chooses:
  148. \verb|DEFS | Configuration options, in the form
  149. `\verb|-Dfoo -Dbar| \dots'.
  150. \verb|LIBS | Libraries to link with, in the form
  151. `\verb|-lfoo -lbar| \dots'.
  152. \section{Checking the package}
  153. To check the package, i.e. to run some tests included in the package,
  154. you can use the following command:
  155. \begin{verbatim}
  156. make check
  157. \end{verbatim}
  158. \section{Installing the package}
  159. Normally, to install the GLPK package you should type the following
  160. command:
  161. \begin{verbatim}
  162. make install
  163. \end{verbatim}
  164. \noindent
  165. By default, `\verb|make install|' will install the package's files in
  166. `\verb|usr/local/bin|', `\verb|usr/local/lib|', etc. You can specify an
  167. installation prefix other than `\verb|/usr/local|' by giving
  168. `\verb|configure|' the option `\verb|--prefix=PATH|'. Alternately, you
  169. can do so by consistently giving a value for the `\verb|prefix|'
  170. variable when you run `\verb|make|', e.g.
  171. \begin{verbatim}
  172. make prefix=/usr/gnu
  173. make prefix=/usr/gnu install
  174. \end{verbatim}
  175. After installing you can remove the program binaries and object files
  176. from the source directory by typing `\verb|make clean|'. To remove all
  177. files that `\verb|configure|' created (`\verb|Makefile|',
  178. `\verb|config.status|', etc.), just type `\verb|make distclean|'.
  179. The file `\verb|configure.ac|' is used to create `\verb|configure|' by
  180. a program called `\verb|autoconf|'. You only need it if you want to
  181. remake `\verb|configure|' using a newer version of `\verb|autoconf|'.
  182. \section{Uninstalling the package}
  183. To uninstall the GLPK package, i.e. to remove all the package's files
  184. from the system places, you can use the following command:
  185. \begin{verbatim}
  186. make uninstall
  187. \end{verbatim}
  188. %* eof *%