We have almost completed integration of the IPOPT solver into ASCEND, as part of a GSOC 2009 project by Mahesh Narayanamurthi. This implementation includes efficient methods for calculating hessian matrices directly using automatic differentiation code developed specifically for our core engine. We're looking for people to try it out and report any problems.
The remaining feature requiring implemention is to connect support for external relations to the IPOPT solver. Currently this kind of function is not supported in the reverse-AD code, and so models with external relations can not be solved with IPOPT (unless possibly using estimated second derivatives... need to check).
ASCEND links to IPOPT via its plain C API, IpStdCInterface.h.
A selection of sample problems that solve using IPOPT can be viewed at models/test/ipopt. Mostly the samples are problems taken from the Hock-Schittkowsky Test Examples for Nonlinear Programming Codes test suite and were compuiled by Mahesh.
To test the state of the IPOPT solver, you must first install the base IPOPT software on your machine. The following instructions complement the IPOPT installation guide.
Use the RPM spec file tools/ipopt/ipopt.spec to guide the build process for IPOPT. See Building ASCEND for related instructions on building a SUNDIALS RPM, and once that is completed, install the ipopt.spec file in ~/rpmbuild/SPECS and download the files listed in that spec file, saving them in ~/rpmbuild/SOURCES. Also download tools/ipopt/ipopt-addlibs.patch to ~/rpmbuild/SOURCES. Then:
sudo yum install lapack-devel blas-devel rpmbuild -ba ipopt.spec
Hopefully the resulting RPMs will appear in ~/rpmbuilds/RPMS/arch.
Ubuntu 11.04 Natty
Using dtar you can build your own IPOPT deb packages for Ipopt 3.10.0 and File:Ipopt-debian-3.10.0-natty.tar.gz (some details at tools/ipopt). You need an internet connection while building this, as the build script goes and downloads MUMPS during the process. Alternatively, you can go ahead and use the following that we built already. These are 32-bit packages; we'd be interested to know if the same process works OK for 64-bit.
- libipopt0_3.10.0_i386.deb (1.5M Ubuntu 11.04 package - runtime use)
- libipopt-dev_3.10.0_i386.deb (2.5M Ubuntu 11.04 package - compiletime use)
- libipopt-dbg_3.10.0_i386.deb (7.3M Ubuntu 11.04 package - debugger symbols)
Ubuntu 10.04 LTS Lucid
Problems with the standard Ubuntu-repository IPOPT 3.8.1 and MUMPS packages seem to persist in 10.04.
The following packages will work successfully with ASCEND on Ubuntu 10.04 LTS Lucid (intel 32 bit). You'll need to install them both.
- libipopt0_3.9.1_i386.deb (1.5 MB Ubuntu 10.04 package)
- libipopt-dev_3.9.1_i386.deb (2.4 MB Ubuntu 10.04 developer package)
On this platform, we have successfully built IPOPT 3.9.1, so you can again build your own package. For Lucid, you need to download Ipopt-3.9.1.tgz and Ipopt-debian-3.9.1-lucid.tar.bz2 then use dtar to run
dtar Ipopt-3.9.1.tgz Ipopt-debian-3.9.1-lucid.tar.gz
Update: the above method now also produces debug packages, to allow debugging of issues arising in the use of IPOPT.
Note that as of 3.9.0, IPOPT makes use of the COIN 'BuildTools' system, and many things have changed. The above package installs shared libraries in the rather annoying location /usr/lib/coin and /usr/lib/coin/ThirdParty, which makes dlopening libraries that reference IPOPT rather annoying, because these locations must now be added to LD_LIBRARY_PATH. Bah! We will try to work out a way to create an IPOPT package that installs to /usr/lib.
If you happen to be repeated attempting to build the IPOPT package, the build process will attempt to download MUMPS every time you run dtar. To avoid downloading a new copy everytime, download a copy of the file, then in the same directory as the file, run sudo twistd -n web --path . -p 80. Edit your /etc/hosts to contain the following on a line of its own: 127.0.0.1 mumps.enseeiht.fr. This will allow you to 'fool' your computer into fetching the file locally instead of over the network.
Ubuntu 9.10 Karmic
As of Ubuntu 9.10, MUMPS is now available in the standard package repositories. However the Ubuntu version of IPOPT doesn't seem to be correctly linked with the Ubuntu version of MUMPS, so the we propose that you make use of the following packages instead, which download their own copy of MUMPS source code during the build process.
It is recommended that you follow the same process as for Ubuntu 10.04 to build your own IPOPT 3.9.1 packages for this platform.
Packages that we built for IPOPT 3.8.1 on Ubuntu 9.10 are available from our download page on SourceForge. You will need to install both of the libipopt*.deb packages. You can also build these 3.8.1 packages yourself using the file Ipopt-debian.tar.bz2 and dtar with the command dtar Ipopt-3.8.1.tgz Ipopt-debian.tar.bz2.
On Windows, because we only use the C interface for IPOPT, it should be possible to make use of the binary builds of IPOPT. This has not recently been tested, however, so please let us know if you experience any problems.
On other systems you will need to install your own copy of IPOPT from source. Instructions are at the IPOPT website and documented below for quick setup.
Some outdated binaries for IPOPT (ipopt and ipopt-devel RPMs) were available for Fedora and openSUSE via OpenSUSE build service repository.
Note: changes in IPOPT as of version 3.9.0 will make the following guide outdated. Several new parameters on the ./configure command appear to now be required.
To use IPOPT with ASCEND, a source tar-ball of IPOPT can be downloaded from the IPOPT download page (Version 3.6 is the latest stable distribution as on date of writing the following install guide). This tarball is a 'partial' tarball, in that it expected certain extra third-party code to be downloaded before you start the process of building the code. For a minimal free open-source installation of IPOPT, you should first use your Linux package manage to install BLAS and LAPACK developer's packages (libblas-dev and liblapack-dev on Ubuntu).
Unpack the source into a directory (we will refer to this directory as $IPOPTTOPDIR here on).
Next, enter the corresponding ThirdParty subdirectories of $IPOPTTOPDIR and run the ./get.PackageName scripts for
Optionally, you can also follow the IPOPT instructions for downloading the code for
- HSL (optionally, just MA27 and MC19. Note that this is not free-libre code though)
Note that ASL is not required, because we are not building an AMPL interface for IPOPT here. BLAS can be installed on Linux from your package repositories (see Atlas, GSL C-BLAS, and others). HSL routines are also not essential, you will need to register on the corresponding websites and you would get an e-mail confirmation giving you instructions on how to obtain them and install them. So give sufficient time for this and plan your installation accordingly (we are interested in using open source code here). LAPACK can be installed on Linux from your package repositories (on Ubuntu, the package is liblapack-dev).
If your wget is properly configured, you should be able to use these get.PackageName shell scripts in each of the third-party folders under $IPOPTTOPDIR/ThirdParty to download and extract the corresponding package, without any problems.
Note that the download scripts 'get.PackageName' contain some hand-written version numbers, which you may wish to update if you want to use a newer third-party package versions.
Once all the third-party packages have been obtained, you are ready to build and install IPOPT. It is recommended that you install IPOPT to /usr/local if possible.
Under $IPOPTTOPDIR, note any platform-specific issues, then enter
If configuration is successful, a message
configure: Main configuration of Ipopt successful
will be observed on the command line. You should also check the output during configuration of each package: if package configuration was successful, you should see a message, for each package, like:
configure: Configuration of ThirdPartyMumps successful
Now, proceed by issuing:
sudo make install
Please note that IPOPT is still experimental and development is ongoing. Implementation of support for this solver is not yet completed (see Development activities).
Building ASCEND with support for IPOPT
On Windows, you will need to provide configuration options via scons, eg IPOPT_PREFX, IPOPT_LIBS, etc, in order to compile against IPOPT. If you have compiled your own copy of IPOPT using MinGW ("./configure --prefix=/mingw && make -j4 install", for example), then you may have success with something like:
scons IPOPT_PREFIX=/mingw IPOPT_LIBS=ipopt,stdc++,coinmumps,coinlapack,coinblas,gfortran,pthread IPOPT_LIBPATH=/mingw/lib
On Linux, providing that pkgconfig ipopt --libs gives you some output, everything should just work. ASCEND should detect IPOPT successfully and build your IPOPT solver (check your WITH_SOLVERS option for scons too, to make sure).
Either way, you should end up with a DLL or SO file in the subdirectory solvers/ipopt at the end of the ASCEND build process.
There is a little test program testipopt in the ascxx directory that you may be able to use to test your wrapped IPOPT solver is working correctly.
To use IPOPT with the HSL linear solver routines (MA27, MA57, MC19), you can compile a shared library libhsl.so using the IPOPT ThirdParty/HSL/configure script. In that case, use the LD_LIBRARY_PATH environment variable if necessary to tell IPOPT where that shared library will be found.