HQP  1.9.7
Installation

Overview

This source code distribution uses the GNU autoconf/make mechanism.

HQP can be compiled and tested by invoking:
$ ./configure
$ make

Basically two libraries are built: hqp and omu. Furthermore an example is created in ./hqp_docp, testing HQP alone, and a demo collection in ./odc, testing HQP together with the front-end Omuses.

An up-to-date reference documentation can be created from the sources using Doxygen with
$ make doc

The results of make (object codes, lib, executables) can be removed with
$ make clean

The results of make and configure (makefiles) can removed with
$ make distclean

Installation details

Required software

The compilation of HQP relies on the following software:

  • an sh-compatible command interpreter (see IEEE POSIX Shell and Tools spec)
  • GNU make
  • a compiler for C, C++ and optionally Fortran 77

Moreover, HQP uses the Tool Command Language

  • Tcl version 8.1 or higher (typically packages tcl for the runtime and tcl-dev for include files)

Detailed installation steps

  1. Unpack the distribution file by invoking
    tar -xzf hqp<version>.tar.gz
    This creates the new directory hqp containing everything.

  2. cd to the created directory and invoke
    ./configure
    This creates the files ./makedirs, ./makedefs ./odc/Makefile, ./hqp_docp/Makefile, lib/pkgIndex.tcl, and ./doc/Doxyfile. Following options can be specified:

    Feature options:

    --enable-adolc
    Include code that uses ADOL-C for automatic differentiation as part of Omuses. This simplifies the manual implementation of optimization programs. See the Odc demo collection, e.g. ./odc/Prg_BatchReactor.[hC] using ADOL-C vs. ./odc/Prg_BatchReactor_bare.[hC] accessing lower level interfaces.
    Additionally you may specify:
    --with-adolc
    Directory prefix of ADOL-C installation, e.g.
    --with-adolc=/usr
    --enable-fortran
    Include the numerical integration routines RKsuite and optionally DASPK with libomu (see also daspk/README). This requires an f77 compiler on your machine. Note: The automatic settings done by ./configure are for gfortran. Please check the variables FORTRAN_* in ./makedefs.
    --enable-mex
    Include MEX S-function interface with Omuses. This requires MATLAB® and Simulink® on your machine for include files declaring data structures and for runtime libs implementing mxArray.
    Additionally you may specify:
    --with-matlab
    Root directory of MATLAB® installation, e.g.
    --with-matlab=/usr/local/matlab
    --with-matlab-libs
    Directory containing MATLAB® runtime libraries, e.g.
    --with-matlab-libs=/usr/local/matlab/extern/lib/glnx86
    --enable-cute
    Include CUTE interface with HQP.
    --enable-ascend
    Include current preliminary version of an interface to Ascend4. This requires that this distribution is unpacked in the directory of the Ascend distribution, e.g. in /home/myname/ascendiv-0.9 (for Ascend see http://www.cs.cmu.edu/~ascend/Home.html)

    Installation options:

    --prefix=PATH
    Path where you'd like to install the libraries and include files (default is /usr/local).

    Build options:

    --disable-shared (--enable-shared)
    Build shared (static) libraries. Shared is default, except for Windows, where building a DLL is somewhat tricky. Shared libraries are required if Hqp/Omuses shall be used as package extending a Tcl application.
    --enable-symbols
    build debug version, including symbolic information
    --enable-gmalloc
    Use GNU malloc instead of the system routines. Gmalloc will be enabled automatically if your system malloc doesn't work properly (e.g. under DEC OSF). According to the authors experience gmalloc doesn't work on all machines, but fortunately it does where it's needed :-)

    Use a specific Tcl installation, which is not found automatically:

    --with-tcl
    Directory containing Tcl configuration file tclConfig.sh, e.g.
    --with-tcl=/usr/local/lib
    --with-tclinclude
    Directory containing include file tcl.h.

  3. Compile the distribution by invoking
    make
    (or
    make -f Makefile.hqp
    to skip building Omuses and Odc)

  4. Directly after compilation, a test run of an example in ./odc is performed automatically that should produce the result "optimal". Some more examples are given in ./odc (please see also the documentation in ./doc).

  5. Optionally install the libraries and includes by invoking
    make install
    The following directories and files are created:

         $prefix / lib     / Hqp<version> / pkgIndex.tcl
                           / libhqp-<version>.so
                           / libomu-<version>.so
                           / libhqp.so -> libhqp-<version>.so
                           / libomu.so -> libomu-<version>.so
                 / include / hqp-<version> / *.h
                           / hqp -> hqp-<version>
    


  6. See ./hqp_docp/README if you want to use HQP directly for multistage optimization, bypassing Omuses (no support for differential equations or automatic differentiation).

  7. See ./hqp_cute/README if you want to use HQP in the testing environment CUTE.

  8. Get in contact with the developers through GitHub.

Using alternative compilers

Gernerally for using an other compiler, say cl, invoke
CC=cl ./configure

Hints for compiling under Windows

The POSIX/GNU build tools are still needed (tar, gzip, sh, make, patch). They are provided for Windows by MinGW or Cygwin. These environments also include gcc and tcl, besides more.

Alternatively the native Windows compiler cl can be configured for the actual compilation (CC=cl ./configure), provided it finds in the PATH environment – the Visual Studio Command Prompt that comes with Visual Studio Tools sets the path; the POSIX shell for building HQP might be started from there. Tcl should be installed from a binary distribution available for Windows in this case and configured via –with-tcl (see above).