[Ipopt] Ipopt Matlab Functionality

Tony Kelman kelman at berkeley.edu
Wed Sep 4 21:18:09 EDT 2013


I could put in a readme file for the next version, it would have 3 steps: extract zip file, add folder to Matlab path using addpath command, refer to usage instructions with “help ipopt” (or see examples folder).

You need a compiler to turn source files (extensions .c, .cpp, .f) into mex binaries (extension given by mexext command, on Windows it’s mexw32 or mexw64). Once you have the binary, you call the mex file as if it was a normal Matlab m-file function. Since Ipopt is composed of quite a few source files and depends on several libraries, I’ve compiled and provided binaries that should just work out of the box. You’ll notice that ipopt.m is actually entirely help comments, when you call the ipopt function in Matlab the mex file takes precedence over the m file with the same name.

If you have additional questions, it’s a good idea to send them to the mailing list. There are quite a few people there who are very knowledgeable on these matters, and messages to the mailing list get archived for future Google reference purposes.

-Tony


From: John Hall 
Sent: Wednesday, September 04, 2013 5:50 PM
To: Tony Kelman 
Subject: Re: Ipopt Matlab Functionality

Yeah, it appears I was (mostly) driving myself crazy for nothing. The only other way I had used mex files was doing some command like "mex file.cpp" so when you said it was a mex, I figured I needed to "mex ipopt.mexw64" before trying the examples. That part of it wasn't working and I was trying some other mex files I needed and they weren't working either. Eventually, I got the other mex files I needed to work (through what I mentioned), but I didn't bother to try the examples until then. At which point, they worked. False causality, it appears. Perhaps you could add a read me so others don't make stupid mistakes like I did. I had googled mexw64 and there really wasn't any useful information that could have made this clear to me. 

-John Hall




On Wed, Sep 4, 2013 at 8:38 PM, Tony Kelman <kelman at berkeley.edu> wrote:

  Unless you want or need to compile the mex files from source yourself, you shouldn’t need to worry about getting Matlab-compatible compilers for Ipopt on Windows. And for building Ipopt from source, I find it simpler to use gcc and gfortran compilers from MinGW, since you can use the standard Ipopt configure scripts. My binaries don’t use Visual Studio at all.

  -Tony


  From: John Hall 
  Sent: Wednesday, September 04, 2013 5:23 PM
  To: kelman at berkeley.edu 
  Subject: Ipopt Matlab Functionality

  I was trying to add Ipopt to Matlab using your 3.11.3 binaries. I had Matlab 7.12, but it has some problems getting the 64bit Visual C++ compiler to work and was driving me nuts, so I upgraded to 8.1, the latest version. Even then, the mex setup didn't work with Visual C++ 2010, I had to upgrade to Visual C++ 2012 and then it finally worked. Not sure if others had these issues, but I suspect they are more related to Matlab and Visual C++ than your files.


  Regards,
  John Hall

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20130904/564aabed/attachment.html>


More information about the Ipopt mailing list