[Coin-ipopt] Re: C++ Ipopt

Andreas Waechter andreasw at watson.ibm.com
Mon Aug 29 14:48:15 EDT 2005

Hello Wujiang:

Thank you for your message.  I'm copying my answer to the Ipopt mailing
list, since it might be interesting for other users as well.

The new Ipopt version has been posted Friday evening, so you probably
don't have the latest version yet.  The new website is


As you point out in your message, even thought the Ipopt code is now
written 100% in C++, there are currently still dependencies to code
written in Fortran.  In particular, the only linear solver currently
hooked up to Ipopt is MA27 from Harwell - we are planning to have
interfaces to other linear solver, hopefully both commercial ones and open
source ones, and hopefully we can reduce the requirement of Fortran
compilers that way.

However, in the meantime you might want to have a look at the Fortran to C
compiler, available at netlib, see


With this, you can convert the Fortran code from Harwell as well as the
Fortran BLAS code from netlib to C.  As far as I understand, this will
create C code that you could compile with your C compiler, and when
linking the overall executable (or DLL), you have to include some
libraries from f2c.

I have not tried this myself yet, so I don't know how to exactly do that
and whether the generated C code compiled by a C compiler is maybe less
efficient than the Fortran code compiled by a Fortran compiler.  But I
know that some commercial numerical software codes use MA27 after it has
been translated with f2c.

One thing to consider:  There is a configuration header file `config.h'
for the Windows compiler version in


You might have to adapt the definition of the macros


to something like

#define F77_FUNC(name,NAME) name_
#define F77_FUNC_(name,NAME) name__

depending on what names f2c generates on Windows.

As for BLAS, there as implementations of BLAS in C, so instead of using
f2c for BLAS, you could probably use those instead.  Note that currently
only a few leve-1 BLAS routines are required (see the Ipopt solution

If you try this and it works, it would be great if you could let us know
(also, if the above instructions where helpful).  If it doesn't work,
please let us know also, and we can try to get automatic procedures done
for this in the future (when time permits...).

As usual, if someone else reading the mailing list has some other ideas,
corrections etc, please do not hesitate to post your response to the
mailing list!

I hope this helps,


On Thu, 25 Aug 2005, Lou, Wujiang (FID) wrote:

> Dear Andreas and Carl,
>     We are looking at the C++ version of ipopt on Windows (.Net)
> platform. One major problem we have is that our firm does not support
> FORTRAN and we don't have a FORTRAN compiler.  Is there a way we can get
> around (either all C/C++ source code or C/C++ source code plus some
> static libs?)
>     Please advise.
>     Thanks,
> -wujiang lou
> vice president
> CPG Financial Engineering Group
> Morgan Stanley
> --------------------------------------------------------
> This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned or an official confirmation.  Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers.  This is not research and is not from MS Research but it may refer to a research analyst/research report.  Unless indicated, these views are the author's and may differ from those of Morgan Stanley research or others in the Firm.  We do not represent this is accurate or complete and we may not update this.  Past performance is not indicative of future returns.  For additional information, research reports and important disclosures, contact me or see https://secure.ms.com/servlet/cls.  You should not use e-mail to request, authorize or effect the purchase or sale of any security or instrument, to send transfer instructions, or to effect any other transactions.  We cannot guarantee that any such requests received via e-mail will be processed in a timely manner.  This communication is solely for the addressee(s) and may contain confidential information.  We do not waive confidentiality by mistransmission.  Contact me if you do not wish to receive these communications.  In the UK, this communication is directed in the UK to those persons who are market counterparties or intermediate customers (as defined in the UK Financial Services Authority's rules).

More information about the Coin-ipopt mailing list