Error when installing with DAQP (MATLAB, Windows)

Hi :wave:

I am using acados in MATLAB R2021b on Windows 10. If I compile with DAQP, i.e., run acados_install_windows('-DBUILD_SHARED_LIBS=OFF -DACADOS_WITH_DAQP=ON'), running any example results in the following error:

Error using acados_template_mex.compile_ocp_shared_lib (line 70)
Building templated code as shared library failed.
Got status 2, result: Consolidate compiler generated dependencies of target model_quad_mpc
[  7%] Building C object CMakeFiles/model_quad_mpc.dir/quad_mpc_model/quad_mpc_dyn_disc_phi_fun.c.obj
[ 15%] Building C object CMakeFiles/model_quad_mpc.dir/quad_mpc_model/quad_mpc_dyn_disc_phi_fun_jac.c.obj
[ 15%] Built target model_quad_mpc
Consolidate compiler generated dependencies of target ocp_quad_mpc
[ 23%] Building C object CMakeFiles/ocp_quad_mpc.dir/quad_mpc_cost/quad_mpc_cost_ext_cost_0_fun.c.obj
[ 30%] Building C object CMakeFiles/ocp_quad_mpc.dir/quad_mpc_cost/quad_mpc_cost_ext_cost_0_fun_jac.c.obj
[ 38%] Building C object
CMakeFiles/ocp_quad_mpc.dir/quad_mpc_cost/quad_mpc_cost_ext_cost_0_fun_jac_hess.c.obj
[ 46%] Building C object CMakeFiles/ocp_quad_mpc.dir/quad_mpc_cost/quad_mpc_cost_ext_cost_fun.c.obj
[ 53%] Building C object CMakeFiles/ocp_quad_mpc.dir/quad_mpc_cost/quad_mpc_cost_ext_cost_fun_jac.c.obj
[ 61%] Building C object CMakeFiles/ocp_quad_mpc.dir/quad_mpc_cost/quad_mpc_cost_ext_cost_fun_jac_hess.c.obj
[ 69%] Building C object CMakeFiles/ocp_quad_mpc.dir/quad_mpc_cost/quad_mpc_cost_ext_cost_e_fun.c.obj
[ 76%] Building C object CMakeFiles/ocp_quad_mpc.dir/quad_mpc_cost/quad_mpc_cost_ext_cost_e_fun_jac.c.obj
[ 84%] Building C object
CMakeFiles/ocp_quad_mpc.dir/quad_mpc_cost/quad_mpc_cost_ext_cost_e_fun_jac_hess.c.obj
[ 92%] Building C object CMakeFiles/ocp_quad_mpc.dir/acados_solver_quad_mpc.c.obj
[ 92%] Built target ocp_quad_mpc
[100%] Linking C shared library acados_ocp_solver_quad_mpc.dll
C:/Users/PBM/Desktop/Posao/Razno/acados/examples/acados_matlab_octave/../../lib/acados.lib(dense_qp_daqp.c.obj):dense_qp_daqp.c:(.text+0x6c):
undefined reference to `daqp_default_settings'
C:/Users/PBM/Desktop/Posao/Razno/acados/examples/acados_matlab_octave/../../lib/acados.lib(dense_qp_daqp.c.obj):dense_qp_daqp.c:(.text+0x1173):
undefined reference to `update_ldp'
C:/Users/PBM/Desktop/Posao/Razno/acados/examples/acados_matlab_octave/../../lib/acados.lib(dense_qp_daqp.c.obj):dense_qp_daqp.c:(.text+0x119d):
undefined reference to `daqp_ldp'
C:/Users/PBM/Desktop/Posao/Razno/acados/examples/acados_matlab_octave/../../lib/acados.lib(dense_qp_daqp.c.obj):dense_qp_daqp.c:(.text+0x11ac):
undefined reference to `ldp2qp_solution'
C:/Users/PBM/Desktop/Posao/Razno/acados/examples/acados_matlab_octave/../../lib/acados.lib(dense_qp_daqp.c.obj):dense_qp_daqp.c:(.text+0x1864):
undefined reference to `deactivate_constraints'
C:/Users/PBM/Desktop/Posao/Razno/acados/examples/acados_matlab_octave/../../lib/acados.lib(dense_qp_daqp.c.obj):dense_qp_daqp.c:(.text+0x18cd):
undefined reference to `activate_constraints'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\acados_ocp_solver_quad_mpc.dir\build.make:105: recipe for target 'acados_ocp_solver_quad_mpc.dll'
failed
mingw32-make.exe[2]: *** [acados_ocp_solver_quad_mpc.dll] Error 1
CMakeFiles\Makefile2:138: recipe for target 'CMakeFiles/acados_ocp_solver_quad_mpc.dir/all' failed
mingw32-make.exe[1]: *** [CMakeFiles/acados_ocp_solver_quad_mpc.dir/all] Error 2
Makefile:134: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2


Error in ocp_generate_c_code (line 279)
    acados_template_mex.compile_ocp_shared_lib(obj.acados_ocp_nlp_json.code_export_directory)

Error in acados_ocp (line 203)
            ocp_generate_c_code(obj);

Error in example_closed_loop (line 92)
ocp = acados_ocp(ocp_model, ocp_opts);

even though the solver is set to partial_condensing_hpipm.
Compiling with another solver, e.g., OSQP instead of DAQP, works fine.

The output of running mex.getCompilerConfigurations('C', 'Selected') is:

             Name: 'MinGW64 Compiler (C)'
     Manufacturer: 'GNU'
         Language: 'C'
          Version: '6.3.0'
         Location: 'C:\ProgramData\MATLAB\SupportPackages\R2021b\3P.instrset\mingw_w64.instrset'
        ShortName: 'mingw64'
         Priority: 'E'
          Details: [1×1 mex.CompilerConfigurationDetails]
       LinkerName: 'C:\ProgramData\MATLAB\SupportPackages\R2021b\3P.instrset\mingw_w64.instrset\bin\gcc'
    LinkerVersion: ''
           MexOpt: 'C:\Users\PBM\AppData\Roaming\MathWorks\MATLAB\R2021b\mex_C_win64.xml'

Does anyone have an idea about fixing this?

Thanks in advance!

Josip

Hi Josip,

I had a look and think that this PR should fix your issue.

Can you confirm this?

Best,
Jonathan

Hi Jonathan,

thank you for the quick reply and update.
It’s not complaining about DAQP anymore, but now I get the following error when running the getting_started/minimal_example_closed_loop file:

Constraint detection for path constraints.
constraint 1 is reformulated as bound on u.
F
 
compiling C:\Users\PBM\Desktop\Posao\Razno\acados\examples\acados_matlab_octave\..\..\interfaces\acados_matlab_octave\ocp_get_cost.c
Building with 'MinGW64 Compiler (C)'.
MEX completed successfully.
compiling C:\Users\PBM\Desktop\Posao\Razno\acados\examples\acados_matlab_octave\..\..\interfaces\acados_matlab_octave\ocp_get.c
Building with 'MinGW64 Compiler (C)'.
MEX completed successfully.
compiling C:\Users\PBM\Desktop\Posao\Razno\acados\examples\acados_matlab_octave\..\..\interfaces\acados_matlab_octave\ocp_eval_param_sens.c
Building with 'MinGW64 Compiler (C)'.
MEX completed successfully.
acados MEX interface compiled successfully
Warning: cost_y_ref not defined for ocp json.
Using zeros(ny,1) by default. 
> In set_up_acados_ocp_nlp_json (line 437)
In acados_ocp (line 202)
In minimal_example_closed_loop (line 125) 
Warning: cost_y_ref_0 not defined for ocp json.
Using zeros(ny_0,1) by default. 
> In set_up_acados_ocp_nlp_json (line 454)
In acados_ocp (line 202)
In minimal_example_closed_loop (line 125) 
Warning: cost_y_ref_e not defined for ocp json.
Using zeros(ny_e,1) by default. 
> In set_up_acados_ocp_nlp_json (line 470)
In acados_ocp (line 202)
In minimal_example_closed_loop (line 125) 

dy_dz = 

[]

u = 

[]
Successfully rendered acados templates!
compiling acados_mex_create_pendulum.c
Building with 'MinGW64 Compiler (C)'.
MEX completed successfully.
compiling acados_mex_free_pendulum.c
Building with 'MinGW64 Compiler (C)'.
MEX completed successfully.
compiling acados_mex_solve_pendulum.c
Building with 'MinGW64 Compiler (C)'.
MEX completed successfully.
compiling acados_mex_set_pendulum.c
Building with 'MinGW64 Compiler (C)'.
MEX completed successfully.
delete template...
Warning: The following error was caught while executing 'pendulum_mex_solver' class destructor:
Error using cd
Path must be a text scalar.

Error in pendulum_mex_solver/delete (line 64)
            cd(obj.code_gen_dir);

Error in pendulum_mex_solver (line 49)
            make_mex_pendulum();

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

Error in minimal_example_closed_loop (line 125)
ocp = acados_ocp(ocp_model, ocp_opts); 
> In pendulum_mex_solver (line 49)
In acados_ocp (line 212)
In minimal_example_closed_loop (line 125) 
Invalid MEX-file
'C:\Users\PBM\Desktop\Posao\Razno\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_closed_loop (line 125)
ocp = acados_ocp(ocp_model, ocp_opts);

This error seems familiar from other topics on the forum so I will take a look into it. The mentioned .mexw64 file is in the right place.

Making the same changes here and here didn’t help. When the solver is set to full_condensing_daqp, MATLAB crashes.

Best regards,
Josip

Sorry, I unfortunately don’t know what is the issue for the error:

The specified module could not be found.

Not even which module…

I added the flag in the other places you mentioned in the PR I made before.

If anyone knows more about this error or has a fix, it would be very welcome!

Hi @josipkh ,
Did you find any solution to your problem. I am also facing exactly the same issue.
Any help is appreciated.

Thanks
Siddhik

Hi @siddhikr ,

no, unfortunately I didn’t find a solution so I just used different solvers…
If I look into it again, I will update this topic.

Sorry I couldn’t help more.

Kind regards,
Josip

1 Like