I have a python package "trees", which contains myscript.py file which makes use of a fortran subroutine.
Normally I compile the fortran module with
f2py -c -m calctree calctree.f90
and I can then do
from trees import myscript
myscript.mysub()
which makes use of calctree.so
If I package everything with distutils by running
python ./setup.py sdist
where the contents of setup.py are
#! /usr/bin/env python
from distutils.core import setup
setup(name='trees',
version='0.1',
packages=['trees']
)
and specify "include trees/calctree.f90" in a MANIFEST.in file, I can include the .f90 file, but I don't know how to make it compile with f2py on the user's computer, and have the .so file placed in an appropriate place. Can anybody help?
Thank you!