[Project-managers] BuildTools: ThirdParty support for Glpk

Lou Hafer lou at cs.sfu.ca
Wed Jul 25 21:12:58 EDT 2007


Folks,

	Courtesy of Stefan Vigerske, we now have `ThirdParty' support for
Glpk in BuildTools. If your project uses glpk, you should make this change.
It does not interfere with the existing `user library' mechanism (i.e., the
configure options --with-glpk-lib and --with-glpk-incdir) and allows your
project to take advantage of ThirdParty/Glpk when it's available.

	You'll need to make a few changes in your configure.ac files. (Look
at Osi/trunk for an example.) For project `Project', there are two steps.

	First, in the top-level configure.ac file, add the line

AC_COIN_THIRDPARTY_SUBDIRS([Glpk],[ThirdParty/Glpk],[glpk/src/glplpx01.c])

This should precede any occurrences of AC_COIN_MAIN_SUBDIRS, so that
configuration of the ThirdParty/Glpk directory occurs before configuration of
other Coin projects. If ThirdParty/Glpk does not exist, or glpk's code has
not been downloaded, this check will fail and the ThirdParty version of glpk
will not be used.

	Then, in Project/configure.ac, add the line

AC_COIN_HAS_GLPK(Glpk)

in place of

AC_COIN_HAS_USER_LIBRARY([Glpk],[GLPK],[glpk.h],
			 [glp_lpx_simplex _glp_lpx_simplex])

Then execute BuildTools/run_autotools. At this point, your project is ready
for ThirdParty/Glpk, but nothing will change until ThirdParty/Glpk is pulled
in as an external dependency. If you want to put a line in your Externals
file and change svn:externals, the appropriate line is

ThirdParty/Glpk 
https://projects.coin-or.org/svn/BuildTools/ThirdParty/Glpk/trunk

(All one line, in case your mailer has broken it, as mine does.)

As with other ThirdParty support, it's the user's responsibility to download
the third-party code. The shell script get.Glpk handles this. Once the glpk
code is present, configuration and build will occur along with other Coin
projects.

ThirdParty support is overriden by the existing `User Library' support
If you specify the --with-glpk-lib and --with-glpk-incdir parameters to
configure, configuration and build will ignore ThirdParty/Glpk and use the
version of glpk that you've specified.

A final detail: The Glpk package actually contains two components, the glpk
solver and the gmpl modelling language. CoinUtils makes use of Gmpl. If your
project makes use of Gmpl, AC_COIN_HAS_GLPK(Gmpl) will do the right things.
Look at the CoinUtils configuration files for an example.

						Lou



More information about the Project-managers mailing list