[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Problem when embedding python

I'm porting YADE to Debian linux - bo.  After I get it working,
I hope to make it FHS compliant, and package it.

I've run into a problem with importing the python math module into an
embedded python interpreter.

When I import the math module into the embedded interpreter, it reports
an undefined symbol:  PyExc_OverflowError.

YADE embeds Python, and this error only comes from the embedded
interpreter. The command line version of Python can import the math
module with no problems.

I suspect the problem may be caused by improperly linking to the Python
libs.  Alternatively, it might be a bug in python_dev, I'm not sure at
this point.

Can anyone shed some light on this?

Here are my installed python and gcc packages:
ii  python-dev      1.4.0-4        Header files and development libraries for P
ii  python-doc      1.4.0-4        Documentation files for the scripting langua
ii  python-misc     1.4.0-4        Miscellaneous support modules for Python.
ii  python-mpz      1.4.0-4        Multiple-precision arithmetic suppport for P

ii  gcc         The GNU C compiler.

Here is the actual error message:
ImportError: /usr/lib/python/sharedmodules/mathmodule.so: undefined symbol: PyExc_OverflowError

Here is the link command for the yade executable:

g++ -o yade -Wall -L/usr/lib/python/config  -L/usr/X11R6/lib/ config.o main.o ui.o uiinterf.o DECommandLine.o DEUIMain.o DEDrawArea.o DEcanvas.o DEMainWindow.o DEeventdata.o DEMenuBar.o DEprimitive.o DEStatusBar.o  m_DEMainWindow.o m_DEDrawArea.o m_DEMenuBar.o m_DEStatusBar.o m_DECommandLine.o m_DEprimitive.o -lModules -lPython -lObjects -lParser -ldl -lreadline -lqt -lX11 -Wall -O -I/usr/include/python/ -I/usr/lib/python/config -I. -I/usr/include/qt/  -DPYTHON_LIB_PATH=\"/usr/lib/python/\" -DYADE_SYSTEM_LIB_PATH=\"/usr/local/lib/yade/\" 

And in /usr/lib/python/config:

bash-2.01$ nm -o *.a | grep Overflow
libObjects.a:floatobject.o:         U PyExc_OverflowError
libObjects.a:intobject.o:         U PyExc_OverflowError
libObjects.a:longobject.o:         U PyExc_OverflowError
libPython.a:bltinmodule.o:00000004 C PyExc_OverflowError
libPython.a:compile.o:         U PyExc_OverflowError

By the way, what does the 'C' mean?  It's not in the nm man page.
I was looking for a 'T'.


Lee Olds

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: