示例#1
0
def configuration(parent_package='', top_path=None):
    from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
    from cython_gsl import get_include, get_libraries, get_library_dir
    
    config = Configuration('growth', parent_package, top_path)

    cython(['core.pyx'], working_path=base_path)
    cython(['power.pyx'], working_path=base_path)
    cython(['correlation.pyx'], working_path=base_path)
    cython(['lensing.pyx'], working_path=base_path)
    cython(['emulator.pyx'], working_path=base_path)

    config.add_extension('core', sources=['core.c', 'transfer.c', 'power_tools.c'],
                         include_dirs=[get_numpy_include_dirs(), get_include(), ''],
                         libraries=get_libraries(), library_dirs=[get_library_dir()],
                         extra_compile_args=['-O3', '-w'],
                         extra_link_args=['-g'])

    config.add_extension('power', sources=['power.c', 'transfer.c', 'power_tools.c'],
                         include_dirs=[get_numpy_include_dirs(), get_include(), ''],
                         libraries=get_libraries(), library_dirs=[get_library_dir()],
                         extra_compile_args=['-O3', '-w'],
                         extra_link_args=['-g'])
    
    config.add_extension('correlation', sources=['correlation.c', 'power_tools.c', 'transfer.c'],
                         include_dirs=[get_numpy_include_dirs(), get_include(), ''],
                         libraries=get_libraries(), library_dirs=[get_library_dir()],
                         extra_compile_args=['-O3', '-w'],
                         extra_link_args=['-g'])

    config.add_extension('lensing', sources=['lensing.c', 'power_tools.c', 'transfer.c'],
                         include_dirs=[get_numpy_include_dirs(), get_include(), ''],
                         libraries=get_libraries(), library_dirs=[get_library_dir()],
                         extra_compile_args=['-O3', '-w'],
                         extra_link_args=['-g'])
    
    
    sources = ['emulator.c', 'emulator/core.c', 'emulator/emu.c', 'emulator/emu_noh.c', \
                'emulator/hubble.c', 'hod_emulator/core.c', 'hod_emulator/emu.c']
    config.add_extension('emulator', sources=sources ,
                          include_dirs=[get_numpy_include_dirs(), get_include(), '', 'emulator', 'hod_emulator'],
                          libraries=get_libraries(), library_dirs=[get_library_dir(), 'emulator', 'hod_emulator'],
                          extra_compile_args=['-O3', '-w'],
                          extra_link_args=['-g'])

    return config
示例#2
0
def configuration(parent_package='', top_path=None):
    from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
    from cython_gsl import get_include, get_libraries, get_library_dir
    
    config = Configuration('halo', parent_package, top_path)

    cython(['bias.pyx'], working_path=base_path)
    
    config.add_extension('bias', sources=['bias.c', 'halo_tools.c'],
                         include_dirs=[get_numpy_include_dirs(), get_include(), ''],
                         libraries=get_libraries(), library_dirs=[get_library_dir()],
                         extra_compile_args=['-O3', '-w'],
                         extra_link_args=['-g'])
                         
    return config
extensions = [
    Extension(
        "rough_front_expansion.cython",
        sources=["rough_front_expansion/cython.pyx"],
        language="c",
        libraries=cython_gsl.get_libraries(),
        library_dirs=[cython_gsl.get_library_dir()],
        include_dirs=[cython_gsl.get_cython_include_dir(),
                      np.get_include()]),
    Extension(
        "rough_front_expansion.cython_D2Q9",
        sources=["rough_front_expansion/cython_D2Q9.pyx"],
        language="c",
        libraries=cython_gsl.get_libraries(),
        library_dirs=[cython_gsl.get_library_dir()],
        include_dirs=[cython_gsl.get_cython_include_dir(),
                      np.get_include()])
]

setup(name='rough_front_expansion',
      version='0.1',
      packages=['rough_front_expansion'],
      url='',
      license='',
      author='btweinstein',
      author_email='*****@*****.**',
      description='',
      include_dirs=[cython_gsl.get_include(),
                    np.get_include()],
      ext_modules=cythonize(extensions, annotate=True))
示例#4
0
from setuptools import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import cython_gsl
import numpy as np

extensions = [
    Extension("wigner_3j.wigner_3j",
              sources=["wigner_3j/wigner_3j.pyx"],
              language="c", libraries = cython_gsl.get_libraries(),
              library_dirs = [cython_gsl.get_library_dir()],
              include_dirs = [cython_gsl.get_cython_include_dir(), np.get_include()])
]

setup(
    name='Max Help',
    version='0.01',
    packages=['wigner_3j'],
    url='',
    license='',
    author='Bryan Weinstein',
    author_email='*****@*****.**',
    description='',
    include_dirs = [cython_gsl.get_include(), np.get_include()],
    ext_modules = cythonize(extensions, annotate=True, reload_support=True)
)
示例#5
0
文件: setup.py 项目: zhabzhang/slda
    import cython_gsl
except ImportError:
    print("Please install numpy and cythongsl.")

# Dealing with Cython
USE_CYTHON = os.environ.get('USE_CYTHON', False)
ext = '.pyx' if USE_CYTHON else '.c'

extensions = [
    Extension(
        'slda._topic_models',
        ['slda/_topic_models' + ext],
        libraries=cython_gsl.get_libraries(),
        library_dirs=[cython_gsl.get_library_dir()],
        include_dirs=[np.get_include(),
                      cython_gsl.get_include()],
    ),
]

if USE_CYTHON:
    from Cython.Build import cythonize
    extensions = cythonize(extensions)

setup(
    name='slda',
    version='0.1.6',
    description='''Cython implementations of Gibbs sampling for latent
                   Dirichlet allocation and its supervised variants''',
    author='Berton Earnshaw, Mimi Felicilda',
    author_email='[email protected], [email protected]',
    url='https://github.com/Savvysherpa/slda',
示例#6
0
文件: setup.py 项目: nickrodd/GalDM
from __future__ import print_function

import logging
from setuptools import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import numpy
import cython_gsl

extensions = [
    Extension("GalDM.dm_int", ["GalDM/dm_int.pyx"],
              include_dirs=[numpy.get_include(),cython_gsl.get_include()], library_dirs=[cython_gsl.get_library_dir()],libraries=["m","gsl","gslcblas"],
              extra_compile_args = ["-O3", "-ffast-math", "-march=native", "-fopenmp","-lcblas","-lgslcblas","-lgsl"],
              extra_link_args=['-fopenmp']),
    Extension("GalDM.dm_profiles", ["GalDM/dm_profiles.pyx"],
              include_dirs=[numpy.get_include(),cython_gsl.get_include()], library_dirs=[cython_gsl.get_library_dir()],libraries=["m","gsl","gslcblas"],
              extra_compile_args = ["-O3", "-ffast-math", "-march=native", "-fopenmp","-lcblas","-lgslcblas","-lgsl"],
              extra_link_args=['-fopenmp'])
]

setup_args = {'name':'GalDM',
    'version':'0.0',
    'description':'Creating galactic dark matter maps and calculated J/D factors',
    'url':'https://github.com/nickrodd/GalDM',
    'author':'Nicholas L Rodd',
    'author_email':'*****@*****.**',
    'license':'MIT',
    'install_requires':[
            'numpy',
            'matplotlib',
            'Cython',
示例#7
0
        sources += f'"{cf}"' + ','
sources = sources[:-1]

# if len(sys.argv)>=3 and sys.argv[2][-2:]==".c":
#     sources = f'"{sys.argv[1]}","{sys.argv[2]}"'
# else:
#     sources = f'"{sys.argv[1]}"'

#from sysconfig import get_paths
#from pprint import pprint

#info = get_paths()  # a diction
#input(info['include'])

numpy_I = np.get_include()
gls_I = cython_gsl.get_include()
lib_dir = os.getcwd()
lib_gls = cython_gsl.get_library_dir()
cython_include = cython_gsl.get_cython_include_dir()
setup = f"""
import os
import sys
from distutils.core import setup, Extension
from Cython.Build import cythonize
from Cython.Compiler import Options
import cython_gsl

##Whether or not to include docstring in the Python extension. If False, the binary size will be smaller
##but the __doc__ attribute of any class or function will be an empty string.

Options.docstrings = True
示例#8
0
文件: setup.py 项目: jlazar17/dm
from distutils.core import setup
from Cython.Distutils import Extension
from Cython.Distutils import build_ext
import cython_gsl

setup(include_dirs=[cython_gsl.get_include()],
      cmdclass={'build_ext': build_ext},
      ext_modules=[
          Extension("gslneuosc", ["src/gslneuosc.pyx"],
                    libraries=cython_gsl.get_libraries(),
                    library_dirs=[cython_gsl.get_library_dir()],
                    include_dirs=[cython_gsl.get_cython_include_dir()])
      ])
示例#9
0
from distutils.core import setup, Extension
import numpy as np
import cython_gsl

setup(
    name="stopsignal",
    version="0.1a",
    author="Thomas V. Wiecki, Dora Matzke, Eric-Jan Wagenmakers",
    author_email="*****@*****.**",
    url="http://github.com/twiecki/stopsignal",
    packages=["stopsignal"],
    package_data={"stopsignal":["examples/*.csv"]},
    description="""stopsignal implements a hierarchical Bayesian estimation of the stopsignal model presented in Matzke et al (submitted) in kabuki.
    Matzke, D., Dolan, C.V, Logan, G.D., Brown, S.D., & Wagenmakers, E.-J. (submitted). Bayesian parametric estimation of stop-signal reaction time distributions. Manuscript submitted for publication.""",
    setup_requires=['NumPy >=1.3.0', 'kabuki >= 0.2a', 'pymc'],
    include_dirs = [np.get_include(), cython_gsl.get_include()],
    classifiers=[
                'Development Status :: 3 - Alpha',
                'Environment :: Console',
                'Operating System :: OS Independent',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: GNU General Public License (GPL)',
                'Programming Language :: Python',
                'Topic :: Scientific/Engineering',
                 ],
    ext_modules = [Extension("stop_likelihoods",
                             ["src/stop_likelihoods.c"],
                             libraries=['gsl','gslcblas'],
                             library_dirs=[cython_gsl.get_library_dir()])]
)
示例#10
0
文件: setup.py 项目: elfmanryan/nd
include_dirs = []
install_requires = []

if not mock_install:
    install_requires.extend([
        "numpy",
        "scipy",
        "xarray",
        "dask[dataframe]",
        "lxml",
        "rasterio",
        "pandas",
        "python-dateutil",
        "matplotlib",
        "affine",
        "opencv-python",
        # "NetCDF4"
        "h5py",
        "h5netcdf",
        "imageio"
    ])

include_dirs.append(numpy.get_include())
include_dirs.append(cython_gsl.get_include())

setup(cmdclass=cmdclass,
      ext_modules=extensions,
      include_dirs=include_dirs,
      install_requires=install_requires)
示例#11
0
import numpy as np
import cython_gsl


setup(
    name="stopsignal_wtf",
    version="0.1a",
    author="Thomas V. Wiecki, Dora Matzke, Eric-Jan Wagenmakers",
    author_email="*****@*****.**",
    url="http://github.com/twiecki/stopsignal",
    packages=["stopsignal_wtf"],
    package_data={"stopsignal":["examples/*.csv"]},
    description="""stopsignal implements a hierarchical Bayesian estimation of the stopsignal model presented in Matzke et al (submitted) in kabuki.
    Matzke, D., Dolan, C.V, Logan, G.D., Brown, S.D., & Wagenmakers, E.-J. (submitted). Bayesian parametric estimation of stop-signal reaction time distributions. Manuscript submitted for publication.""",
    setup_requires=['NumPy >=1.3.0', 'kabuki >= 0.2a', 'pymc'],
    include_dirs = [np.get_include(), cython_gsl.get_include(), "C:/Program Files (x86)/GnuWin32/include"],
    classifiers=[
                'Development Status :: 3 - Alpha',
                'Environment :: Console',
                'Operating System :: OS Independent',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: GNU General Public License (GPL)',
                'Programming Language :: Python',
                'Topic :: Scientific/Engineering',
                 ],
    ext_modules = [Extension("stop_likelihoods_wtf",
                             ["src/stop_likelihoods_wtf.c"],
                             libraries=['gsl','gslcblas'],
                             library_dirs=[cython_gsl.get_library_dir(), "C:/Program Files (x86)/GnuWin32/lib"])]
)
示例#12
0
import numpy as np
import cython_gsl


setup(
    name="stopsignal",
    version="0.1a",
    author="Thomas V. Wiecki, Dora Matzke, Eric-Jan Wagenmakers",
    author_email="*****@*****.**",
    url="http://github.com/twiecki/stopsignal",
    packages=["stopsignal"],
    package_data={"stopsignal":["examples/*.csv"]},
    description="""stopsignal implements a hierarchical Bayesian estimation of the stopsignal model presented in Matzke et al (submitted) in kabuki.
    Matzke, D., Dolan, C.V, Logan, G.D., Brown, S.D., & Wagenmakers, E.-J. (submitted). Bayesian parametric estimation of stop-signal reaction time distributions. Manuscript submitted for publication.""",
    setup_requires=['NumPy >=1.3.0', 'kabuki >= 0.2a', 'pymc'],
    include_dirs = [np.get_include(), cython_gsl.get_include(), "C:/Program Files (x86)/GnuWin32/include"],
    classifiers=[
                'Development Status :: 3 - Alpha',
                'Environment :: Console',
                'Operating System :: OS Independent',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: GNU General Public License (GPL)',
                'Programming Language :: Python',
                'Topic :: Scientific/Engineering',
                 ],
    ext_modules = [Extension("stop_likelihoods",
                             ["src/stop_likelihoods.c"],
                             libraries=['gsl','gslcblas'],
                             library_dirs=[cython_gsl.get_library_dir(), "C:/Program Files (x86)/GnuWin32/lib" ])]
)
示例#13
0
文件: setup.py 项目: Savvysherpa/slda
try:
    import numpy as np
    import cython_gsl
except ImportError:
    print("Please install numpy and cythongsl.")

# Dealing with Cython
USE_CYTHON = os.environ.get('USE_CYTHON', False)
ext = '.pyx' if USE_CYTHON else '.c'

extensions = [
    Extension('slda._topic_models', ['slda/_topic_models' + ext],
              libraries=cython_gsl.get_libraries(),
              library_dirs=[cython_gsl.get_library_dir()],
              include_dirs=[np.get_include(), cython_gsl.get_include()],),
]

if USE_CYTHON:
    from Cython.Build import cythonize
    extensions = cythonize(extensions)

setup(
    name='slda',
    version='0.1.6',
    description='''Cython implementations of Gibbs sampling for latent
                   Dirichlet allocation and its supervised variants''',
    author='Berton Earnshaw, Mimi Felicilda',
    author_email='[email protected], [email protected]',
    url='https://github.com/Savvysherpa/slda',
    license="MIT",
示例#14
0
from setuptools import setup
from setuptools.extension import Extension
from distutils.command.build_ext import build_ext
from Cython.Build import cythonize
import numpy
import cython_gsl

ext_modules = [
    Extension(
        "fast_random",
        ["fast_random.pyx"],
        libraries=cython_gsl.get_libraries(),
        library_dirs=[cython_gsl.get_library_dir()],
        include_dirs=[numpy.get_include(), cython_gsl.get_include()]),
    Extension(
        "fast_random",
        ["fast_random.pyx"])
]
ext_modules = cythonize(ext_modules)

setup(
    name='fast_random',
    ext_modules=ext_modules,
    cmdclass={'build_ext': build_ext})
示例#15
0
文件: setup.py 项目: xpjiang/nlsam
    import cython_gsl
except ImportError:
    error = 'Cannot find gsl package (required for hyp1f1), \n' + \
            'try pip install cythongsl and \nsudo apt-get install libgsl0-dev libgsl0ldbl on Ubuntu and friends' + \
            '\nor\n brew install gsl on mac'
    raise ImportError(error)

if sys.platform.startswith('win'):
    dir_path = os.path.dirname(os.path.realpath(__file__))
    gsl_path = os.path.join(dir_path, 'nlsam', 'gsl_windows')
    os.environ["LIB_GSL"] = gsl_path
    sys.path.append(gsl_path)

from nlsam import get_setup_params
params = get_setup_params()
params['include_dirs'] = [cython_gsl.get_include()]
params['packages'] = find_packages()
params['cmdclass'] = {'build_ext': build_ext}

# Check for local version of dipy if it exists, since it would replace a locally built
# but not installed version.
try:
    import dipy
    print('Found local version of dipy in ' + dipy.__file__)
    if LooseVersion(dipy.__version__) < LooseVersion('0.11'):
        raise ValueError(
            'Local dipy version is {}, but you need at least 0.11!'.format(
                dipy.__version__))
except ImportError:
    print('Cannot find dipy, it will be installed using pip.')
    params['dependencies'].append('dipy>=0.11')
示例#16
0
            return name[:idx] + ext

    class BuildExtWithoutPlatformSuffix(build_ext):
        def get_ext_filename(self, ext_name):
            filename = super().get_ext_filename(ext_name)
            return get_ext_filename_without_platform_suffix(filename)

    cmdclass_option = {'build_ext': BuildExtWithoutPlatformSuffix}
else:
    raise ValueError(
        'You are not using neither Python2 nor Python3, probably you are a time traveller from the Future or from the Past'
    )

#cython gsl
cy_gsl_lib = cython_gsl.get_libraries()
cy_gsl_inc = cython_gsl.get_include()
cy_gsl_lib_dic = cython_gsl.get_library_dir()
#cython
cy_gsl_inc_cy = cython_gsl.get_cython_include_dir()
#numpy
np_inc = numpy.get_include()

gh = ['galpynamics/src/pot_halo/pot_c_ext/general_halo.pyx']
gh_ext = Extension('galpynamics.src.pot_halo.pot_c_ext.general_halo',
                   sources=gh)

ih = ['galpynamics/src/pot_halo/pot_c_ext/isothermal_halo.pyx']
ih_ext = Extension('galpynamics.src.pot_halo.pot_c_ext.isothermal_halo',
                   sources=ih)

infw = ['galpynamics/src/pot_halo/pot_c_ext/nfw_halo.pyx']