Open DenisSbragion opened 3 years ago
I too would like to see mexIPOPT modified to work seamlessly on Octave.
On a macOS Big Sur 11.6.1 with Octave 6.2, computer
returns: x86_64-apple-darwin18.7.0
On Ubuntu 20.04.3 LTS with Octave 6.4, computer
returns: x86_64-pc-linux-gnu
FWIW, using the MatlabInterface code from IPOPT 3.11.9, I am still able to build an IPOPT MEX file for Octave for the current IPOPT version (3.14.4).
I have added cmake build not tested for octave. Can you add a cmake support for Octave?
Can you add a cmake support for Octave?
I'm not sure if that question was directed at me but, unfortunately, I'm swamped with other commitments and don't really have the expertise to do it anyway.
I have added cmake build not tested for octave. Can you add a cmake support for Octave?
I'm not sure I got this right, BTW sooner or later I'll have to recompile Octave to the latest version, so I will necessarily test any change introduced.
FWIW, I use mexIPOPT 1.1.6 to build an IPOPT MEX that works with Octave on GitHub runners. Actually, it's in my own fork of mexIPOPT in a branch without binaries and IPOPT source.
See the action.yml in https://github.com/MATPOWER/action-install-ipopt-octave] to see what is working for me on Linux (with Octave and IPOPT installed via apt-get
) and macOS (with Octave installed by brew
and IPOPT compiled from source).
Hello,
I tried to compile the mex interface under Octave but there are some minor problems. The main issue it that mxArray is defined as a void under Octave, so function definitions with parameters like:
MatlabFunctionHandle::bind( mxArray const p[], char const error_msg[] )
Give an error, as arrays of voids aren't allowed under C++. To work it needs to be defined as:
MatlabFunctionHandle::bind( mxArray const * p, char const error_msg[] )
I think this different definition should have no adverse effect in the Matlab environment, but I couldn't check as I don't have Matlab.
At the end a patch which fix the few function definitions having the problem, and ipopt.m in order to accept the architectures used by Octave under Windows. This probably needs further fixes to work with Octave under Linux or Mac, but I have no way to check the architectures reported by the computer() function under those operating systems.
Thanks for this very well designed interface.
Bye,
Denis Sbragion
** Patch following **