⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 glpk07.tex

📁 著名的大规模线性规划求解器源码GLPK.C语言版本,可以修剪.内有详细帮助文档.
💻 TEX
字号:
%* glpk07.tex *%\chapter{Installing GLPK on Your Computer}\label{install}\section{Obtaining GLPK distribution file}The distrubution file for the most recent version of the GLPK packagecan be downloaded from $<$\verb|ftp://ftp.gnu.org/gnu/glpk/|$>$ or fromsome mirror GNU ftp sites; for details see$<$\verb|http://www.gnu.org/order/ftp.html|$>$.\section{Unpacking the distribution file}The GLPK package (like all other GNU software) is distributed in theform of packed archive. This is one file named \verb|glpk-x.y.tar.gz|,where {\it x} is the major version number and {\it y} is the minorversion number.In order to prepare the distribution for installation you should:1. Copy the GLPK distribution file to some subdirectory.2. Enter the command \verb|gzip -d glpk-x.y.tar.gz| in order to unpackthe distribution file. After unpacking the name of the distribution filewill be automatically changed to \verb|glpk-x.y.tar|.3. Enter the command \verb|tar -x < glpk-x.y.tar| in order to unarchivethe distribution. After this operation the subdirectory \verb|glpk-x.y|,which is the GLPK distribution, will be automatically created.\section{Configuring the package}After you have unpacked and unarchived GLPK distribution you shouldconfigure the package, i.e. automatically tune it for your computer(platform).Normally, you should just \verb|cd| to the subdirectory\verb|glpk-x.y| and enter the command \verb|./configure|. If you areusing \verb|csh| on an old version of System V, you might need to type\verb|sh configure| instead to prevent \verb|csh| from trying execute\verb|configure| itself.The \verb|configure| shell script attempts to guess correct values forvarious system-dependent variables used during compilation, and creates\verb|Makefile|. It also creates a file \verb|config.status| that youcan run in the future to recreate the current configuration.Running \verb|configure| takes about a few minutes. While it is running,it displays some informational messages that tell you what it is doing.If you don't want to see these messages, run \verb|configure| with itsstandard output redirected to \verb|dev/null|; for example,\verb|./configure >/dev/null|.\section{Compiling and checking the package}Normally, in order to compile the package you should just enter thecommand \verb|make|. This command reads \verb|Makefile| generated by\verb|configure| and automatically performs all necessary job.The result of compilation is:$\bullet$ the file \verb|libglpk.a|, which is a library archive thatcontains object code for all GLPK routines; and$\bullet$ the program \verb|glpsol|, which is a stand-alone LP/MIPsolver.If you want, you can override the \verb|make| variables \verb|CFLAGS|and \verb|LDFLAGS| like this:\verb|make CFLAGS=-O2 LDFLAGS=-s|To compile the package in a different directory from the one containingthe source code, you must use a version of \verb|make| that supports\verb|VPATH| variable, such as GNU make. \verb|cd| to the directorywhere you want the object files and executables to go and run the\verb|configure| script. \verb|configure| automatically checks for thesource code in the directory that \verb|configure| is in and in`\verb|..|'. If for some reason \verb|configure| is not in the sourcecode directory that you are configuring, then it will report that itcan't find the source code. In that case, run \verb|configure| with theoption \verb|--srcdir=DIR|, where \verb|DIR| is the directory thatcontains the source code.On systems that require unusual options for compilation or linking thepackage's \verb|configure| script does not know about, you can give\verb|configure| initial values for variables by setting them in theenvironment. In Bourne-compatible shells you can do that on the commandline like this:\verb|CC='gcc -traditional' LIBS=-lposix ./configure|Here are the \verb|make| variables that you might want to override withenvironment variables when running \verb|configure|.For these variables, any value given in the environment overrides thevalue that \verb|configure| would choose:$\bullet$ variable \verb|CC|: C compiler program. The default is\verb|cc|.$\bullet$ variable \verb|INSTALL|: program to use to install files. Thedefault value is \verb|install| if you have it, otherwise \verb|cp|.For these variables, any value given in the environment is added to thevalue that \verb|configure| chooses:$\bullet$ variable DEFS: configuration options, in the form`\verb|-Dfoo -Dbar| \dots'.$\bullet$ variable LIBS: libraries to link with, in the form`\verb|-lfoo -lbar| \dots'.In order to check the package (running some tests included in thedistribution) you can just enter the command \verb|make check|.\section{Installing the package}Normally, in order to install the GLPK package (i.e. copy GLPK library,header files, and the solver to the system places) you should just enterthe command \verb|make install| (note that you should be the root useror a superuser).By default, \verb|make install| will install the package's files inthe subdirectories \verb|usr/local/bin|, \verb|usr/local/lib|, etc. Youcan specify an installation prefix other than \verb|/usr/local| bygiving \verb|configure| the option \verb|--prefix=PATH|. Alternately,you can do so by consistently giving a value for the \verb|prefix|variable when you run \verb|make|, e.g.\verb|make prefix=/usr/gnu|\verb|make prefix=/usr/gnu install|After installing you can remove the program binaries and object filesfrom the source directory by typing \verb|make clean|. To remove allfiles that \verb|configure| created (\verb|Makefile|,\verb|config.status|, etc.), just type the command\verb|make distclean|.The file \verb|configure.in| is used to create \verb|configure| by aprogram called \verb|autoconf|. You only need it if you want to remake\verb|configure| using a newer version of \verb|autoconf|.\section{Uninstalling the package}In order to uninstall the GLPK package (i.e. delete all GLPK files fromthe system places) you can enter the command \verb|make uninstall|.%* eof *%

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -