This is an autotools-based build system to build and install routines from the Harwell Subroutine Library (HSL). This installation of HSL routines is used by some other COIN-OR projects, in particular Ipopt.
For use by COIN-OR, STFC provides special packages at
https://licences.stfc.ac.uk/product/coin-hsl
which can be build independently or within the buildsystem in this directory.
Version 2021.05.05 of the Coin-HSL packages include single-precision versions of HSL routines. These are also compiled if found.
Alternatively, STFC provides a package that includes only the routines MA27, MA28, and MC19, but has more liberal license terms, at
https://licences.stfc.ac.uk/product/coin-hsl-archive
This Coin-HSL Archive package can also be used with ThirdParty-HSL.
Prebuild libraries with many HSL routines, including these from coin-hsl, are available at https://licences.stfc.ac.uk/products/Software/HSL/LibHSL.
-
HSL routines require a Fortran compiler. Some of them are written in Fortran 77, others in Fortran 90.
-
MA57, HSL_MA77, and HSL_MA86 require BLAS, HSL_MA97 requires LAPACK.
configurewill look for a LAPACK installation (and assume that it includes BLAS), but if that does not succeed, the flags to link with LAPACK should be specified with the--with-lapack-lflagsargument ofconfigure. -
MA57, HSL_MA77, HSL_MA97, and MC68 can use METIS.
configurewill look for a METIS library and header, but if that does not succeed, the arguments--with-metis-lflagsand--with-metis-cflagscan be specified forconfigure.Both Metis 4 and Metis 5 can be used with ThirdParty-HSL.
To install BLAS, LAPACK, and METIS on a standard Debian-based Linux distribution, e.g., Ubuntu:
apt install libblas-dev liblapack-dev libmetis-dev
-
Obtain a tarball with Coin-HSL source code from https://licences.stfc.ac.uk/product/coin-hsl.
Note: It is YOUR RESPONSIBILITY to ensure that you are entitled to download and use this third party package.
-
Inside the ThirdParty-HSL directory, unpack this tarball via
gunzip coinhsl-x.y.z.tar.gz tar xf coinhsl-x.y.z.tar -
Rename the directory
coinhsl-x.y.ztocoinhsl, or set a symbolic link:ln -s coinhsl-x.y.z coinhsl -
Run
./configure. Use./configure --helpto see available options.The
configurescript will detect which source files are available in yourcoinhslpackage and prepare theMakefileaccordingly. -
Run
maketo build the HSL library (namestemcoinhsl). -
Run
make installto install the HSL library and header files.
For Coin-HSL Archive, follow the above steps, but download from
https://licences.stfc.ac.uk/product/coin-hsl-archive and adjust the tarball
names accordingly. Make sure that the directory with the source files is
still called coinhsl.
If you intend for Ipopt to load the generated HSL library at runtime, then be aware that Ipopt looks for a library with a name different than the one build here: https://coin-or.github.io/Ipopt/OPTIONS.html#OPT_hsllib
You should thus either set option hsllib of Ipopt to the full path of
the library build here (e.g., $libdir/libcoinhsl.so, $libdir/libcoinhsl.dylib,
$bindir/coinhsl-2.dll), or rename the coinhsl library appropriately.
Do not do this if you intend to build Ipopt such that it links to the
coinhsl library.