Comments (8)
Indeed, the reason is exactly this one:
/home/ugv/software/osqp-eigen-master/src/Solver.cpp:19:18: error: ‘make_unique’ is not a member of ‘std’
The make_unique
has been implemented in gcc starting from version 4.9.0: https://isocpp.org/blog/2014/04/gcc-4.9.0. I am afraid your compiler is not supported.
By commenting out the lines https://github.com/robotology/osqp-eigen/blob/master/src/Solver.cpp#L23-L24 you are not allocating the Settings
and Data
object, causing the segfault.
from osqp-eigen.
Thanks for your help. After I update the gcc and g++ version to be 4.9.4. Now it woks. I appreciate your kind help.
from osqp-eigen.
Hi @NUDTUGVexplorer,
can you give us some more information about your system? For example:
- OS you are currently using
osqp-eigen
versionosqp
version- Did you change some of the default
cmake
configurations?
from osqp-eigen.
1.OS: ubuntu 14.04 LTS gcc version 4.8.4
2.osqp-eigen: I just git from your repo on March 1st, 2020.
3.osqp: OSQP v0.5.0 - Operator Splitting QP Solver
4. I didn't change the cmake configurations.
But when I compile osqp-eigen, there is an issue as follows:
/osqp-eigen-master/build$ make
Scanning dependencies of target OsqpEigen
[ 25%] Building CXX object CMakeFiles/OsqpEigen.dir/src/Data.cpp.o
[ 50%] Building CXX object CMakeFiles/OsqpEigen.dir/src/Settings.cpp.o
[ 75%] Building CXX object CMakeFiles/OsqpEigen.dir/src/Solver.cpp.o
/home/ugv/software/osqp-eigen-master/src/Solver.cpp: In constructor ‘OsqpEigen::Solver::Solver()’:
/home/ugv/software/osqp-eigen-master/src/Solver.cpp:19:18: error: ‘make_unique’ is not a member of ‘std’
m_settings = std::make_uniqueOsqpEigen::Settings();
^
/home/ugv/software/osqp-eigen-master/src/Solver.cpp:19:54: error: expected primary-expression before ‘>’ token
m_settings = std::make_uniqueOsqpEigen::Settings();
^
/home/ugv/software/osqp-eigen-master/src/Solver.cpp:19:56: error: expected primary-expression before ‘)’ token
m_settings = std::make_uniqueOsqpEigen::Settings();
^
/home/ugv/software/osqp-eigen-master/src/Solver.cpp:20:14: error: ‘make_unique’ is not a member of ‘std’
m_data = std::make_uniqueOsqpEigen::Data();
^
/home/ugv/software/osqp-eigen-master/src/Solver.cpp:20:46: error: expected primary-expression before ‘>’ token
m_data = std::make_uniqueOsqpEigen::Data();
^
/home/ugv/software/osqp-eigen-master/src/Solver.cpp:20:48: error: expected primary-expression before ‘)’ token
m_data = std::make_uniqueOsqpEigen::Data();
^
make[2]: *** [CMakeFiles/OsqpEigen.dir/src/Solver.cpp.o] Error 1
make[1]: *** [CMakeFiles/OsqpEigen.dir/all] Error 2
make: *** [all] Error 2
In order to fix the issue, I found some advise from the others.
So I change the code in Solver.cpp,
//m_settings = std::unique_ptrOsqpEigen::Settings();
//m_data = std::unique_ptrOsqpEigen::Data();
m_settings = std::make_unique<OsqpEigen::Settings>();
m_data = std::make_unique<OsqpEigen::Data>();
Then it could be successfully compiled now.
/osqp-eigen-master/build$ make
Scanning dependencies of target OsqpEigen
[ 25%] Building CXX object CMakeFiles/OsqpEigen.dir/src/Solver.cpp.o
[ 50%] Linking CXX shared library lib/libOsqpEigen.so
[100%] Built target OsqpEigen
Thanks!
from osqp-eigen.
make test, the results are as follows:
Running tests...
Test project /home/lxh/software/osqp-eigen-master/build
Start 1: SparseMatrixTest
1/5 Test #1: SparseMatrixTest ................. Passed 0.01 sec
Start 2: QPTest
2/5 Test #2: QPTest ...........................***Exception: SegFault 0.12 sec
Start 3: UpdateMatricesTest
3/5 Test #3: UpdateMatricesTest ...............***Exception: SegFault 0.10 sec
Start 4: MPCTest
4/5 Test #4: MPCTest ..........................***Exception: SegFault 0.10 sec
Start 5: MPCUpdateMatricesTest
5/5 Test #5: MPCUpdateMatricesTest ............***Exception: SegFault 0.10 sec
20% tests passed, 4 tests failed out of 5
Total Test time (real) = 0.42 sec
The following tests FAILED:
2 - QPTest (SEGFAULT)
3 - UpdateMatricesTest (SEGFAULT)
4 - MPCTest (SEGFAULT)
5 - MPCUpdateMatricesTest (SEGFAULT)
Errors while running CTest
from osqp-eigen.
@S-Dafarra I am facing the same issue Segmentation fault (core dumped)
. I am using Ubuntu 18 with g++
and gcc
version 7.5.0
. I am compiled osqp
from source as described here.
The following lines execute with no errors:
//solver.settings()->setVerbosity(false);
qpSolver_.settings()->setWarmStart(true);
// set the initial data of the QP solver
qpSolver_.data()->setNumberOfVariables((num_of_states_+num_of_inputs_)*mpcWindow);
qpSolver_.data()->setNumberOfConstraints((2*num_of_states_+num_of_inputs_)*mpcWindow);
Eigen::SparseMatrix<double> hessian = hessian_.sparseView();
Eigen::SparseMatrix<double> Ac = Ac_.sparseView();
if(!qpSolver_.data()->setHessianMatrix(hessian)) return false;
if(!qpSolver_.data()->setGradient(gradient_)) return false;
if(!qpSolver_.data()->setLinearConstraintsMatrix(Ac)) return false;
if(!qpSolver_.data()->setLowerBound(lowerBounds_)) return false;
if(!qpSolver_.data()->setUpperBound(upperBounds_)) return false;
However, I get the segmentation fault error when the following is executed
qpSolver_.updateBounds(lowerBounds_, upperBounds_);
I made sure that dimensions of the matrices are correct.
What could be the issue?
Thanks in advance.
from osqp-eigen.
Can the OsqpEigen::Solver obj;
be a class member? It seems to ave an issue when I use it inside a class as a class member.
from osqp-eigen.
Problem is solved. It was a silly mistake that I didn't initSolver()
!
from osqp-eigen.
Related Issues (20)
- ERROR in LDL_factor: Error in KKT matrix LDL factorization when computing the nonzero elements. The problem seems to be non-convex HOT 2
- problems compiling this library HOT 4
- Assert statement in SparseMatrixHelper.tpp HOT 2
- The createOsqpSparseMatrix does not correctly handle empty sparse matrix. HOT 5
- Compile error on Windows with vs2022 and vs2019 when compiling against osqp master branch (future osqp v1) HOT 8
- The possibility to handle huge matrix equation? HOT 4
- Using OSQP-Eigen with OSQP CUDA HOT 2
- have a solution for osqp 0.4.0? HOT 6
- error while loading shared libraries: libosqp.so HOT 3
- undefined reference to `OsqpEigen::Solver::Solver()',undefined reference to `OsqpEigen::Solver::settings() const' HOT 1
- I'm using osqp-eigen v0.7.0, wondering if Hessian Matrix is supporting only symmetric matrix, rather than upper triangular matrix. HOT 2
- Support for solution derivative functions HOT 1
- ..... HOT 1
- trouble building the library HOT 4
- different result in c++ and matlab HOT 3
- Get Unstable Answer When Solve a simple QP using Update Matrix Functions HOT 10
- When calling the setHessianMatrix and updateHessianMatrix functions, the compilation error HOT 4
- auxil.h no such file or directory HOT 4
- macos-latest CI float=ON failing since April 23
- Problems installing osqp-eigen HOT 29
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osqp-eigen.