Exemplo n.º 1
0
def setup_package():
    
    import bufferkdtree
    VERSION = bufferkdtree.__version__

    metadata = dict(name=DISTNAME,
                    maintainer=MAINTAINER,
                    maintainer_email=MAINTAINER_EMAIL,
                    description=DESCRIPTION,
                    license=LICENSE,
                    url=URL,
                    version=VERSION,
                    download_url=DOWNLOAD_URL,
                    long_description=LONG_DESCRIPTION,
                    classifiers=[
                                 'Intended Audience :: Science/Research',
                                 'Intended Audience :: Developers',
                                 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
                                 'Programming Language :: C',
                                 'Programming Language :: Python',
                                 'Programming Language :: Python :: 2',
                                 'Programming Language :: Python :: 2.6',
                                 'Programming Language :: Python :: 2.7',
                                 ],
                    cmdclass={'clean': CleanCommand},
                    setup_requires=["numpy>=1.11.0"],
                    install_requires=["numpy>=1.11.0"],
                    include_package_data=True,
                    package_data={'bufferkdtree': ['src/neighbors/brute/kernels/opencl/*.cl',
                                                   'src/neighbors/buffer_kdtree/kernels/*.cl'
                                                  ]},
                    **extra_setuptools_args)

    if (len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or sys.argv[1] in ('--version', 'clean'))):
 
        try:
            from setuptools import setup
        except ImportError:
            from distutils.core import setup
        metadata['version'] = VERSION
        setup(**metadata)
        
    else:

        # if pip is installed, make sure that numpy
        # is installed (pip is not a requirement
        # for the bufferkdtree package) 
        try:
            import pip
            pip.main(["install", "numpy>=1.11.0"])
        except:
            pass
                    
        try:
            from numpy.distutils.core import setup as numpy_setup
            metadata['configuration'] = configuration
            numpy_setup(**metadata)
        except Exception as e:
            print("Could not install package: %s" % str(e))
            sys.exit(0)
Exemplo n.º 2
0
    }



def configuration(parent_package='',top_path=None):
    from numpy.distutils.misc_util import Configuration
    confgr = Configuration('pitchtools',parent_package,top_path)

    #sf_info = info_factory('sdif', ['sdif'], ['sdif.h'])()
    #try:
    #    sf_config = sf_info.get_info(2)
    #except NotFoundError:
    #    raise NotFoundError("""sdif library not found.""")
    #
    confgr.add_extension('_pitchtools', ['_pitchtools.c']) # , extra_info=sf_config)

    return confgr

def cython_setup(annotate=True):
    annotate = "-a" if annotate else ""
    os.system("cython %s _pitchtools.pyx" % annotate)


if __name__ == "__main__":
    #from sdif_setup import cython_setup
    cython_setup()
    from numpy.distutils.core import setup as numpy_setup
    config = configuration(top_path='').todict()
    config.update(metadata)
    numpy_setup(**config)
Exemplo n.º 3
0
        version += ".modified"
        pass
    elif modified:
        version += "+modified"
        pass
    pass
else:
    version = "UNKNOWN"
    pass

print("version = %s" % (version))

ext_modules = cythonize("heatsim2/*.pyx")

emdict = dict([(module.name, module) for module in ext_modules])

adi_c_pyx_ext = emdict['heatsim2.alternatingdirection_c_pyx']
adi_c_pyx_ext.sources.append("heatsim2/alternatingdirection_c.c")

#ext_modules.append(numpy_Extension("heatsim2.alternatingdirection_c",["heatsim2/alternatingdirection_c.c"]))

numpy_setup(name="heatsim2",
            description="heatsim2",
            author="Stephen D. Holland",
            version=version,
            zip_safe=False,
            url="http://thermal.cnde.iastate.edu",
            ext_modules=ext_modules,
            packages=["heatsim2"],
            cmdclass={"install_lib": install_lib_save_version})
Exemplo n.º 4
0
def setup_package():

    import bufferkdtree
    VERSION = bufferkdtree.__version__

    metadata = dict(
        name=DISTNAME,
        maintainer=MAINTAINER,
        maintainer_email=MAINTAINER_EMAIL,
        description=DESCRIPTION,
        license=LICENSE,
        url=URL,
        version=VERSION,
        download_url=DOWNLOAD_URL,
        long_description=LONG_DESCRIPTION,
        classifiers=[
            'Intended Audience :: Science/Research',
            'Intended Audience :: Developers',
            'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
            'Programming Language :: C',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
        ],
        cmdclass={'clean': CleanCommand},
        setup_requires=["numpy>=1.11.0"],
        install_requires=["numpy>=1.11.0"],
        include_package_data=True,
        package_data={
            'bufferkdtree': [
                'src/neighbors/brute/kernels/opencl/*.cl',
                'src/neighbors/buffer_kdtree/kernels/*.cl'
            ]
        },
        **extra_setuptools_args)

    if (len(sys.argv) >= 2 and
        ('--help' in sys.argv[1:] or sys.argv[1] in ('--version', 'clean'))):

        try:
            from setuptools import setup
        except ImportError:
            from distutils.core import setup
        metadata['version'] = VERSION
        setup(**metadata)

    else:

        # if pip is installed, make sure that numpy
        # is installed (pip is not a requirement
        # for the bufferkdtree package)
        try:
            import pip
            pip.main(["install", "numpy>=1.11.0"])
        except:
            pass

        try:
            from numpy.distutils.core import setup as numpy_setup
            metadata['configuration'] = configuration
            numpy_setup(**metadata)
        except Exception as e:
            print("Could not install package: %s" % str(e))
            sys.exit(0)
Exemplo n.º 5
0
import sys
from Cython.Build import cythonize
from numpy.distutils.core import setup as numpy_setup, Extension as numpy_Extension

ext_modules = cythonize("greensinversion/*.pyx")

emdict = dict([(module.name, module) for module in ext_modules])

gi_fillholes_pyx_ext = emdict['greensinversion.fillholes']
#gi_fillholes_pyx_ext.sources.append("greensinversion/fillholes_c.c")
#gi_fillholes_pyx_ext.extra_compile_args=['-g']
gi_fillholes_pyx_ext.extra_compile_args = ['-fopenmp', '-O3']
gi_fillholes_pyx_ext.extra_link_args = ['-lgomp']

numpy_setup(name="greensinversion",
            description="greensinversion",
            author="Stephen D. Holland",
            url="http://thermal.cnde.iastate.edu",
            ext_modules=ext_modules,
            packages=["greensinversion"])