<pre>Hello Ipopt-experts and Rodrigo,<br><br>I tried to install the Ipopt on my Laptop with windows XP system, and use the Matlab interface for IPOPt.<br><br>According to the suggestions from Rodrigo, I did the following:<br>
<br>- windows XP<br>- VC 6.0<br>- matlab R2008b student<br>- MinGW version 5.1.6<br>- Msys 1.0.11<br>- Ipopt version 3.8.0<br><br><br>Details:<br><br> </pre><ul><li>Download <a class="ext-link" href="http://www.tdragon.net/recentgcc/"><span class="icon"> </span>MinGW/TDM</a>
compilers, version 4.3.2-tdm-2 (I've tried other versions, and they
don't work)
<ol class="loweralpha"><li>gcc-4.3.2-tdm-2-core.tar.gz
</li><li>gcc-4.3.2-tdm-2-g++.tar.gz
</li><li>gcc-4.3.2-tdm-2-fortran.tar.gz
</li></ol></li><li>Extract the compiler files with
<ol class="loweralpha"><li>$ tar xzf gcc-4.3.2-tdm-2-core.tar.gz -C
/mingw
</li><li>$ tar xzf gcc-4.3.2-tdm-2-g++.tar.gz -C /mingw
</li><li>$ tar xzf gcc-4.3.2-tdm-2-fortran.tar.gz -C /mingw
</li></ol></li><li>Backup libstdc++* just in case
<ol class="loweralpha"><li>$ cp /mingw/lib/libstdc++.a
/mingw/lib/libstdc++.a.orig
</li><li>$ cp /mingw/lib/libstdc++.la /mingw/lib/libstdc++.la.orig
</li></ol></li><li>Copy libstdc++.* to /mingw/lib
<ol class="loweralpha"><li>$ cp /mingw/lib/gcc/mingw/4.3.2/libstdc++*
/mingw/lib/
</li></ol></li></ul><pre><br> 1.) get the ipopt code <br> 2.) get the required ThirdParty code (ASL, Lapack, and BLAS) via the get comands<br> 3.) get the HSL as described (ma27ad.f and mc19ad.f)<br> 4.) mkdir $MyIpoptDir/build <br>
cd $MyIpoptDir/build<br> 5.)$MyIpoptDir/configure --enable-doscompile --disable-shared –-enable-static <br> ADD_CXXFLAGS="-fexceptions" ADD_CFLAGS="-fexceptions" <br>
ADD_FFLAGS="-fexceptions" CC=gcc CXX=g++<br> 6.) make<br> 7.) make test<br> 8.) make install<br><br> <br>===> Up to this point everything seems to work fine. The problem appears in the next step to generate the matlab interface.<br>
<br>9.) copy the mexopts.bat file generated by gnumex in $MyIpoptDir/build/Ipopt/contrib/Matlabinterface/src<br>10.) edit the makefile: </pre><ol class="loweralpha"><li> MATLAB_HOME = /c/PROGRA~2/MATLAB/R2008B~1/
</li><li> MEXSUFFIX = mexw32
</li><li> MEX =$(MATLAB_HOME)/bin/<a href="http://mex.pl">mex.pl</a></li></ol><pre>11.) edit the mexopt.bat<br></pre><ol><li>set GM_MEXLANG=cxx
</li><li>set GM_ADD_LIBS=-llibmx -llibmex -llibmat
-Ld:\msys\uno\home\Administrator\CoinOR\Ipopt_matlab\build\lib -lipopt
-lpthread -lm -Ld:/mingw/bin/../lib/gcc/mingw32/4.3.2
-Ld:/mingw/bin/../lib/gcc
-Ld:/mingw/bin/../lib/gcc/mingw32/4.3.2/../../../../mingw32/lib
-Ld:/mingw/bin/../lib/gcc/mingw32/4.3.2/../../.. -L/mingw/lib
-lgfortranbegin -lgfortran -lmingw32 -lmoldname -lmingwex -lmsvcrt
-luser32 -lkernel32 -ladvapi32 -lshell32 -llibmx -llibmex -llibmat </li><li> set COMPILER=g++
</li></ol>12. ) Then I type make to generate the interface, some errors appear:<br><br> /c/progra~2/matlab/r2008b~1//bin/<a href="http://mex.pl">mex.pl</a>: line 95: require: command not found<br> /c/progra~2/matlab/r2008b~1//bin/<a href="http://mex.pl">mex.pl</a>: line 97: sub: command not
found<br> /c/progra~2/matlab/r2008b~1//bin/<a href="http://mex.pl">mex.pl</a>: line107: syntax error near unexpected token 'else'<br> /c/progra~2/matlab/r2008b~1//bin/<a href="http://mex.pl">mex.pl</a>: line107: ' else'<br>
make: *** [ipopt.mexw32] error 2<br><pre> I read the <a href="http://mex.pl">mex.pl</a> file, the commands" require, sub" are in it, but I don't know what to do. <br> <br> I also tried to edit the MEX in the makefile as: <br>
MEX =$(MATLAB_HOME)/sys/perl/win32/bin/perl.exe $(MATLAB_HOME)/bin/<a href="http://mex.pl">mex.pl</a><br> then the errors are:<br> /c/progra~2/matlab/r2008b~1//bin/<a href="http://mex.pl">mex.pl</a>: error: unrecognized switch: -CXX.<br>
make: *** [ipopt.mexw32] error 2 <br><br>What should I do, then I can generate the matlab interface successfully.<br>I am looking forward your help. <br><br>Thanks!<br><br></pre><div class="gmail_quote">2010/5/26 Rodrigo Lopez-Negrete <span dir="ltr"><<a href="mailto:r.lopez.negrete@gmail.com">r.lopez.negrete@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Dear Peter,<br>
<br>
I've had success in doing this in windows xp and with MinGW. I've<br>
written down the steps I took in order to do this. You can find them<br>
here.<br>
<br>
<a href="https://projects.coin-or.org/Ipopt/wiki/CompilationHints#WinIpopt" target="_blank">https://projects.coin-or.org/Ipopt/wiki/CompilationHints#WinIpopt</a><br>
<br>
I hope this helps,<br>
<font color="#888888"> Rodrigo<br>
</font><div><div></div><div class="h5"><br>
On Wednesday, May 26, 2010, Peter Carbonetto <<a href="mailto:pcarbo@uchicago.edu">pcarbo@uchicago.edu</a>> wrote:<br>
> There has been some (not very detailed) discussion on installing the Matlab interface on Windows in previous postings to the mailing list---please search the archives of the IPOPT mailing list. Apparently it is tricky to compile the MEX file on Windows. If you have any success, please let us know!<br>
><br>
> Peter Carbonetto, Ph.D.<br>
> Postdoctoral Reseearcher<br>
> Dept. of Human Genetics<br>
> University of Chicago<br>
><br>
><br>
> Dear all,<br>
><br>
> I am new to IPOPT. I want to install Ipopt on Windows XP and use the matlabi nterface. I have downloaded the IPOPT and its thirdPraty(ASL, Blas, HSL, Lapack, Metis<br>
> and Mumps),<br>
> and I have compiled the Ipopt by using the Microsoft Visual Studio files<br>
><br>
> (I followed the steps in the file readme.txt which is located in the "BASIc directory\Ipopt\MSVisualStudio\v8").<br>
> Now I want to install the matlabinterface in my laptop, how can I install it<br>
> correctly ?<br>
> (I read the readme.txt file in the "BASIc directory\Ipopt\contrib\MatlabInte<br>
> rface", it seems this file only explains how to install this matlabinterface in UNIX<br>
> -based operating system, however,<br>
><br>
> there are not detailed explanation for installing it in the windowsXP). By the way, do I need to install other additional package? If I need, which packages?<br>
> Can anyone tell me how I can solve this problem ? Thanks a lot for any help!<br>
><br>
><br>
> --<br>
> Huizhen Zhang<br>
> Statistics and Operations Research<br>
> Rey Juan Carlos University (URJC),<br>
> C/ Tulip?n s/n, 28933<br>
> M?stoles (Madrid),Spain<br>
> Tel: +34 91 488 83 22, +34 667300180<br>
> Fax: +34 91 488 70 49<br>
><br>
><br>
><br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Huizhen Zhang<br>Statistics and Operations Research<br>Rey Juan Carlos University (URJC),<br>C/ Tulipán s/n, 28933 <br>Móstoles (Madrid),Spain<br>Tel: +34 91 488 83 22, +34 667300180 <br>
Fax: +34 91 488 70 49<br><br>