[Ipopt] Using ipopt with EXCEL

Raimund Gabriel raimund.gabriel at utanet.at
Wed May 24 16:47:10 EDT 2017


I am trying to use a sample IPOPT problem written in C and compiled as a 
DLL which is used in EXCEL VBA code.
I am using Cygwin to compile the DLL in Windows. (As stand allone EXE, 
it works propperly as expected).
 From EXCEL, I can access the DLL without problems and can exchange data.
However, as soon as the DLL starts to run IPOPT functions, EXCEL closes 
with Errors.
 From my Debugging activities, this results from memory allocaction.
If the C code in the DLL tries to allocate memory using malloc, EXCEL 
will run into ERRORS.
If the C code in the DLL allocates memory via the functions LocalAlloc 
(from windows.h) instead, everything works properly.

Now, I would obviously need to change the malloc calls in whole IPOPT 
code (and maybe BLAS, LAPACK and the solvers?) from malloc to
LocalAlloc.
Is there a pain - free way to do that? Any chance for a wrapper or any 
way to make EXCEL to accept the heap management of the C-DLL created by 
Cygwin?
Any configuration options?

Thank you for any help!


More information about the Ipopt mailing list