Problems with external QP-Solvers (QPOAES, OSQP, QPDUNES)

Hi :wave:

Interface:
-) Matlab
-) Windows

I compiled acados with OSQP and QPOASES. However, everytime when I try to run the minimal_example_ocp.m, the compilation fails mostly with similar errors depending if I compile only with OSQP or both. I tried with external solvers off and it does work.

Here is one of the errors:

C:/Users/phman/repos/Z_acados/interfaces/acados_matlab_octave/../../lib/qpOASES_e.lib(MessageHandling.c.obj):MessageHandling.c:(.text+0x93):
undefined reference to `__imp___acrt_iob_func'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\acados_ocp_solver_pendulum.dir\build.make:109: recipe for target 'acados_ocp_solver_pendulum.dll'
failed

Additionally, I think I found a bug in the auto generated CMakeFile:

Got status 1, result: CMake Error at CMakeLists.txt:70 (set):
  Syntax error in cmake code at

    C:/Users/phman/repos/Z_acados/examples/acados_matlab_octave/getting_started/c_generated_code/CMakeLists.txt:71

  when parsing string

    pendulum_model\pendulum_expl_ode_fun.c

  Invalid character escape '\p'.

It is due to the backslash in the CMakeLists file.

An easy fix which I have done, is to modify the GenerateContext() on line 154 to not use out{end+1} = fullfile(rel_fun_dir, [fun_name, '.c']); but rather replace it with out{end+1} = [rel_fun_dir,'/', fun_name, '.c']

Help would be appreciated with the other QP Solvers!

Best wishes!

Hi,

Thanks for reporting this!
The second issue was introduced very recently and is fixed as you suggested here: CMake always uses / separators by FreyJo · Pull Request #1285 · acados/acados · GitHub

The first issue is unrelated to the second one.
What are the issues with the other QP solvers?
I guess that they are very different.
I would also suggest trying with FULL_CONDENSING_DAQP.
DAQP is in my experience faster than qpOASES and should be easier to compile.

Best,
Jonathan