[Numpy-discussion] help with f2py

Aronne Merrelli aronne.merrelli at gmail.com
Sun Dec 23 14:48:31 EST 2012


I'm trying to run f2py and running into some trouble. Starting from
http://www.scipy.org/Cookbook/F2Py, and the very simple 'Wrapping Hermite
Polynomial' example, I can get the pyf file created with no issues. The
system I am using is RedHat linux, and has several Fortran compilers:

$ f2py -c --help-fcompiler
Fortran compilers found:
  --fcompiler=g95      G95 Fortran Compiler (0.92)
  --fcompiler=gnu      GNU Fortran 77 compiler (3.4.6)
  --fcompiler=gnu95    GNU Fortran 95 compiler (4.1.2)
  --fcompiler=intelem  Intel Fortran Compiler for 64-bit apps (11.1)

All of these will successfully create the .so file except for g95, but when
I try to import into python I get this ImportError for any of the other
three compilers:

In [5]: import hermite
ImportError: ./hermite.so: undefined symbol: c06ebf_

If I look at the shared object I find that symbol here:

$ nm hermite.so
00000000000043c0 T array_from_pyobj
                 U c06eaf_
                 U c06ebf_

And that about hits my limit of compiler knowledge, as I am pretty much a
novice with these things. Any ideas on what is going wrong here, or
suggestions of things to try?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20121223/87fc7221/attachment.html>

More information about the NumPy-Discussion mailing list