Opti + qpoases + code generator

480 views
Skip to first unread message

Sebastian Almagro

unread,
Feb 23, 2021, 6:36:33 PM2/23/21
to CasADi
Dear casadi community,

I am trying to generate code from opti using qpoases solver with this simple example:


I am getting the following error:

CasADi - 2021-02-24 00:20:28 WARNING("The function "solver_qpsol", which is of type "QpoasesInterface" cannot be code generated. The generation will proceed, but compilation of the code will not be possible.") [.../casadi/core/function_internal.cpp:2453]

However, when using a simple formulation (no opti) I am able to generate code using generate_dependencies.

Is there a way generate dependencies from opti?

Thank you very much.

Joris Gillis

unread,
Mar 12, 2021, 3:56:01 PM3/12/21
to CasADi
Hi there,

The API call generate_dependencies is not available no,
but what do you want to do with result? Load it back in for speedup?
If so you might as well pass jit options to opti.solver to get the same effect:

Best regards,
   Joris

Sebastian Almagro

unread,
Mar 12, 2021, 4:15:02 PM3/12/21
to CasADi
Exactly, that is my goal. Thank you very much for the recommendation.

But also I was trying to formulate and generate the code from python and then using it iteratively from c++ directly.

I know that I could formulate directly from c++, but took me a while to familiarize myself with the API.

Best regards,
Sebastian

Joris Gillis

unread,
Mar 12, 2021, 5:24:35 PM3/12/21
to CasADi
Dear Sebastian,

I'm confused about "I am able to generate code using generate_dependencies".
Our qpsolvers do not support generate_dependencies.
Indeed, the dependencies of a qpsolver are simply a bunch of matrices/vectors which you could also get via opti.solver('qpoases',{'dump_in':True})

Best regards,
  Joris
Reply all
Reply to author
Forward
0 new messages