setup now correctly compiles the extensions and the fortran objects/modules it depends upon

master
davidovitch 9 years ago
parent ea595ac631
commit 05b46497c4

@ -13,55 +13,71 @@ from __future__ import division, absolute_import, print_function
# numpy.distutils will figure out if setuptools is available when imported # numpy.distutils will figure out if setuptools is available when imported
# this allows us to combine setuptools use_pyscaffold=True and f2py extensions # this allows us to combine setuptools use_pyscaffold=True and f2py extensions
import setuptools import setuptools
from numpy.distutils.core import setup, Extension from numpy.distutils.core import setup
from numpy.distutils.misc_util import Configuration
import sys import sys
def setup_package_pyscaffold(): def setup_package_pyscaffold():
extensions = [] config = Configuration('wafo')
c_lib_ext = Extension('wafo.c_library', # -------------------------------------------------------------------------
# c_library
config.add_extension('c_library',
sources=['wafo/source/c_library/c_library.pyf', sources=['wafo/source/c_library/c_library.pyf',
'wafo/source/c_library/c_functions.c']) 'wafo/source/c_library/c_functions.c'])
extensions.append(c_lib_ext) # -------------------------------------------------------------------------
# mvn
mvn_ext = Extension('wafo.mvn', config.add_extension('mvn',
sources=['wafo/source/mvn/mvn.pyf', sources=['wafo/source/mvn/mvn.pyf',
'wafo/source/mvn/mvndst.f']) 'wafo/source/mvn/mvndst.f'])
extensions.append(mvn_ext)
mvnprd_ext = Extension('wafo.mvnprdmod', # -------------------------------------------------------------------------
sources=['wafo/source/mvnprd/mvnprd.f', # mvnprdmod
'wafo/source/mvnprd/mvnprodcorrprb.f', lib_mvnprdmod_src = ['wafo/source/mvnprd/mvnprd.f',
'wafo/source/mvnprd/mvnprd_interface.f']) 'wafo/source/mvnprd/mvnprodcorrprb.f']
extensions.append(mvnprd_ext) config.add_library('lib_mvnprdmod', sources=lib_mvnprdmod_src)
config.add_extension('mvnprdmod',
sources=['wafo/source/mreg/cov2mmpdfreg_intfc.f'],
libraries=['lib_mvnprdmod'],
depends=(lib_mvnprdmod_src))
mreg_ext = Extension('wafo.cov2mod', # -------------------------------------------------------------------------
extra_objects=['wafo/source/mreg/dsvdc.f', # cov2mod
lib_cov2mod_src = ['wafo/source/mreg/dsvdc.f',
'wafo/source/mreg/mregmodule.f', 'wafo/source/mreg/mregmodule.f',
'wafo/source/mreg/intfcmod.f'], 'wafo/source/mreg/intfcmod.f']
sources=['wafo/source/mreg/cov2mmpdfreg_intfc.f']) config.add_library('lib_cov2mod', sources=lib_cov2mod_src)
extensions.append(mreg_ext) config.add_extension('cov2mod',
sources=['wafo/source/mreg/cov2mmpdfreg_intfc.f'],
libraries=['lib_cov2mod'],
include_dirs=['wafo/source/mreg/'],
depends=(lib_cov2mod_src))
rind_ext = Extension('wafo.rindmod', # -------------------------------------------------------------------------
extra_objects=['wafo/source/rind2007/intmodule.f', # rindmod
lib_rindmod_src = ['wafo/source/rind2007/intmodule.f',
'wafo/source/rind2007/jacobmod.f', 'wafo/source/rind2007/jacobmod.f',
'wafo/source/rind2007/swapmod.f', 'wafo/source/rind2007/swapmod.f',
'wafo/source/rind2007/fimod.f', 'wafo/source/rind2007/fimod.f',
'wafo/source/rind2007/rindmod.f', 'wafo/source/rind2007/rindmod.f',
'wafo/source/rind2007/rind71mod.f'], 'wafo/source/rind2007/rind71mod.f']
sources=['wafo/source/rind2007/rind_interface.f']) config.add_library('lib_rindmod', sources=lib_rindmod_src)
extensions.append(rind_ext) config.add_extension('rindmod',
sources=['wafo/source/rind2007/rind_interface.f'],
libraries=['lib_rindmod'],
include_dirs=['wafo/source/mreg/'],
depends=(lib_rindmod_src))
needs_sphinx = {'build_sphinx', 'upload_docs'}.intersection(sys.argv) needs_sphinx = {'build_sphinx', 'upload_docs'}.intersection(sys.argv)
sphinx = ['sphinx'] if needs_sphinx else [] sphinx = ['sphinx'] if needs_sphinx else []
setup(setup_requires=['six', 'pyscaffold>=2.4rc1,<2.5a0'] + sphinx, setup(setup_requires=['six', 'pyscaffold>=2.4rc1,<2.5a0'] + sphinx,
tests_require=['pytest_cov', 'pytest'], tests_require=['pytest_cov', 'pytest'],
use_pyscaffold=True, use_pyscaffold=True,
ext_modules=extensions) **config.todict())
if __name__ == "__main__": if __name__ == "__main__":
setup_package_pyscaffold() setup_package_pyscaffold()

Loading…
Cancel
Save