Code generation bug?

Hi :wave:

When I add the following lines to the chain_mass example (python interface) at line 154 in :

    ocp.constraints.uh = np.array([10000]) 
    ocp.constraints.lh = np.array([-10000])
    ocp.model.con_h_expr = model.x[0]

The code generation fails. Why is this? Output is as follows:

acados_solver_chain_mass_ds_3.c:(.text+0x7eb): undefined reference to `chain_mass_ds_3_constr_h_fun_jac_uxt_zt'
/usr/bin/ld: acados_solver_chain_mass_ds_3.c:(.text+0x7f6): undefined reference to `chain_mass_ds_3_constr_h_fun_jac_uxt_zt_n_in'
/usr/bin/ld: acados_solver_chain_mass_ds_3.c:(.text+0x816): undefined reference to `chain_mass_ds_3_constr_h_fun_jac_uxt_zt_n_out'
/usr/bin/ld: acados_solver_chain_mass_ds_3.c:(.text+0x82d): undefined reference to `chain_mass_ds_3_constr_h_fun_jac_uxt_zt_sparsity_in'
/usr/bin/ld: acados_solver_chain_mass_ds_3.c:(.text+0x83c): undefined reference to `chain_mass_ds_3_constr_h_fun_jac_uxt_zt_sparsity_out'
/usr/bin/ld: acados_solver_chain_mass_ds_3.c:(.text+0x847): undefined reference to `chain_mass_ds_3_constr_h_fun_jac_uxt_zt_work'
/usr/bin/ld: acados_solver_chain_mass_ds_3.c:(.text+0x867): undefined reference to `chain_mass_ds_3_constr_h_fun'
/usr/bin/ld: acados_solver_chain_mass_ds_3.c:(.text+0x86e): undefined reference to `chain_mass_ds_3_constr_h_fun_n_in'
/usr/bin/ld: acados_solver_chain_mass_ds_3.c:(.text+0x88e): undefined reference to `chain_mass_ds_3_constr_h_fun_n_out'
/usr/bin/ld: acados_solver_chain_mass_ds_3.c:(.text+0x8a5): undefined reference to `chain_mass_ds_3_constr_h_fun_sparsity_in'
/usr/bin/ld: acados_solver_chain_mass_ds_3.c:(.text+0x8b4): undefined reference to `chain_mass_ds_3_constr_h_fun_sparsity_out'
/usr/bin/ld: acados_solver_chain_mass_ds_3.c:(.text+0x8bf): undefined reference to `chain_mass_ds_3_constr_h_fun_work'
collect2: error: ld returned 1 exit status
distcc[92618] ERROR: compile (null) on localhost failed
make: *** [Makefile:116: example] Error 1

I encountered this error in my own example, but reverse engineered it to one of the examples to make it easily reproducible :).

It seems to be an issue with a combination of SIM/OCP solver, since when I comment out the simsolver the code generation works again.

Stuff seems to be overwritten. If you switch the order of defining OCPsolver/SIMSOLVER in the code to first SIM then OCP it works again.

Sorry, I cannot reproduce this.
It works for me with the change you described, no idea whats up.

I just tried on a different computer after cloning and installing, but the bug shows again. Note that this output appears after make in the c_generated folder, forgot to mention that important detail. Thanks for replying, appreciate it!

In general the pattern to me seems to first create the ocp_solver and then the sim_solver IF you have a h constraint. If not, both orders work fine (the error is only related to h)