[pypy-dev] cpyext - compilation, and swig?

Dan Stromberg drsalists at gmail.com
Fri May 13 21:27:34 CEST 2011


When I build a swig-generated C extension module against CPython 2.6, and
attempt to load it using cpyext, I get:

/usr/local/pypy-1.5/bin/pypy
>>>> cpyext.load_module('_odirectcmodule.so', 'odirect')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: unable to load extension module './_odirectcmodule.so':
./_odirectcmodule.so: undefined symbol: PyClass_Type
>>>>

1) Is that the right way to load a C extension module using cpyext?
2) Do I need to recompile the module for pypy?
3) Are there known issues with cpyext and swig?
4) Of swig, Cython, hand-coded C, and ctypes, which is the better bet today
for reliability with use from PyPy?

Thanks!

PS: This is, I believe, a module that really does need some C - it does
bitwise address arithmetic to get page alignment.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20110513/7a147aff/attachment.html>


More information about the pypy-dev mailing list