<div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>Dear Hans,</div><div><br></div>This is curiously annoying. I also used gnumex 2.03, but did not get into any of those library problems. I wonder if the problem is Matlab 2010b, since I used 2009a, or if MinGW/MSys just works differently in WinXP than Win7.<div>
<br></div><div>Anyway, I'm glad the compilation worked this time. Also, if its possible to post the Ipopt mex files, also remember to attach the pthread library from mingw. Otherwise, it won't work ;).</div><div>
<br>
</div><div>Cheers,</div><div> Rodrigo</div></div><div><br><div class="gmail_quote">On Mon, Nov 29, 2010 at 3:53 PM, Hans Pirnay <span dir="ltr"><<a href="mailto:hans.pirnay@rwth-aachen.de">hans.pirnay@rwth-aachen.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Rodrigo, Jens,<div><br></div><div>thanks for all your help. I finally got it to work. </div><div><br></div><div>I am on windows 7, but that doesn't really seem to change anything. The mex file I compiled on 7 works on XP just as well. Here's what I did:</div>
<div><br></div><div>- got the current mingw + msys using the automated installer, installing everything but the objective c and ada compilers.</div><div>- followed the steps on the website, configure using the same options as Rodrigo</div>
<div><br></div><div>configure, make, make test, make install all worked flawlessly. The problems started with gnumex.</div><div><br></div><div>1. I am using Matlab 7.11, so I had to use the new gnumex 2.03 which fixes a bug in Matlab 7.11's <a href="http://mex.pl" target="_blank">mex.pl</a> file</div>
<div>2. I changed the mexopts.bat file according to Rodrigo's suggestions. The problem I ran into was that all the .a libraries were not found, because the compiler only looked for .lib files. I got around this problem by creating symbolic links of the form *.lib to all the necessary *.a files</div>
<div><br></div><div>With these changes, it compiled without problems</div><div><br></div><div>Since "ipopt matlab windows" seems to be a very popular google search term, I was wondering if there exist any copyright/legal objections against posting the compiled ipopt mex file (with MUMPS) and all the necessary files to run it somewhere online? </div>
<div><br></div><font color="#888888"><div>Hans</div></font><div><div></div><div class="h5"><div><br><div class="gmail_quote">On Mon, Nov 29, 2010 at 2:40 AM, Rodrigo Lopez-Negrete <span dir="ltr"><<a href="mailto:r.lopez.negrete@gmail.com" target="_blank">r.lopez.negrete@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Hans and Jens,<div><br></div><div>I just tried compiling the matlab interface again. I was able to do it following *some* of my instructions on the Ipopt website. Here's what I did.</div>
<div><br></div><div>I used a clean install of MinGW/Msys with the newest available installer from the MinGW website (mingw-get-inst-20101030.exe). I'm using Windows XP and the compilers that come with the MinGW download:</div>
<div><br></div><div><div>$ gcc -v</div><div>Using built-in specs.</div><div>COLLECT_GCC=C:\MinGW\bin\gcc.exe</div><div>COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.5.0/lto-wrapper.exe</div><div>Target: mingw32</div>
<div>Configured with: ../gcc-4.5.0/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw</div>
<div>Thread model: win32</div><div>gcc version 4.5.0 (GCC)</div></div><div><br></div><div><br></div><div>I configured Ipopt using</div><div><br></div><div>$ ../configure -C --enable-doscompile --enable-static --disable-shared ADD_CXXFLAGS="-fexceptions" ADD_CFLAGS="-fexceptions" ADD_FFLAGS="-fexceptions"</div>
<div><br></div><div>Make the ipopt library. All tests passed for me.</div><div><br></div><div>Then I generated the mexopts.bat file using gnumex. This file I copied to the $IPOPT/build/Ipopt/contrib/MatlabInterface/src folder, and I modified it as follows:</div>
<div><br></div><div>set GM_MEXLANG=cxx</div><div>set GM_ADD_LIBS= -llibmx -llibmex -llibmat -Lc:/MinGW/msys/uno/home/testnew/Ipopt/build/lib/coin -Lc:/MinGW/msys/uno/home/testnew/Ipopt/build/lib/coin/ThirdParty -lipopt -lcoinhsl -lcoinmetis -lcoinmumps -lcoinlapack -lcoinblas -Lc:/MinGW/lib -LC:/MinGW/lib -Lc:/mingw/bin/../lib/gcc/mingw32/4.5.0 -Lc:/mingw/bin/../lib/gcc -Lc:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/lib -Lc:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../.. -L/mingw/lib -lgfortran -lmingw32 -lgcc_s -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lpthread -lm</div>
<div>set COMPILER=g++ </div><div><br></div><div>The makefile I setup like this (as per my Matlab installation)</div><div><ol style="list-style-type:lower-alpha;font-family:Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif;font-size:13px">
<li>MATLAB_HOME = /c/PROGRA~1/MATLAB/R2009a/</li><li>MEXSUFFIX = mexw32</li><li>MEX = $(MATLAB_HOME)/sys/perl/win32/bin/perl.exe $(MATLAB_HOME)/bin/<a href="http://mex.pl" target="_blank">mex.pl</a></li><li>remove the -cxx flag from MEXFLAGS</li>
</ol><div>When doing make for the Matlab interface it complains about not finding the 'm' library, however it compiles and generates the ipopt.mexw32 file. I tested it with the examples, and it worked.</div><div>
<br>
</div><div>I hope this helps. If you try this and it works, let me know. I may update the Ipopt website.</div><div><br></div><div>Best, </div><div> Rodrigo</div><div><div></div><div><br><div class="gmail_quote">
On Thu, Nov 25, 2010 at 4:01 AM, Jens Schubert <span dir="ltr"><<a href="mailto:jens.schubert.1@googlemail.com" target="_blank">jens.schubert.1@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Hans,<br>
<div><br>
> I used tdm-gcc-4.3.2 as described in the compulation hints.<br>
</div>I just checked the mingw home page. I found that the documentation was<br>
updated since I had read it last time. However, go to<br>
<a href="http://www.mingw.org/wiki/InstallationHOWTOforMinGW" target="_blank">http://www.mingw.org/wiki/InstallationHOWTOforMinGW</a><br>
and scroll down to 'Manual Installations'. Follow all the instructions<br>
- this will need some time. I checked a few links, for me it looks<br>
like they point all to the gcc4.5 version. So here you will get all<br>
the necessary packages.<br>
<br>
Then, after you updated to the newest version of gcc, try to use it.<br>
In my gcc-version (4.5.0-1) the compiler did not yet work fully<br>
correctly, that is why one had to set the linker-option ( I found this<br>
in the release notes). [I just see that this version is the same as<br>
the version suggested on the mingw page.]<br>
<div><br>
><br>
>> For me it works with gcc4.5.0 and using the linkeroption<br>
>> '--enable-runtime-pseudo-reloc-v2' durch '--enable-auto-import'.<br>
><br>
> I'm not sure what exactly you mean - can you clarify where I need to<br>
> specify which of these options?<br>
</div>Well, this depends on your environment. I work in the 'msys'-shell as<br>
suggested on the mingw home page. If gcc is called,<br>
(a) either directly by typing on the msys command-prompt,<br>
(b) or by a make-tool<br>
(c) or by some other program<br>
there is always a way to set the compiler options. In my case (b) I<br>
just put it as an option behind the gcc-comand in the makefile.<br>
<div><br>
> Can you tell me why you chose these<br>
> options?<br>
</div>See above: I found it in the release notes.<br>
The (nearly) complete list of all options may be found in the gcc manual.<br>
<a href="http://gcc.gnu.org/onlinedocs/" target="_blank">http://gcc.gnu.org/onlinedocs/</a><br>
But the list is too long for just reading it, you need to use the list<br>
as reference for looking up unknown things.<br>
<br>
<br>
Good luck<br>
<font color="#888888">Jens Schubert<br>
</font><div><div></div><div><br>
><br>
> Thanks for your help!<br>
><br>
> Hans<br>
><br>
>><br>
>> Hope it helps<br>
>> Jens<br>
>><br>
>><br>
>> 2010/11/24 Hans Pirnay <<a href="mailto:hans.pirnay@rwth-aachen.de" target="_blank">hans.pirnay@rwth-aachen.de</a>>:<br>
>>> Hi everyone,<br>
>>><br>
>>> I am trying to compile Ipopt for Windows so I might finally be able to<br>
>>> use it for Matlab, but I ran into problems using Rodrigo's guide on<br>
>>> <a href="https://projects.coin-or.org/Ipopt/wiki/CompilationHints" target="_blank">https://projects.coin-or.org/Ipopt/wiki/CompilationHints</a><br>
>>><br>
>>> I set up a MinGW system, and successfully ran configure and make with<br>
>>> the same options Rodrigo used. However, any executables I create (all<br>
>>> examples, as well as running make test) compile fine, but fail at<br>
>>> runtime with the usual<br>
>>><br>
>>> "hs071_cpp.exe has encountered a problem and needs to close. --- Send<br>
>>> Error Report / Don't Send" - window.<br>
>>><br>
>>> I tried to compile a simple helloworld program just to check if any<br>
>>> code compiled on MinGW fails, but that worked fine.<br>
>>><br>
>>> Has anyone encountered and overcome this problem before? Any help is<br>
>>> appreciated!<br>
>>><br>
>>> thanks<br>
>>><br>
>>> Hans<br>
>>><br>
>>> _______________________________________________<br>
>>> Ipopt mailing list<br>
>>> <a href="mailto:Ipopt@list.coin-or.org" target="_blank">Ipopt@list.coin-or.org</a><br>
>>> <a href="http://list.coin-or.org/mailman/listinfo/ipopt" target="_blank">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
>>><br>
>><br>
><br>
<br>
_______________________________________________<br>
Ipopt mailing list<br>
<a href="mailto:Ipopt@list.coin-or.org" target="_blank">Ipopt@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/ipopt" target="_blank">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br><span style="font-family:Arial, Helvetica, sans-serif;font-size:14.1667px;border-collapse:collapse;color:rgb(51, 51, 51)"><img width="200" height="24"><br>
<strong><span><font color="#000000"><span style="background-color:rgb(255, 255, 255)">Rodrigo</span></font></span><font color="#000000"><span style="background-color:rgb(255, 255, 255)"> López-</span></font><span><font color="#000000"><span style="background-color:rgb(255, 255, 255)">Negrete</span></font></span><font color="#000000"><span style="background-color:rgb(255, 255, 255)"> de la Fuente</span></font></strong><font color="#000000"><span style="background-color:rgb(255, 255, 255)"><br>
</span></font>Doctoral Candidate <br>Email: <a href="mailto:rln@cmu.edu" style="color:rgb(7, 77, 143)" target="_blank"><span>rln@cmu.edu</span></a><div><span style="color:rgb(34, 34, 34)"><span style="background-color:rgb(255, 255, 255)">WWW</span></span><span style="background-color:rgb(255, 255, 255)">: <a href="http://rodrigo.lopez-negrete.org" target="_blank">http://rodrigo.lopez-negrete.org</a></span><span style="background-color:rgb(255, 255, 255)"><br>
</span><br>Department of Chemical Engineering<br>Carnegie Mellon University <br>5000 Forbes Ave. <br>Pittsburgh, PA 15213-3890<br>USA</div></span><br>
</div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><span style="font-family:Arial, Helvetica, sans-serif;font-size:14.1667px;border-collapse:collapse;color:rgb(51, 51, 51)"><img src="http://www.cs.cmu.edu/~aml/logos/wordmark.jpg" width="200" height="24"><br>
<strong><span><font color="#000000"><span style="background-color:rgb(255, 255, 255)">Rodrigo</span></font></span><font color="#000000"><span style="background-color:rgb(255, 255, 255)"> López-</span></font><span><font color="#000000"><span style="background-color:rgb(255, 255, 255)">Negrete</span></font></span><font color="#000000"><span style="background-color:rgb(255, 255, 255)"> de la Fuente</span></font></strong><font color="#000000"><span style="background-color:rgb(255, 255, 255)"><br>
</span></font>Doctoral Candidate <br>Email: <a href="mailto:rln@cmu.edu" style="color:rgb(7, 77, 143)" target="_blank"><span>rln@cmu.edu</span></a><div><span style="color:rgb(34, 34, 34)"><span style="background-color:rgb(255, 255, 255)">WWW</span></span><span style="background-color:rgb(255, 255, 255)">: <a href="http://rodrigo.lopez-negrete.org" target="_blank">http://rodrigo.lopez-negrete.org</a></span><span style="background-color:rgb(255, 255, 255)"><br>
</span><br>Department of Chemical Engineering<br>Carnegie Mellon University <br>5000 Forbes Ave. <br>Pittsburgh, PA 15213-3890<br>USA</div></span><br>
</div>