[Numpy-discussion] f2py, numpy.distutils and multiple Fortran source files

David Verelst david.verelst at gmail.com
Thu Dec 3 16:07:32 EST 2015


Hi,

For the wafo [1] package we are trying to include the extension compilation
process in setup.py [2] by using setuptools and numpy.distutils [3]. Some
of the extensions have one Fortran interface source file, but it depends on
several other Fortran sources (modules). The manual compilation process
would go as follows:

gfortran -fPIC -c source_01.f
gfortran -fPIC -c source_02.f
f2py -m module_name -c source_01.o source_02.o source_interface.f

Can this workflow be incorporated into setuptools/numpy.distutils?
Something along the lines as:

from numpy.distutils.core import setup, Extension
ext = Extension('module.name',
               depends=['source_01.f', 'source_02.f'],
               sources=['source_interface.f'])

(note that the above does not work)

[1] https://github.com/wafo-project/pywafo
[2] https://github.com/wafo-project/pywafo/blob/pipinstall/setup.py
[3] http://docs.scipy.org/doc/numpy/reference/distutils.html

Regards,
David
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20151203/f1c3fe6b/attachment.html>


More information about the NumPy-Discussion mailing list