Hi Huizhen,<div><br></div><div>Quick questions:</div><div><br></div><div>In step 9 of your email, did you change <span style="font-family:arial, sans-serif;font-size:12.5px;border-collapse:collapse"> MATLAB_HOME to your matlab installation dir? If you type </span><span style="font-family:arial, sans-serif;font-size:12.5px;border-collapse:collapse"> </span></div>
<div><span style="font-family:arial, sans-serif;font-size:12.5px;border-collapse:collapse"><br></span></div><div><span style="font-family:arial, sans-serif;font-size:12.5px;border-collapse:collapse">$ ls /c/PROGRA~2/MATLAB/R2008B~1/</span></div>
<div><span style="font-family:arial, sans-serif;font-size:12.5px;border-collapse:collapse"><br></span></div><div>
<div>On your msys command line, do you see the contents of the matlab installation folder?</div><div><br></div><div>Also, in step 11 point 2, when you set GM_ADD_LIBS. Did you install msys in c:\msys\1.0 or did you change the installation dir to c:\</div>
<div>msys\uno??</div><div><br></div><div>Finally, the error <span style="font-family:monospace;font-size:12.5px;border-collapse:collapse;white-space:pre-wrap">error: unrecognized switch: -CXX. </span>You need to remove the -cxx flag from the Makefile in $MyIpoptDir/build/Ipopt/contrib/Matlabinterface/src. I've updated the compilation instructions in the Ipopt website for this one (<a href="https://projects.coin-or.org/Ipopt/wiki/CompilationHints">https://projects.coin-or.org/Ipopt/wiki/CompilationHints</a>)</div>
<div><br></div><div>The other errors I don't know why they are showing up... are you sure you've got matlab properly configured, and that mex file creation is possible using your matlab installation?</div><div><br>
</div><div>I hope this helps, </div><div> Rodrigo</div><div><br><br><div class="gmail_quote">On Fri, Jun 4, 2010 at 5:41 AM, Huizhen Zhang <span dir="ltr"><<a href="mailto:zhzzywz@gmail.com" target="_blank">zhzzywz@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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 href="http://www.tdragon.net/recentgcc/" target="_blank"><span> </span>MinGW/TDM</a>
compilers, version 4.3.2-tdm-2 (I've tried other versions, and they
don't work)
<ol><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><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><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><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><li> MATLAB_HOME = /c/PROGRA~2/MATLAB/R2008B~1/
</li><li> MEXSUFFIX = mexw32
</li><li> MEX =$(MATLAB_HOME)/bin/<a href="http://mex.pl" target="_blank">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" target="_blank">mex.pl</a>: line 95: require: command not found<br>
/c/progra~2/matlab/r2008b~1//bin/<a href="http://mex.pl" target="_blank">mex.pl</a>: line 97: sub: command not
found<br> /c/progra~2/matlab/r2008b~1//bin/<a href="http://mex.pl" target="_blank">mex.pl</a>: line107: syntax error near unexpected token 'else'<br> /c/progra~2/matlab/r2008b~1//bin/<a href="http://mex.pl" target="_blank">mex.pl</a>: line107: ' else'<br>
make: *** [ipopt.mexw32] error 2<br><pre> I read the <a href="http://mex.pl" target="_blank">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" target="_blank">mex.pl</a><br> then the errors are:<br> /c/progra~2/matlab/r2008b~1//bin/<a href="http://mex.pl" target="_blank">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" target="_blank">r.lopez.negrete@gmail.com</a>></span><div>
<div></div><div><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><br>
On Wednesday, May 26, 2010, Peter Carbonetto <<a href="mailto:pcarbo@uchicago.edu" target="_blank">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></div></div><br><br clear="all"><br>-- <br><div>Huizhen Zhang<br>Statistics and Operations Research<br>Rey Juan Carlos University (URJC),<br></div><div>C/ Tulipán s/n, 28933 <br>
</div>Móstoles (Madrid),Spain<div><div></div><div><br>Tel: +34 91 488 83 22, +34 667300180 <br>
Fax: +34 91 488 70 49<br><br>
</div></div></blockquote></div><br></div></div>