[Coin-ipopt] Ipopt works with Matlab... almost!

Andreas Waechter andreasw at watson.ibm.com
Tue Nov 28 12:20:44 EST 2006


Hi Peter,

This is very nice news!  I'm very happy to hear that you have been able to 
write a MEX interface for the new C++ version of Ipopt.

It is hard to say why you see the problem you describe without seeing the 
code.  A first idea that comes to my mind is that you might have used a 
regular pointer instead of a SmartPtr to store what you got when you 
created a new IpoptApplication, and then manually deleted the 
IpoptApplication?  In that case, the delete is executed twice (SmartPtr 
implements a reference count that is initialized incorrectly if you don't 
store what you get from 'new' immediately in a SmartPtr).  So, please make 
sure you use a SmartPtr...

In general, I think it would be really nice to distribute the Mex 
interface with the Ipopt distribution!  Would you consider contributing 
your interface code to the Ipopt project?  You can find some information 
on contributions here:

http://www.coin-or.org/contributions.html#contributions

I have to admit that I have not been very good this year with integrating 
contributions quickly into the official release, due to time constraints. 
For example, I have received a contribution for using Ipopt from Scilab, 
and it is on my list to integrate it.  But I will try to catch up with a 
number of things, and it would be great if your interface could be part of 
that, too.

Cheers,

Andreas


On Thu, 23 Nov 2006, Peter Carbonetto wrote:

> After a considerable amount of head-scratching and strong orange pekoke teas, 
> I managed to compile the IPOPT Library so that it works with Matlab 7.3 for 
> Linux. Matlab only likes gcc 3.4.5 and position-independent code I 
> discovered.
>
> It all works beautifully in Matlab on the provied Hock & Schittkowski test 
> problem #71, arriving at the solution... until it dramatically crashes 
> Matlab. Since it only crashes at the very end, it means that there is 
> something strange happening in one of the object destructors. From the output 
> Matlab gives me (see below), it appears to be something wrong either with the 
> destruction of a SmartPtr object or in the function call ReleasePointer().
>
> I would dearly like to get this working with Matlab. Any suggestions or 
> leads?
>
> Peter Carbonetto
> PhD Candidate
> Dept. of Computer Science
> University of British Columbia
> http://www.cs.ubc.ca/~pcarbo
>
>  [0] 0x00000011(0x0857c330, 0xb2bef830, 0xbfa7b3d8, 0xb2a69138)
>  [1] libipopt.so.0:Ipopt::SmartPtr<Ipopt::TNLP>::~SmartPtr()~(0x0857c330, 
> 0xb74c8140, 0x085840a8, 0xb75c075c) + 29 bytes
>  [2] libipopt.so.0:Ipopt::TNLPAdapter::~TNLPAdapter()~(0x0857c328, 
> 0x0857c47c, 0xbfa7b408, 0xb740fa64) + 1370 bytes
>  [3] 
> libipopt.so.0:Ipopt::SmartPtr<Ipopt::NLP>::ReleasePointer_()~(0x0857c47c, 
> 0xb2bef830, 0xbfa7b438, 0xb2ab0501) + 93 bytes
>  [4] libipopt.so.0:Ipopt::SmartPtr<Ipopt::NLP>::~SmartPtr()~(0x0857c47c, 
> 0xb2bef830, 0xbfa7b428, 0xb2a4dd21) + 29 bytes
>  [5] libipopt.so.0:Ipopt::GradientScaling::~GradientScaling()~(0x0857c450, 
> 0x0857c498, 0x085819d0, 0xb75c075c) + 47 bytes
>  [6] 
> libipopt.so.0:Ipopt::SmartPtr<Ipopt::NLPScalingObject>::ReleasePointer_()~(0x0857c498, 
> 0xb2bef830, 0xbfa7b498, 0xb2b02ed7) + 93 bytes
>  [7] 
> libipopt.so.0:Ipopt::SmartPtr<Ipopt::NLPScalingObject>::~SmartPtr()~(0x0857c498, 
> 0x0857c49c, 0, 0xb75c075c) + 29 bytes
>  [8] libipopt.so.0:Ipopt::IpoptNLP::~IpoptNLP()~(0x0857c490, 0xb74c8140, 
> 0x0857d020, 0xb75c075c) + 47 bytes
>  [9] libipopt.so.0:Ipopt::OrigIpoptNLP::~OrigIpoptNLP()~(0x0857c490, 
> 0x0857dbec, 0xbfa7b4e8, 0xb759ab21) + 1688 bytes
>  [10] 
> libipopt.so.0:Ipopt::SmartPtr<Ipopt::IpoptNLP>::ReleasePointer_()~(0x0857dbec, 
> 0xb2bef830, 0xbfa7b528, 0xb2a7c8ad) + 93 bytes
>  [11] 
> libipopt.so.0:Ipopt::SmartPtr<Ipopt::IpoptNLP>::~SmartPtr()~(0x0857dbec, 
> 0x0857dbfc, 0xbfa7b518, 0xb759ab21) + 29 bytes
>  [12] 
> libipopt.so.0:Ipopt::AlgorithmStrategyObject::~AlgorithmStrategyObject()~(0x0857dbe0, 
> 0xbfa7b590, 0xbfa7b558, 0xb74c8148) + 129 bytes
>  [13] libipopt.so.0:Ipopt::IpoptAlgorithm::~IpoptAlgorithm()~(0x0857dbe0, 
> 0x08567354, 0xbfa7b590, 0) + 378 bytes
>  [14] 
> libipopt.so.0:Ipopt::SmartPtr<Ipopt::IpoptAlgorithm>::ReleasePointer_()~(0x08567354, 
> 0xb2bef830, 0xbfa7b5b8, 0xb2a563f1) + 93 bytes
>  [15] 
> libipopt.so.0:Ipopt::SmartPtr<Ipopt::IpoptAlgorithm>::~SmartPtr()~(0x08567354, 
> 0xbfa7bf10, 0xbfa7b5a8, 0xb759ab21) + 29 bytes
>  [16] 
> libipopt.so.0:Ipopt::IpoptApplication::~IpoptApplication()~(0x08567338, 
> 0xbfa7b610, 0xbfa7b620, 1) + 211 bytes
>
> _______________________________________________
> Coin-ipopt mailing list
> Coin-ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-ipopt
>



More information about the Coin-ipopt mailing list