[Coin-ipopt] IDE for IP-OPT

Andreas Waechter andreasw at watson.ibm.com
Wed Apr 19 16:15:52 EDT 2006


Hi Dahai,

>> Ipopt comes with project files for Microsoft Visual Studio .NET. It has a 
>> graphical IDE complete with a very reasonable debugger.
>
> I got the project files for Microsoft Visual Studio .NET work. It is very 
> nice to debug the problem using IPOPT as a debuggable library. But I was 
> wondering what's the major difficulty of extending the .NET project file to 
> build an IPOPT.exe with AMPL interface under the framework of .NET. (.i.e not 
> use configure script and cgywin)
>
> I tried to link Apps\AmplSolver\*.cpp with ipopt.lib and amplsolv.lib, but 
> got
> "
> LINK : warning LNK4098: defaultlib 'LIBC' conflicts with use of other libs; 
> use /NODEFAULTLIB:library
> amplsolv.lib(fpinitmt.obj) : error LNK2019: unresolved external symbol 
> __beginthread referenced in function _siglisten
> "

I was able to reproduce this problem on my machine (I had never tried to 
build the Ampl Solver executable with .NET).  As you did, I included 
amplsolv.lib generated with the makefile.vc in the ASL code.

A colleague of mine pointed out that this has to do with the choice of the 
runtime library choice in .NET.  I added a new project ("AmplInterface") 
to the solution that comes with Ipopt, and like you included the source 
files from Apps/AmplInterface. As dependencies I marked Ipopt and 
FortranLinAlg.  You need to tell .NET (as you did) that you want to link 
with amplsolv.lib and include the corresponding directory in the library 
search path.

Now, the crutial part is that you need to choose the "multi-threaded" run 
time options for all projects (Ipopt, FortranLinAlg, and AmplInterface).

For the C++ projects, you do this in

Project->Properties->C/C++->Code Generation->Runtime Library

Here you choose /MT or /MTd (second one is the debug version)

For the LinAlg Fortran project, you do this in

Project->Properties->Fortran->Libraries->Runtime Library

and choose "Multithreaded" or "Debug Multithreaded"

(the Debug version is probably slower...)

In this way, I was able to link the Ipopt Ampl solver executable.  If you 
want to use it, you should rename whatever executable you generated to 
'ipopt.exe'.

> I understand the meaning of "installation with cygwin with GNU compliers", 
> but cannnot catch the major point of "installation with cygwin, .Net and 
> configure script". If we have to use cygwin, why should we bother to use .NET 
> as well (just for better speed)?

I'm trying offer different options for people that work on Windows.  If 
you have all required .NET compilers you can just use those (and in the 
next release I will adapt the solution file so that the above changes are 
included - however, one will still have to compile the amplsolv.lib 
library by hand).

However, if you don't have those compilers, you can use Cygwin (or even 
MinGW) to compile Ipopt and use the GNU compilers.

Finally, if you have an older version of VC and maybe DEC Fortran 
compilers for which you cannot use the solution file that comes with the 
Ipopt distribution, you can still compile the AMPL solver executable it 
using the ./configure and make install process on Cygwin, when you specify 
that CXX=cl CC=cl F77=FortranCompilerName (I hope at least - since I don't 
have those compilers I couldn't try it yet...).

All those are independent options; the user can choose.

As for speed, I don't know how the VC compiler compares with the GNU 
compilers.  I'm not using Windows much, and I only have the Standard 
version of VC, which does not compile optimized code ;)

I hope this clarifies this point, and I hope you will be able to generate 
the Ipopt AMPL solver.

Best,

Andreas



More information about the Coin-ipopt mailing list