robotology / osqp-eigen

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

make error: "recipe for target 'CMakeFiles/OsqpEigen.dir/src/Solver.cpp.o' failed", osqp-eigen:v0.6.3, osqp:v0.6.2 #90

Closed xinchu911 closed 3 years ago

xinchu911 commented 3 years ago

Scanning dependencies of target OsqpEigen [ 40%] Building CXX object CMakeFiles/OsqpEigen.dir/src/Data.cpp.o [ 40%] Building CXX object CMakeFiles/OsqpEigen.dir/src/Settings.cpp.o [ 60%] Building CXX object CMakeFiles/OsqpEigen.dir/src/Solver.cpp.o [ 80%] Building CXX object CMakeFiles/OsqpEigen.dir/src/Debug.cpp.o In file included from /home/rgs/Downloads/osqp_e/osqp-eigen/src/Settings.cpp:8:0: /home/rgs/Downloads/osqp_e/osqp-eigen/include/OsqpEigen/Settings.hpp:92:105: warning: ‘deprecated’ attribute directive ignored [-Wattributes] [[deprecated("Use setMaxIteration(int) instead.")]] void setMaxIteraction(const int maxIteration); ^ In file included from /home/rgs/Downloads/osqp_e/osqp-eigen/src/Solver.cpp:10:0: /home/rgs/Downloads/osqp_e/osqp-eigen/include/OsqpEigen/Settings.hpp:92:105: warning: ‘deprecated’ attribute directive ignored [-Wattributes] [[deprecated("Use setMaxIteration(int) instead.")]] void setMaxIteraction(const int maxIteration); ^ /home/rgs/Downloads/osqp_e/osqp-eigen/src/Solver.cpp: In constructor ‘OsqpEigen::Solver::Solver()’: /home/rgs/Downloads/osqp_e/osqp-eigen/src/Solver.cpp:24:18: error: ‘make_unique’ is not a member of ‘std’ m_settings = std::make_unique(); ^ /home/rgs/Downloads/osqp_e/osqp-eigen/src/Solver.cpp:24:54: error: expected primary-expression before ‘>’ token m_settings = std::make_unique(); ^ /home/rgs/Downloads/osqp_e/osqp-eigen/src/Solver.cpp:24:56: error: expected primary-expression before ‘)’ token m_settings = std::make_unique(); ^ /home/rgs/Downloads/osqp_e/osqp-eigen/src/Solver.cpp:25:14: error: ‘make_unique’ is not a member of ‘std’ m_data = std::make_unique(); ^ /home/rgs/Downloads/osqp_e/osqp-eigen/src/Solver.cpp:25:46: error: expected primary-expression before ‘>’ token m_data = std::make_unique(); ^ /home/rgs/Downloads/osqp_e/osqp-eigen/src/Solver.cpp:25:48: error: expected primary-expression before ‘)’ token m_data = std::make_unique(); ^ CMakeFiles/OsqpEigen.dir/build.make:88: recipe for target 'CMakeFiles/OsqpEigen.dir/src/Solver.cpp.o' failed make[2]: [CMakeFiles/OsqpEigen.dir/src/Solver.cpp.o] Error 1 CMakeFiles/Makefile2:105: recipe for target 'CMakeFiles/OsqpEigen.dir/all' failed make[1]: [CMakeFiles/OsqpEigen.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

I built this project on Ubuntu 16.04, gcc:4.8.5, cmake version 3.15.0-rc2, while osqp version is v0.6.2(latest for the moment). Really appreciate your help.

S-Dafarra commented 3 years ago

Hi @xinchu911, thanks for opening the issue. The error is

/home/rgs/Downloads/osqp_e/osqp-eigen/src/Solver.cpp:24:18: error: ‘make_unique’ is not a member of ‘std’

In fact, make_unique has been implemented on gcc starting from the 4.9 version: https://gcc.gnu.org/gcc-4.9/changes.html

You can try to install gcc-5 to check if that fixes the issue (provided that you are ok in updating your gcc version).

xinchu911 commented 3 years ago

After I switched to gcc-5, make process succeeded. Thanks a lot, particularlly for quick response.

DRETQ commented 6 months ago

Hi, I'm at the step of installing osqp-eigen and got an error at mingw32-make saying cmakefiles\osqpeigen.dir\build.make:150:recipe for target 'bin/libosqpeigen.dll' failed, why is this?

traversaro commented 6 months ago

Hi, I'm at the step of installing osqp-eigen and got an error at mingw32-make saying cmakefiles\osqpeigen.dir\build.make:150:recipe for target 'bin/libosqpeigen.dll' failed, why is this?

@DRETQ can you open a separate issue for this? Thanks!

DRETQ commented 6 months ago

@traversaro I have opened a separate issue for this, you can see for the new issue, thanks!

traversaro commented 6 months ago

@traversaro I have opened a separate issue for this, you can see for the new issue, thanks!

xref: https://github.com/robotology/osqp-eigen/issues/162 (if you just link the new issue is easier for people to reach it : ) )