Opened 23 months ago

Last modified 15 months ago

#70 new installation issue

Error for python interface

Reported by: hdminh Owned by: ferreau
Priority: normal Milestone:
Component: python interface Version: 3.2.1
Keywords: Cc:

Description

Hi,
I got the following error for python interface
(python 2.7.13, Ubuntu/Linux? 16.04, 64bits)
===================================================
python ../examples/example1.py
Traceback (most recent call last):

File "../examples/example1.py", line 27, in <module>

from qpoases import PyQProblem as QProblem

ImportError?: /home/minh/miniconda2/envs/newton/lib/python2.7/site-packages/qpoases.so: undefined symbol: _ZN7qpOASES9QProblemBC1EiNS_11HessianTypeENS_11BooleanTypeE
========================================================

Thanks, Minh


Change History (2)

comment:1 Changed 18 months ago by jonrkarr

I'm also having the same issue with qpOASES 3.2.1, Python 2.7.12 and 3.6.3, numpy 1.13.1, and Ubuntu 16.04.

I compiled using these commands:

cd /tmp
wget https://www.coin-or.org/download/source/qpOASES/qpOASES-3.2.1.tgz
tar -xvvf qpOASES-3.2.1.tgz
cd qpOASES-3.2.1
make
cd interfaces/python
python setup.py build_ext --inplace

Then I try to import qpoases:

python -c "import qpoases"

This produces this error on Python 2.7 (I also get a similar error with Python 3.6):

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: ./qpoases.so: undefined symbol: _ZN7qpOASES8QProblemC1EiiNS_11HessianTypeENS_11BooleanTypeE

Any help would be greatly appreciated!

comment:2 Changed 15 months ago by pmoran

The C++ library seems to be compiled with long, but the cython interface is just using int. I had a quick hack but couldn't get cython to use long as well. However, you can make C++ use int instead of long... I'm not sure what the deeper ramifications might be but it's working okay for me.

In make_linux.mk, search for CPPFLAGS and delete "-DUSE_LONG_INTEGERS"

Be sure to make clean and remove the compiled python build directory and cython .so before recompiling.

Note: See TracTickets for help on using tickets.