Hello,
first of all, thank you so much for creating this fantastic solver! I love its speed.
I generated C Code from my MPC problem in Matlab, and now want to build this C Code within a C++ project, i.e. I have a top-levlew CMakeList that includes and adds the subdirectory with the generated C Code.
When I include the âworkspace.hâ now in my top-level âmain.cppâ, I get the following error: âcannot convert âdoubleâ to âlinsys_solver_typeâ in initializationâ.
I digged into the âworkspace.hâ, and found the issue in the creation of the object:
OSQPSettings settings = {
(c_float)0.10000000000000000555,
(c_float)0.00000100000000000000,
10,
4000,
(c_float)0.00100000000000000002,
(c_float)0.00100000000000000002,
(c_float)0.00010000000000000000,
(c_float)0.00010000000000000000,
(c_float)1.60000000000000008882,
0.000000000000, // <-- THIS SEEMS TO BE THE ISSUE
0,
25,
1,
#ifdef PROFILING
(c_float)0.00000000000000000000,
#endif // PROFILING
};
I tried a few things, including the fix from the âBuild MATLAB interface from sources and binariesâ-post in this forum. That was casting this as a
(c_int) 0.000000000000,
However, this then gave me an
invalid conversion from âc_int {aka long long int}â to âlinsys_solver_typeâ [-fpermissive]"
Going deeper, I found the
enum linsys_solver_type { QDLDL_SOLVER, MKL_PARDISO_SOLVER };
in âconstants.hâ that matches the OSQP documentation on Linear Systems Solvers. So I took that âQDLDL_SOLVERâ-constant and replaced â(c_int) 0.000000000000,â.
This seemed to fix the type issue, but now I get an
undefined reference to âsolve_linsys_qdldlâ
which I cannot find out anymore where it comes from.
Building the generated C Code and running the âexample.câ works like a charm, but I cannot get it run from a C++ project. Any idea what could fix the lin_sys_solver_type issue?
Best regards,
Andreas