Closed svigerske closed 4 years ago
Comment by ferreau created at 2014-12-17 09:51:32
Neither the static nor the dynamic qpOASES
library include code of the BLAS/LAPACK routines. Thus, just linking qpOASES
will lead to undefined references as above. If you do not use BLAS/LAPACK, you need to explicitly link the BLASReplacement.cpp
/LAPACKReplacement.cpp
files that come along with the qpOASES release. So, calling
g++ -static example1.cpp ../src/BLASReplacement.cpp ../src/LAPACKReplacement.cpp -I../include/ -o statically_linked -L../bin/ -lqpOASES
should do the trick.
Comment by ferreau created at 2014-12-17 09:51:53
Resolution: fixed
Issue created by migration from Trac.
Original creator: grimmehesten
Original creation time: 2014-12-16 13:17:28
Assignee: ferreau
Version: 3.0.0
I am unable to link to the static library in the bin/ folder. Reproduce the error: In the examples/ folder when I run the command: 'g++ -static example1.cpp -I ../include/ -o staticallylinked -L ../bin/ -l qpOASES' I get the following error: ../bin//libqpOASES.a(QProblem.o): In function
qpOASES::QProblem::computeProjectedCholesky()': QProblem.cpp:(.text+0x1cf8): undefined reference to
dpotrf' ../bin//libqpOASES.a(QProblemB.o): In functionqpOASES::QProblemB::computeCholesky()': QProblemB.cpp:(.text+0x1e2d): undefined reference to
dpotrf' ../bin//libqpOASES.a(Matrices.o): In functionqpOASES::DenseMatrix::transTimes(int, double, double const*, int, double, double*, int) const': Matrices.cpp:(.text+0x8989): undefined reference to
dgemm' ../bin//libqpOASES.a(Matrices.o): In functionqpOASES::DenseMatrix::times(int, double, double const*, int, double, double*, int) const': Matrices.cpp:(.text+0x8a7d): undefined reference to
dgemm_' collect2: ld returned 1 exit statusI have not installed BLAS or LAPACK.