<div dir="ltr"><div><div>Hi Armin,<br><br></div>Thank you for the explanation. Knowing nothing about C (difficult syntax to understand) I will try the way to connect Fortran code.<br><br></div>Have a nice day,<br><br>Fabio<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/14 Armin Rigo <span dir="ltr"><<a href="mailto:arigo@tunes.org" target="_blank">arigo@tunes.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Fabio,<br>
<div class="im"><br>
On Tue, May 14, 2013 at 5:31 PM, Fabio D'Orta <<a href="mailto:fabio88.dorta@gmail.com">fabio88.dorta@gmail.com</a>> wrote:<br>
> thanks for your reply.<br>
> The problem with CFFI regards the "undefined symbol: PyMem_Free" when I use<br>
> ffi.dlopen.<br>
<br>
</div>Ah, you're trying to import an .so that is a CPython C extension<br>
module.  That's not what CFFI is for.  With CFFI you can connect<br>
directly to C (and probably Fortran) code that is not specifically<br>
written for Python (i.e. doesn't contain "#include <Python.h>").<br>
<br>
You can call C code from Python with CFFI; this C code may be living<br>
in its own (Python-independent) .so file, or may just be more sources<br>
that will be compiled along during the call to ffi.verify() if you use<br>
"sources=[...]".  Look up <a href="http://cffi.readthedocs.org" target="_blank">http://cffi.readthedocs.org</a> for more<br>
information.<br>
<br>
<br>
A bientôt,<br>
<br>
Armin.<br>
</blockquote></div><br></div>