Acados crashing when changing solvers - matlab interface

Hi guys,

my MPC with HPIPM is running perfectly. If i try to change the solver to e.g. “full_condensing_qpoases” or osqp, matlab crashes with an access violation while creating the acados_ocp.
Is there anything I have to change? I already recompiled the qpoases, osqp and acados libaries.
The access violation comes from L138 at ocp_create in

Did I do a simple mistake? Is this a known issue?

Thanks, Alex

@FreyJo what do I have to change in the syntax of the post here, so that the github link is being shown with contents?

Hi Alex,

Using QPOASES should not lead to a crash when creating the OCP solver.
You should install acados using CMake with qpOASES, as written here
https://docs.acados.org/interfaces/index.html#installation

Can you maybe attach the full output of the error?
Is this just a problem with your formulation, or does it also occur, when you switch the QP solver in one of the examples?

To make the Github preview available, paste the link in a separate line of the post.

Cheers,
Jonathan

Hi @FreyJo,

thx for your reply. So only recompiling the libraries obviously is not enough, didnt know that. The examples crash as well with qpoases set as solver.

I just tried to clone the repository again and all the folders in \external are empty. Tried it on two systems on windows. git clone https://github.com/acados/acados.git
Maybe the linking to the external library in github is broken?

Alex

The QP solvers are git submodules, they get cloned by running:

git submodule update --recursive --init

https://docs.acados.org/installation/index.html#clone-acados

1 Like

Wow, what a morning… sry for this.
Thanks, Alex

I completely reinstalled and rebuild acados in a new directory. I used these steps: Installation — acados documentation but with -D ACADOS_WITH_QPOASES=ON. It build with a warning while building the acados source files:

C:\acados_2907\acados\acados\utils\external_function_generic.c: In function 'external_function_param_generic_calculate_size':
C:\acados_2907\acados\acados\utils\external_function_generic.c:69:9: warning: unused variable 'ii' [-Wunused-variable]
     int ii;
         ^~
C:\acados_2907\acados\acados\utils\external_function_generic.c: In function 'external_function_param_generic_assign':
C:\acados_2907\acados\acados\utils\external_function_generic.c:98:9: warning: unused variable 'ii' [-Wunused-variable]
     int ii;

When trying to run the minimal_example_ocp (with normal setting, so HPIPM) I get new errors:

compiling C:\acados_2907\acados\examples\acados_matlab_octave....\interfaces\acados_matlab_octave\ocp_create.c
Building with ‘MinGW64 Compiler (C)’.
Error using mex
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x188):
undefined reference to QProblem_calculateMemorySize' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1b6): undefined reference to QProblemB_calculateMemorySize’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x415):
undefined reference to QProblemB_assignMemory' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x41d): undefined reference to QProblemB_calculateMemorySize’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x4b6):
undefined reference to QProblem_assignMemory' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x4c0): undefined reference to QProblem_calculateMemorySize’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xa1e):
undefined reference to QProblemBCON' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xa2b): undefined reference to QProblemB_setPrintLevel’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xa33):
undefined reference to QProblemB_printProperties' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xa9e): undefined reference to QProblemB_init’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xabd):
undefined reference to QProblemB_getPrimalSolution' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xac8): undefined reference to QProblemB_getDualSolution’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xe0b):
undefined reference to QProblem_hotstart' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xe34): undefined reference to QProblem_getPrimalSolution’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xe3f):
undefined reference to QProblem_getDualSolution' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xe71): undefined reference to QProblemCON’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xe7e):
undefined reference to QProblem_setPrintLevel' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xe86): undefined reference to QProblem_printProperties’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0xf49):
undefined reference to QProblem_initW' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x10f0): undefined reference to QProblemB_initW’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1166):
undefined reference to QProblemB_hotstart' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1176): undefined reference to QProblemB_getPrimalSolution’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1181):
undefined reference to QProblemB_getDualSolution' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1203): undefined reference to QProblem_init’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x121b):
undefined reference to Options_setToMPC' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1267): undefined reference to OptionsCPY’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x126f):
undefined reference to Options_ensureConsistency' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1282): undefined reference to QProblem_setPrintLevel’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1531):
undefined reference to Options_setToMPC' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x157d): undefined reference to OptionsCPY’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1585):
undefined reference to Options_ensureConsistency' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1598): undefined reference to QProblemB_setPrintLevel’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x15ee):
undefined reference to QProblem_initW' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1637): undefined reference to QProblemBCON’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1644):
undefined reference to QProblemB_setPrintLevel' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x169b): undefined reference to QProblemB_init’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x16f3):
undefined reference to QProblem_init' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1734): undefined reference to QProblem_hotstart’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1762):
undefined reference to QProblemCON' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1774): undefined reference to QProblem_setPrintLevel’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x17f5):
undefined reference to QProblem_init' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1817): undefined reference to Options_setToMPC’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1863):
undefined reference to OptionsCPY' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x186b): undefined reference to Options_ensureConsistency’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x187e):
undefined reference to QProblem_setPrintLevel' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x18cc): undefined reference to QProblem_init’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x18e4):
undefined reference to Options_setToMPC' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1938): undefined reference to OptionsCPY’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x1948):
undefined reference to Options_ensureConsistency' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(dense_qp_qpoases.c.obj):dense_qp_qpoases.c:(.text+0x195b): undefined reference to QProblem_setPrintLevel’
collect2.exe: error: ld returned 1 exit status

Error in ocp_compile_interface (line 169)
mex(mex_flags, FLAGS, acados_include, acados_interfaces_include, external_include, blasfeo_include,
hpipm_include,…

Error in acados_ocp (line 130)
ocp_compile_interface(obj.opts_struct);

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

Alex

EDIT:
Same thing happening when building with OSQP and running minimal_example:

compiling C:\acados_2907\acados\examples\acados_matlab_octave....\interfaces\acados_matlab_octave\ocp_create.c
Building with ‘MinGW64 Compiler (C)’.
Error using mex
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x4c):
undefined reference to osqp_set_default_settings' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x1551): undefined reference to osqp_update_lin_cost’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x1580):
undefined reference to osqp_update_P_A' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x1591): undefined reference to osqp_update_bounds’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x15aa):
undefined reference to osqp_solve' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x2309): undefined reference to cold_start’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x24ac):
undefined reference to set_rho_vec' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x24bb): undefined reference to load_linsys_solver’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x24f4):
undefined reference to init_linsys_solver' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x254b): undefined reference to update_status’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x259e):
undefined reference to print_setup_header' C:\acados_2907\acados\examples\acados_matlab_octave\..\..\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x3529): undefined reference to cold_start’
C:\acados_2907\acados\examples\acados_matlab_octave....\lib\libacados.lib(ocp_qp_osqp.c.obj):ocp_qp_osqp.c:(.text+0x3574):
undefined reference to `scale_data’
collect2.exe: error: ld returned 1 exit status

Error in ocp_compile_interface (line 169)
mex(mex_flags, FLAGS, acados_include, acados_interfaces_include, external_include, blasfeo_include,
hpipm_include,…

Error in acados_ocp (line 130)
ocp_compile_interface(obj.opts_struct);

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

I addressed this issue here, including a temporary fix: https://github.com/acados/acados/issues/651

1 Like