[Numpy-discussion] f2py problem with multiple fortran source files
pearu.peterson at gmail.com
Sat Jun 13 13:25:00 EDT 2015
On Fri, Jun 12, 2015 at 7:23 PM, 石头 <dasssj at 126.com> wrote:
> I'm new to f2py, and I got some trouble when wrapped some fortran files
> to Python.
> I have download a Fortran library (
> https://github.com/brianlockwood/ForK), I want to compile these files
> into a library and call the library by other Fortran file wrote by myself.
> Here are my questions:
> 1. How should I compile the library(in this case,Fork), and what command
> should I use;
In ForK, try
that should result kriginglib.a. You might need to add -fPIC option to
FFLAGS in Makefile before executing make.
> 2. How can I use the library and my own Fortran source fileI( All.f90 )
> with the f2py command to generate the module I can use py Python
f2py -c -m mylib All.f90 /path/to/kriginglib.a
>>> import mylib
>>> print mylib.__doc__
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion