Hi Daniel,
I'm trying to run your example for Python and I'm getting segfault on the call to the solver. I followed your installation steps on two different machines running Ubuntu 20.04, and the result was the same. In particular, on my personal machine, I tried to install to a ~/.local prefix, to ensure that there were no issues with permissions accessing the library. This is my result:
➜ ~ ipython3
Python 3.8.10 (default, Jun 22 2022, 20:18:18)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import daqp
...: import numpy as np
...: from ctypes import *
...: import ctypes.util
...:
...: # Define the problem
...: H = np.array([[1, 0], [0, 1]],dtype=c_double)
...: f = np.array([1, 1],dtype=c_double)
...: A = np.array([[1, 1], [1, -1]],dtype=c_double)
...: bupper = np.array([1,2,3,4],dtype=c_double)
...: blower = np.array([-1,-2,-3,-4],dtype=c_double)
...: sense = np.array([0,0,0,0],dtype=c_int)
In [2]: d = daqp.daqp()
...: (xstar,fval,exitflag,info) = d.quadprog(H,f,A,bupper,blower,sense)
id cand: []
double free or corruption (out)
[1] 38052 abort (core dumped) ipython3
And on pure python3 shell:
➜ ~ python3
Python 3.8.10 (default, Jun 22 2022, 20:18:18)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> # Import relevant modules
>>> import daqp
>>> import numpy as np
>>> from ctypes import *
>>> import ctypes.util
>>>
>>> # Define the problem
>>> H = np.array([[1, 0], [0, 1]],dtype=c_double)
>>> f = np.array([1, 1],dtype=c_double)
>>> A = np.array([[1, 1], [1, -1]],dtype=c_double)
>>> bupper = np.array([1,2,3,4],dtype=c_double)
>>> blower = np.array([-1,-2,-3,-4],dtype=c_double)
>>> sense = np.array([0,0,0,0],dtype=c_int)
>>> d = daqp.daqp()
>>> (xstar,fval,exitflag,info) = d.quadprog(H,f,A,bupper,blower,sense)
id cand: []
free(): invalid next size (fast)
[1] 38371 abort (core dumped) python3
Can you double check this on your side on a clean Ubuntu install or a CI system? Let me know if I can provide anything to help with this :)
Pedro,