Acados templated MEX solver support for Windows

Hi Jonathan,
I am trying to understand how to use the acados templated mex solver by running the test file “run_test_template_ocp_linear_dae.m” and I got the following error:

Error using mex
MEX cannot find library 'acados_ocp_solver_toy_dae2', specified with the -l option.
 MEX searched for a file with one of the following names:
 libacados_ocp_solver_toy_dae2.a
acados_ocp_solver_toy_dae2.lib
libacados_ocp_solver_toy_dae2.lib
 Verify the library name is correct. If the library is not
 on the existing path, specify the path with the -L option.
Error in make_mex_toy_dae2 (line 104)
            mex(FLAGS, acados_include, template_lib_include, external_include,
            blasfeo_include, hpipm_include,...
Error in toy_dae2_mex_solver (line 49)
            make_mex_toy_dae2();
Error in test_template_ocp_linear_dae (line 228)
eval( command );

It seems that the mex function cannot find the right library file. I attached a print of this folder where there is a file called “libacados_ocp_solver_toy_dae2.so”. I am using the Matlab 2019b with Casadi 3.5.5 in Windows 10.

Can you help me to solve this issue?
Best regards,
Paulo

Hi Paulo,

unfortunately, the MEX wrapper to the template based solver is not working on Windows yet.
One would have to adapt the templated Makefile:

I have a WIP branch, where I tried to make that work: GitHub - FreyJo/acados at wip_template_mex_windows
This commit: MEX template: attempt to make it work on Windows, by also making an i… · FreyJo/acados@3b47f12 · GitHub

However, currently Matlab just doesn’t launch on my Windows and I have other priorities than working on that.
Equivalence of the native MEX solver and template based one can be checked on Linux. The test you mentioned is run on Github Actions.

The template based solver, can be used on Windows only via Simulink for now.

Best,
Jonathan

Update: The Matlab OCP solver is fully template based now, since: