[WIP] MATLAB interface#360
Conversation
|
Really cool Stefano! |
|
Hi @cvanaret As far I know, it's possible to use Matlab on the Github runners for public repos, so no need for self-hosted runners (see here). So far, I was able to build a Matlab mex (via cmake) even for a private repo without a Matlab license, as this step only requires the Matlab installation and doesn’t actually call MATLAB itself. I’ll try running a test on GitHub runners to confirm that this works as well. |
Lagrangian Hessian is now specified using options.HessianFnc in the high-level interface, similar to Matlab fmincon. Fallback to LBFGS if no HessianFnc is provided
bin for Windows, lib otherwise (mac-os etc)
|
Matlab interface is almost completed; a few tests may still be required. Currently:
I was able to successfully run the MATLAB test examples on both Windows and macOS GitHub runners; however, some Python tests are still failing (I don’t know the reason yet). Note that macOS was quite challenging: a segfault during cleanup on exit causes MATLAB to crash. The current workaround is to lock the compiled MEX file to prevent it from being unloaded, so that TLS cleanup handlers remain valid (cf. matlab_openmp_tls_bug). |
|
Great job! I'll have a look why the Python workflows fails. |
|
OK it seems to work. The bug had nothing to do with the Matlab interface but was apparently caused by the class |
|
Thanks Charlie!!! Edit: I see that the Python interface uses a slightly different approach. I'm still not sure which one is best. |
|
It's ok if the Python and Matlab interfaces don't use exactly the same approach. We should "ship fast" and improve later :) |
Hi Charlie,
I've just written a first draft of the MATLAB interface. It has also some minor changes in the C/C++ interface. For now it's only a draft, may be unstable at the moment.
Track list:
result = uno_optimize(model[, options, callbacks])andoptions = uno_options([preset])interfaces\Matlab\Uno_mex_utilities.hppuno_optimizemex function