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

Cannot build osqp-eigen from source #136

Closed jkaob closed 1 year ago

jkaob commented 1 year ago

Hello, The CI pipeline suddenly failed, as Cmake cannot locate the OsqpEigen installation for our project.

In particular, when installing OsqpEigen, running make leads to errors such as:

../osqp-eigen/include/OsqpEigen/SparseMatrixHelper.hpp:42:37: error: ‘csc’ has not been declared
  42 |                                     csc*& osqpSparseMatrix);
....
../osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:18:5: error: ‘c_int’ was not declared in this scope; did you mean ‘u_int’?
...
 In member function ‘void OsqpEigen::Data::setNumberOfVariables(int)’:
.../osqp-eigen/src/Data.cpp:74:5: error: ‘m_data’ was not declared in this scope; did you mean ‘Data’?
  74 |     m_data->n = n;

and so on. I thought it might have anything to do with newer releases Eigen or Osqp, but i cannot seem to find any issues with them. I have also tried with earlier tags that used to be compatible. Osqp is installed in /usr/local/share/osqp/.

I have tried changing cmake -DCMAKE_INSTALL_PREFIX:PATH=<custom-folder> ../ to different locations, but to no avail. I have been using docker, with newest stable versions of Eigen and Osqp. Is this a known problem, or am I doing something completely wrong? I dont understand why this suddenly happened, as we have been successfully passing build tests for many months before. Thank you for any help!

traversaro commented 1 year ago

Hello @jkaob, see https://github.com/robotology/osqp-eigen/issues/135 .

TL;DR: Now osqp default branch points to the unreleased 1.0.0 version, while osqp-eigen default branch is only compatible with osqp <= 0.6.3 at the moment. In general, if you want to avoid these kind of problems you may want to use tagged verson of dependencies, instead of relying on the latest version of default branches to be compatible.

jkaob commented 1 year ago

Thank you for the response, i apologize for not checking the closed issues. I did check the version of the master branch of osqp, but i misread it and thought it was still 0.6.3. It now works, like it used to. Also thanks for the tip!