robotology / osqp-eigen

Simple Eigen-C++ wrapper for OSQP library
https://robotology.github.io/osqp-eigen/
BSD 3-Clause "New" or "Revised" License
381 stars 112 forks source link

Fix compatibility of OSQP 1 when using Windows #163

Closed traversaro closed 2 months ago

traversaro commented 2 months ago

Fix https://github.com/robotology/osqp-eigen/issues/146, this should reduce new issues being opened in the repo.

fyi @gergondet

traversaro commented 2 months ago

The macOS failure are due to https://github.com/robotology/osqp-eigen/issues/161, and not caused by this PR.

traversaro commented 2 months ago

Just to understand, how did you come up with this solution?

Based on https://github.com/osqp/osqp/issues/576 I understood that we had to stop using csc_spalloc and start using csc_set_data, however the two functions do not have the same functionality.

So I compare csc_spalloc and csc_set_data code:

So, I looked at the logic that was in csc_spalloc but missing in csc_set_data and I added it in OsqpEigen::spalloc. I also did something similar in csc_spfree and OsqpEigen::spfree.

DRETQ commented 1 month ago

@traversaro Hello, I am having problems writing MPC programs in VS2015 using eigen(v3.4.0),osqp(v0.6.3),osqp-eigen(v0.8,1), here is the error message: Severity Code Description Item File Line Error LNK2019 Unparsable external symbol _csc_spalloc, which is in function "bool __cdecl OsqpEigen::SparseMatrixHelper::createOsqpSparseMatrix<class Eigen:. SparseMatrix<double,0,int> >(class Eigen::SparseCompressedBase<class Eigen::SparseMatrix<double,0,int> > const &,struct csc * &)" (???) $createOsqpSparseMatrix@V?$SparseMatrix@N$0A@H@Eigen@@@SparseMatrixHelper@OsqpEigen@@YA_NABV?$SparseCompressedBase@V?$SparseMatrix @N$0A@H@Eigen@@Eigen@@AAPAUcsc@@@Z) is referenced in I‘m looking forward to your reply

traversaro commented 1 month ago

@traversaro Hello, I am having problems writing MPC programs in VS2015 using eigen(v3.4.0),osqp(v0.6.3),osqp-eigen(v0.8,1), here is the error message: Severity Code Description Item File Line Error LNK2019 Unparsable external symbol _csc_spalloc, which is in function "bool __cdecl OsqpEigen::SparseMatrixHelper::createOsqpSparseMatrix<class Eigen:. SparseMatrix<double,0,int> >(class Eigen::SparseCompressedBase<class Eigen::SparseMatrix<double,0,int> > const &,struct csc * &)" (???) $createOsqpSparseMatrix@V?$SparseMatrix@N$0A@H@Eigen@@@SparseMatrixHelper@OsqpEigen@@YA_NABV?$SparseCompressedBase@V?$SparseMatrix @n$0A@H@Eigen@@eigen@@AAPAUcsc@@@z) is referenced in I‘m looking forward to your reply

Can you open a separate issue for this? Having new problems in closed issues is not easy to deal with at all, thanks.

DRETQ commented 1 month ago

Yes,i open a separate issue. Problems writing MPC programs using eigen,osqp,osqp-eigen in VS2015 #169

traversaro commented 1 month ago

Yes,i open a separate issue. Problems writing MPC programs using eigen,osqp,osqp-eigen in VS2015 #169

Please avoid spamming in other discussions in that case then, especially if you were just waiting for an answer only for a few hours. In general people working on research software need to go through a lot of notifications, so if we are able to minimize unnecessary one that would be great, thanks!

DRETQ commented 1 month ago

@traversaro I apologize for this and will take care of it in the future. Can you answer my question?

traversaro commented 1 month ago

@traversaro I apologize for this and will take care of it in the future. Can you answer my question?

If the problem is the same in https://github.com/robotology/osqp-eigen/issues/169, @S-Dafarra is already helping you there, please avoid unnecessary mentions, as I already explained before, thanks!