Hi
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