Closed YongcanZhou closed 2 months ago
Thanks for reporting the problem! The code for compatibility with osqp v1 (i.e. osqp master) is quite new (it was added in https://github.com/robotology/osqp-eigen/pull/145), hopefully we are able to solve this problem before the osqp v1 first official release. In the meantime, a workaround is either to use osqp v0.6.3 or (but this is just a guess) compile osqp and osqp-eigen as static libraries.
fyi @gergondet
Note that a possible solution is just to include a local copy of the csc_spalloc function (this would help also for https://github.com/robotology/osqp-eigen/issues/142, fyi @Levi-Armstrong).
Probably it is als a good idea to ask upstream how an OSQP sparse matrix is supposed to be created, if csc_spalloc is now private. From https://github.com/osqp/osqp/blob/1ac3fab74ddeebb0a24b8b7f96e1e539423d4a6a/docs/examples/update-vectors.rst#L198, it seems that the idea is to use the csc_set_data
function.
Thanks for reporting the problem! The code for compatibility with osqp v1 (i.e. osqp master) is quite new (it was added in #145), hopefully we are able to solve this problem before the osqp v1 first official release. In the meantime, a workaround is either to use osqp v0.6.3 or (but this is just a guess) compile osqp and osqp-eigen as static libraries.
Thank you very much for your response! I followed your instructions to use osqp v0.6.3. However, unfortunately, I encountered the same issue as you did before when installing v0.6.3. I'm not sure how to resolve this problem.
Failed with: ninja: error: build.ninja:320: multiple rules generate out/osqp.lib
If you could help me with this question, I would be extremely grateful.
Thanks for reporting the problem! The code for compatibility with osqp v1 (i.e. osqp master) is quite new (it was added in #145), hopefully we are able to solve this problem before the osqp v1 first official release. In the meantime, a workaround is either to use osqp v0.6.3 or (but this is just a guess) compile osqp and osqp-eigen as static libraries.
Thank you very much for your response! I followed your instructions to use osqp v0.6.3. However, unfortunately, I encountered the same issue as you did before when installing v0.6.3. I'm not sure how to resolve this problem.
Failed with: ninja: error: build.ninja:320: multiple rules generate out/osqp.lib
If you could help me with this question, I would be extremely grateful.
See https://github.com/osqp/osqp/issues/309 for a related issue. A simple workaround is to use another CMake generator, like NMake Makefiles or Visual Studio 16 2019/Visual Studio 17 2022
Sorry about that. I went with the simplest solution I could think of at the time and since the symbol is available on Linux even when the API is hidden but that's definitely not a clean solution and it breaks on Windows since the symbol is not available.
it seems that the idea is to use the csc_set_data function.
I think this leaves you responsible for allocating the p
/i
/x
data so probably something like csc_spalloc
is still needed inside osqp-eigen, if that's ok license-wise maybe just copying and renaming (to avoid symbol collisions) the internal function is ok?
Sorry about that.
No problem!
if that's ok license-wise maybe just copying and renaming (to avoid symbol collisions) the internal function is ok?
I did not tought of the license, indeed having just a chunk of Apache-2.0 code in a BSD license is not ideal, even if doable. Let's open an issue upstream to discuss this with osqp mantainers.
I renamed this issue to clarify what is tracking.
install with osqp(master) and osqp-eigen(master) but when "make" step, we meet this error
It seems the problem is here three lines of code https://github.com/robotology/osqp-eigen/blob/a752c5e6353cae6176578488a1fa641d3b9cf0b9/include/OsqpEigen/Compat.hpp#L21C1-L21C1
csc_spalloc and csc_spfree with error LNK2019: unresolved external symbol