def _extension_modules(): # NOTE: This assumes is_installed('numpy') has already passed. # H/T to https://stackoverflow.com/a/41575848/1068170 from numpy.distutils import core bezier_path = os.path.join(PACKAGE_ROOT, 'src', 'bezier') extension = core.Extension( name='bezier._speedup', sources=[ os.path.join(bezier_path, '_speedup.pyf'), os.path.join(bezier_path, 'speedup.f90'), ], language='f90', ) if 'config_fc' not in sys.argv: sys.argv.extend(['config_fc', '--opt=-O3']) return [extension]
'mahotas._histogram': ['mahotas/_histogram.cpp'], 'mahotas._interpolate': ['mahotas/_interpolate.cpp', 'mahotas/_filters.cpp'], 'mahotas._labeled': ['mahotas/_labeled.cpp', 'mahotas/_filters.cpp'], 'mahotas._morph': ['mahotas/_morph.cpp', 'mahotas/_filters.cpp'], 'mahotas._thin': ['mahotas/_thin.cpp'], 'mahotas.features._lbp': ['mahotas/features/_lbp.cpp'], 'mahotas.features._surf': ['mahotas/features/_surf.cpp'], 'mahotas.features._texture': ['mahotas/features/_texture.cpp', 'mahotas/_filters.cpp'], 'mahotas.features._zernike': ['mahotas/features/_zernike.cpp'], } ext_modules = [ numpyutils.Extension(key, sources=sources, undef_macros=undef_macros, define_macros=define_macros) for key, sources in extensions.items() ] packages = setuptools.find_packages() package_dir = { 'mahotas.tests': 'mahotas/tests', 'mahotas.demos': 'mahotas/demos', } package_data = { 'mahotas.tests': ['data/*'], 'mahotas.demos': ['data/*'], }
compiler = numpy.distutils.ccompiler.get_default_compiler() for arg in sys.argv: if arg.startswith('--compiler'): compiler = arg.split('=')[1] if compiler in ['unix', 'mingw32', 'cygwin']: extra_compile_args = [] # RNG: This seems to cause problems on some machines. To test for # compatibility with VC++, uncomment this line. #extra_compile_args = ['-std="iso9899:1990"', '-pedantic-errors'] else: extra_compile_args = [] # Configure our C modules that are built with f2py. tridiag = core.Extension(name='dadi.tridiag', sources=['dadi/tridiag.pyf', 'dadi/tridiag.c'], extra_compile_args=extra_compile_args) int_c = core.Extension(name='dadi.integration_c', sources=[ 'dadi/integration_c.pyf', 'dadi/integration1D.c', 'dadi/integration2D.c', 'dadi/integration3D.c', 'dadi/integration_shared.c', 'dadi/tridiag.c' ], extra_compile_args=extra_compile_args) if '--cython' in sys.argv: # Remove extra argument, so distutils doesn't complain sys.argv.remove('--cython') # Configure our C modules that are built with Cython. # This needs to be done in a separate setup step from the remainder of dadi,
'mahotas._convolve': ['mahotas/_convolve.cpp', 'mahotas/_filters.cpp'], 'mahotas._distance': ['mahotas/_distance.cpp'], 'mahotas._histogram': ['mahotas/_histogram.cpp'], 'mahotas._interpolate': ['mahotas/_interpolate.cpp', 'mahotas/_filters.cpp'], 'mahotas._labeled': ['mahotas/_labeled.cpp', 'mahotas/_filters.cpp'], 'mahotas._morph': ['mahotas/_morph.cpp', 'mahotas/_filters.cpp'], 'mahotas._segmentation': ['mahotas/_segmentation.cpp'], 'mahotas._thin': ['mahotas/_thin.cpp'], 'mahotas.features._lbp': ['mahotas/features/_lbp.cpp'], 'mahotas.features._surf': ['mahotas/features/_surf.cpp'], 'mahotas.features._texture': ['mahotas/features/_texture.cpp', 'mahotas/_filters.cpp'], 'mahotas.features._zernike': ['mahotas/features/_zernike.cpp'], } ext_modules = [numpyutils.Extension(key, sources=sources, undef_macros=undef_macros, define_macros=define_macros) for key,sources in extensions.items()] packages = setuptools.find_packages() package_dir = { 'mahotas.tests': 'mahotas/tests', 'mahotas.demos': 'mahotas/demos', } package_data = { 'mahotas.tests': ['data/*'], 'mahotas.demos': ['data/*'], } classifiers = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers',
import setuptools import numpy.distutils.core as core daskr = core.Extension(name='SloppyCell._daskr', sources=[ 'SloppyCell/daskr.pyf', 'ddaskr/ddaskr.c', 'ddaskr/daux.c', 'ddaskr/dlinpk.c', 'ddaskr/ddaskr_types.h' ]) misc_c = core.Extension( name='SloppyCell.misc_c', sources=['SloppyCell/misc_c.c', 'SloppyCell/misc_c.pyf']) # Collect files needed for dynamic compilation rxn_data_files = [ 'SloppyCell/ReactionNetworks/{0}'.format(_) for _ in [ 'mtrand.c', 'mtrand.h', 'f2py_signatures.pyf', 'f2py_signatures_no_derivs.pyf' ] ] # For reading a file into lon_description import os def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() core.setup( name='SloppyCell', version='1.1.0.dev1',
'imread/lib/_png.cpp', 'imread/lib/_tiff.cpp', 'imread/lib/_webp.cpp', ], } libraries = ['png', 'jpeg', 'tiff', 'webp'] if sys.platform.startswith('win'): libraries.append('zlib') ext_modules = [ numpyutils.Extension( key, libraries=libraries, library_dirs=library_dirs, include_dirs=include_dirs, sources=sources, undef_macros=undef_macros, define_macros=define_macros, ) for key, sources in extensions.items() ] packages = setuptools.find_packages() package_dir = { 'imread.tests': 'imread/tests', } package_data = { 'imread.tests': ['data/*'], }
import numpy.distutils compiler = numpy.distutils.ccompiler.get_default_compiler() for arg in sys.argv: if arg.startswith('--compiler'): compiler = arg.split('=')[1] if compiler in ['unix', 'mingw32', 'cygwin']: extra_compile_args = [] # RNG: This seems to cause problems on some machines. To test for # compatibility with VC++, uncomment this line. #extra_compile_args = ['-std="iso9899:1990"', '-pedantic-errors'] else: extra_compile_args = [] # Configure our C modules that are built with f2py. tridiag = core.Extension(name='dadi.tridiag', sources=['dadi/tridiag.pyf', 'dadi/tridiag.c'], extra_compile_args=extra_compile_args) int_c = core.Extension(name='dadi.integration_c', sources=[ 'dadi/integration_c.pyf', 'dadi/integration1D.c', 'dadi/integration2D.c', 'dadi/integration3D.c', 'dadi/integration_shared.c', 'dadi/tridiag.c' ], extra_compile_args=extra_compile_args) # If we're building a distribution, try to update svnversion. Note that this # fails silently. if any(arg.count('dist') for arg in os.sys.argv): os.system("svn up") os.system("svn info > dadi/svnversion")