-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MATLAB not responding when running update()
#5
Comments
Thanks for the report. At a first glance it is something similar to the issue fixed by osqp/osqp-matlab#34 but for the lines related to update. |
I.e. we need to change mxFree to c_free in https://github.com/osqp/osqp-matlab/blob/7a9057c89dff9da9abeeb328d99e6bfda9adcefd/osqp_mex.cpp#L456 and in the subsequent lines. |
I will soon prepare a PR, but in the meanwhile this is the patch with the changes required for osqp-matlab. With this changes, I am able to run the testsuite (removing codegen that is intentionally not supported): diff --git a/osqp_mex.cpp b/osqp_mex.cpp
index 032877b..5506e1d 100755
--- a/osqp_mex.cpp
+++ b/osqp_mex.cpp
@@ -453,13 +453,13 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
}
// Free vectors
- if(!mxIsEmpty(q)) mxFree(q_vec);
- if(!mxIsEmpty(l)) mxFree(l_vec);
- if(!mxIsEmpty(u)) mxFree(u_vec);
- if(!mxIsEmpty(Px)) mxFree(Px_vec);
- if(!mxIsEmpty(Ax)) mxFree(Ax_vec);
- if(!mxIsEmpty(Px_idx)) mxFree(Px_idx_vec);
- if(!mxIsEmpty(Ax_idx)) mxFree(Ax_idx_vec);
+ if(!mxIsEmpty(q)) c_free(q_vec);
+ if(!mxIsEmpty(l)) c_free(l_vec);
+ if(!mxIsEmpty(u)) c_free(u_vec);
+ if(!mxIsEmpty(Px)) c_free(Px_vec);
+ if(!mxIsEmpty(Ax)) c_free(Ax_vec);
+ if(!mxIsEmpty(Px_idx)) c_free(Px_idx_vec);
+ if(!mxIsEmpty(Ax_idx)) c_free(Ax_idx_vec);
// Report errors (if any)
switch (exitflag) {
@@ -513,8 +513,8 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
osqp_warm_start(osqpData->work, x_vec, y_vec);
// Free vectors
- if(!mxIsEmpty(x)) mxFree(x_vec);
- if(!mxIsEmpty(y)) mxFree(y_vec);
+ if(!mxIsEmpty(x)) c_free(x_vec);
+ if(!mxIsEmpty(y)) c_free(y_vec);
return;
}
@@ -544,7 +544,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
osqp_warm_start_x(osqpData->work, x_vec);
// Free vectors
- if(!mxIsEmpty(x)) mxFree(x_vec);
+ if(!mxIsEmpty(x)) c_free(x_vec);
return;
}
@@ -574,7 +574,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
osqp_warm_start_y(osqpData->work, y_vec);
// Free vectors
- if(!mxIsEmpty(y)) mxFree(y_vec);
+ if(!mxIsEmpty(y)) c_free(y_vec);
return;
}
diff --git a/run_osqp_tests.m b/run_osqp_tests.m
index 29d9d18..9efd6f6 100644
--- a/run_osqp_tests.m
+++ b/run_osqp_tests.m
@@ -4,8 +4,8 @@ import matlab.unittest.TestSuite;
unittest_dir = fullfile(osqp_path, 'unittests');
suiteFolder = TestSuite.fromFolder(unittest_dir);
-% Solve individual test file
-%suiteFolder = TestSuite.fromFile('unittests/dual_infeasibility_tests.m');
+% Remove codegen tests
+newSuite = selectIf(suite,HasName(ContainsSubstring('pAtH','IgnoringCase',true)))
% Run all suite
result = run(suiteFolder); |
The upstream PR has been updated with additional fixes that solve this issue (see osqp/osqp-matlab@09faf01). |
Fixed by #6 . |
I have
osqp
installed viarobotology-superbuild
. When I tried to run theOSQP LASSO example
. MATLAB stops responding and I need to force-restart it.The line responsible for the issue is this
All the other lines work as expected. Even the
solve()
function.I tested the same example script with the official binary installation, and it works without issues.
The terminal throws this error
The text was updated successfully, but these errors were encountered: