[pypy-dev] Include .so modules generated with f2py from fortran script

Fabio D'Orta fabio88.dorta at gmail.com
Wed May 15 11:51:07 CEST 2013


Hi Armin,

Thank you for the explanation. Knowing nothing about C (difficult syntax to
understand) I will try the way to connect Fortran code.

Have a nice day,

Fabio


2013/5/14 Armin Rigo <arigo at tunes.org>

> Hi Fabio,
>
> On Tue, May 14, 2013 at 5:31 PM, Fabio D'Orta <fabio88.dorta at gmail.com>
> wrote:
> > thanks for your reply.
> > The problem with CFFI regards the "undefined symbol: PyMem_Free" when I
> use
> > ffi.dlopen.
>
> Ah, you're trying to import an .so that is a CPython C extension
> module.  That's not what CFFI is for.  With CFFI you can connect
> directly to C (and probably Fortran) code that is not specifically
> written for Python (i.e. doesn't contain "#include <Python.h>").
>
> You can call C code from Python with CFFI; this C code may be living
> in its own (Python-independent) .so file, or may just be more sources
> that will be compiled along during the call to ffi.verify() if you use
> "sources=[...]".  Look up http://cffi.readthedocs.org for more
> information.
>
>
> A bientôt,
>
> Armin.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20130515/043323cb/attachment.html>


More information about the pypy-dev mailing list