Compiling acados matlab with other QP solvers


I was trying to compile the MATLAB version of acados with the other QP solvers (like QPOASES, osqp etc.), but I got an invalid MEX file and error stating ‘module not found’. Also, when trying to use the default QP solver (HPIPM), it gives the same error. I can use acados just fine when the ‘CmakeConfigString’ is empty.
I tried adding the ‘include’ and ‘c_generated_code’ to the ‘path’ environmental variable, but this did not solve the issue.
I heard that this might be a known issue (@FreyJo?), so I was wondering if there is a workaround?

I compiled acados using:


and then tried to run the minimal_example_ocp.m. The complete error reads as

Invalid MEX-file
'C:\Users\s156407\Documents\acados\examples\acados_matlab_octave\getting_started\c_generated_code\acados_mex_create_pendulum.mexw64': The specified
module could not be found.

Error in pendulum_mex_solver (line 50)
            obj.C_ocp = acados_mex_create_pendulum();

Error in acados_ocp (line 212)
            obj.t_ocp = mex_solver();

Error in minimal_example_ocp (line 110)
ocp = acados_ocp(ocp_model, ocp_opts, simulink_opts);

Thank you in advance.



is there a reason you want to build acados with the option “DBUILD_SHARED_LIBS=ON”? Because the default setting is OFF. That would explain why it works when the “CmakeConfigString” is empty.

As far as i know, the Matlab error “The specified module could not be found.” can mean that a library is not found.

Best regards,

1 Like

Hi Alex,

No there is no specific reason to build with the shared libraries, I just hoped it would help to find the module. However, I also tried without and it didn’t solve the error.