Subsections


Installation on Windows

There are several ways to install IPOPT on Windows systems. The first two options, described in Sections 2.5.1 and 2.5.2, are to use Cygwin (see http://www.cygwin.com), which offers a comprehensive UNIX-like environment on Windows and in which the installation procedure described earlier in this section can be used. If you want to use the (free) GNU compilers, follow the instructions in Section 2.5.1. If you have the Microsoft C++ compiler and possibly a ``native'' Fortran compiler (e.g., the Intel Fortran compiler) and want to use those to compile IPOPT, please see Section 2.5.2. If you use MSYS/MinGW (a light-weight UNIX-like environment for Windows), please consider the notes in Section 2.5.3. If you want to compile the IPOPT mex interface to MATLAB, then we recommend to use the MSYS/MinGW option.

Note: Some binaries for IPOPT are available on the COIN-OR website at http://www.coin-or.org/download/binary/Ipopt. There, also precompiled versions of IPOPT as DLLs (generated from the MSVS solution in IPOPT's subdirectory $IPOPTDIR/Ipopt/MSVisualStudio/v8-ifort) are available. Look at the README files for details. An example how to use these DLLs from your own MSVS project is in $IPOPTDIR/Ipopt/MSVisualStudio/BinaryDLL-Link-Example.


Installation with Cygwin using GNU compilers

Cygwin is a Linux-like environment for Windows; if you don't know what it is you might want to have a look at the Cygwin homepage, http://www.cygwin.com.

It is possible to build the IPOPT AMPL solver executable in Cygwin for general use in Windows. You can also hook up IPOPT to your own program if you compile it in the Cygwin environment10.

If you want to compile IPOPT under Cygwin, you first have to install Cygwin on your Windows system. This is pretty straight forward; you simply download the ``setup'' program from http://www.cygwin.com and start it.

Then you do the following steps (assuming here that you don't have any complications with firewall settings etc - in that case you might have to choose some connection settings differently):

  1. Click next
  2. Select ``install from the internet'' (default) and click next
  3. Select a directory where Cygwin is to be installed (you can leave the default) and choose all other things to your liking, then click next
  4. Select a temp dir for Cygwin setup to store some files (if you put it on your desktop you will later remember to delete it)
  5. Select ``direct connection'' (default) and click next
  6. Select some mirror site that seems close by to you and click next
  7. OK, now comes the complicated part:
    You need to select the packages that you want to have installed. By default, there are already selections, but the compilers are usually not pre-chosen. You need to make sure that you select the GNU compilers (for Fortran, C, and C++), Subversion, and some additional tools. For this, get the following packages from the associated branches: When a Resolving Dependencies window comes up, be sure to ``Select required packages (RECOMMENDED)''. This will automatically also select some other packages.

  8. Then you click on next, and Cygwin will be installed (follow the rest of the instructions and choose everything else to your liking). At a later point you can easily add/remove packages with the setup program.

  9. The version of the GNU Make utility provided by the Cygwin installer will not work. Therefore, you need to download the fixed version from http://www.cmake.org/files/cygwin/make.exe and save it to C: $ \backslash$cygwin $ \backslash$bin. Double-check this new version by typing make -version in a Cygwin terminal (see next point). If you get an error -bash: /usr/bin/make: Bad address, then try http://www.cmake.org/files/cygwin/make.exe-cygwin1.7 instead, rename it to make.exe and move it to C: $ \backslash$cygwin $ \backslash$bin. (Replace C: $ \backslash$cygwin with your installation location if different.)

  10. Now that you have Cygwin, you can open a Cygwin window, which is like a UNIX shell window.

  11. Now you just follow the instructions in the beginning of Section 2: You download the IPOPT code into your Cygwin home directory (from the Windows explorer that is usually something like C: $ \backslash$Cygwin $ \backslash$home $ \backslash$your_user_name). After that you obtain the third party code (as on Linux/UNIX), type

    ./configure

    and

    make install

    in the correct directories, and hopefully that will work. The IPOPT AMPL solver executable will be in the subdirectory bin (called ``ipopt.exe''). If you want to set the installation, type

    make test


Installation with Cygwin using the MSVC++ compiler

This section describes how you can compile IPOPT with the Microsoft Visual C++ compiler under Cygwin. Here you have two options for compiling the Fortran code in the third party dependencies:

Once you have settled on this, do the following:

  1. Follow the instructions in Section 2.5.1 until Step 11 and stop after your downloaded the third party code.

  2. Now you need to make sure that Cygwin knows about the native compilers. For this you need to edit the file cygwin.bat in the Cygwin base directory (usually C: $ \backslash$cygwin). Here you need to add a line like the following:

    call "C: $ \backslash$Program Files $ \backslash$Microsoft Visual Studio 8 $ \backslash$VC $ \backslash$vcvarsall.bat"

    On my computer, this sets the environment variables so that I can use the MSVC++ compiler.

    If you want to use also a native Fortran compiler, you need to include something like this

    call "C: $ \backslash$Program Files $ \backslash$Intel $ \backslash$Fortran $ \backslash$compiler80 $ \backslash$IA32 $ \backslash$BIN $ \backslash$ifortvars.bat"

    You might have to search around a bit. The important thing is that, after your change, you can type ``cl'' in a newly opened Cygwin windows, and it finds the Microsoft C++ compiler (and if you want to use it, the Fortran compiler, such as the Intel's ifort).

  3. Run the configuration script, and tell it that you want to use the native compilers:

    ./configure -enable-doscompile=msvc

    Make sure the last message is

    Main Ipopt configuration successful

  4. Now you can compile the code with

    make,

    test the installation with

    make test,

    and install everything with

    make install


Installation with MSYS/MinGW

You can compile IPOPT also under MSYS/MinGW, which is another, more light-weight UNIX-like environment for Windows. It can be obtained from http://www.mingw.org/.

If you want to use MSYS/MinGW to compile IPOPT with native Windows compilers (see Section 2.5.2), all you need to install is the basic version11. If you also want to use the GNU compilers, you need to install those as well, of course.

A compilation with the GNU compilers works just like with any other UNIX system, as described in Section 2.4. That is, during the installation, select (at least) the C Compiler, C++ Compiler, Fortran Compiler, MSYS Basic System, and the MinGW Developer ToolKit. Additionally, wget and unzip should be installed with the following command in an MSYS terminal:

  mingw-get install msys-wget msys-unzip

If you want to use the native MSVC++ compiler (with f2c or a native Fortran compiler), you essentially follow the steps outlined in Section 2.5.2. Additionally, you need to make sure that the environment variables are set for the compilers (see step 2), this time adding the line to the msys.bat file.

For a 64-bit build, you will need to install also a MinGW-64 distribution. We recommend TDM-GCC, which is available from http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-webdl.exe/download. Install MinGW-64 in a different folder than your existing 32-bit MinGW installation! The components you need are: core (under gcc), c++ (under gcc), fortran (under gcc), openmp (under gcc, necessary if you want to use any multi-threaded linear solvers), binutils, and mingw64-runtime.

After MinGW-64 is installed, open the file C: $ \backslash$MinGW $ \backslash$msys $ \backslash$1.0 $ \backslash$etc $ \backslash$fstab, and replace the line

  C:\MinGW\     /mingw
with
  C:\MinGW64\   /mingw
(Replace paths with your installation locations if different.)



Footnotes

... environment10
It is also possible to build an IPOPT DLL that can be used from non-cygwin compilers, but this is not (yet?) supported.
... version11
a convenient Windows install program is available from http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/