コード例 #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
コード例 #3
0
from setuptools import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import cython_gsl
import numpy as np

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',
コード例 #4
0
ファイル: setup.py プロジェクト: btweinstein/Helper_Functions
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 プロジェクト: astrofanlee/project_TL
Extension('ndintegration', ['ndintegration.pyx'], 
          include_dirs=[np.get_include()], 
          libraries=['cuba'] ), 

Extension('mymath', ['mymath.pyx'], 
          include_dirs=[np.get_include()]), 

Extension('mpiutil', ['mpiutil.pyx'], 
           include_dirs=[np.get_include(), 
	   mpi4py_include]), 

Extension("sf", ["sf.pyx"], 
          include_dirs= [np.get_include(), cython_gsl.get_cython_include_dir(),
	  '../../clib', ], 
          libraries=cython_gsl.get_libraries()+['mysf'],
          library_dirs=[cython_gsl.get_library_dir(), '../../clib/lib'] ),

Extension("alm", ["alm.pyx"], 
          include_dirs= [np.get_include(), '../../clib', ], 
          libraries=['mysf'],
          library_dirs=[ '../../clib/lib'] ),

Extension("cgalio", ["cgalio.pyx", "../c/cgalio.c"],
          libraries=cython_gsl.get_libraries()+["cuba"],
          include_dirs=[np.get_include(), cython_gsl.get_cython_include_dir(), "../c/"],
          library_dirs=[cython_gsl.get_library_dir(), './', "../c/"]    ) 

 ]

setup( name = 'cython wrapper', cmdclass = {'build_ext': build_ext},
コード例 #6
0
ファイル: setup.py プロジェクト: AlexShevtsov/CythonGSL
from distutils.core import setup
from Cython.Distutils import Extension
from Cython.Distutils import build_ext
import os
import cython_gsl
import numpy as np
from glob import glob
from os.path import splitext

ext_modules = []
for pyxfile in glob('*.pyx'):
    ext = Extension(splitext(pyxfile)[0],
                    [pyxfile],
                    libraries=cython_gsl.get_libraries(),
                    library_dirs=[cython_gsl.get_library_dir()],
                    cython_include_dirs=[cython_gsl.get_cython_include_dir()])

    ext_modules.append(ext)

setup(
    name="CythonGSL_examples",
    version="0.2",
    author="Thomas V. Wiecki",
    author_email="*****@*****.**",
    url="http://github.com/twiecki/CythonGSL",
    description="CythonGSL examples.",
    include_dirs = [np.get_include(), cython_gsl.get_include()],
    cmdclass = {'build_ext': build_ext},
    classifiers=[
                'Development Status :: 3 - Alpha',
                'Environment :: Console',
コード例 #7
0
ファイル: setup.py プロジェクト: dawenl/pyCLiMF
#from distutils.core import setup
from numpy.distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from numpy.distutils.misc_util import Configuration
import numpy
import cython_gsl

setup(cmdclass={'build_ext': build_ext},
      ext_modules=[
          Extension("climf_fast", ["climf_fast.pyx"],
                    libraries=["m"] + cython_gsl.get_libraries(),
                    library_dirs=[cython_gsl.get_library_dir()],
                    include_dirs=[
                        numpy.get_include(),
                        cython_gsl.get_cython_include_dir()
                    ])
      ])
コード例 #8
0
ファイル: setup.py プロジェクト: harrygun/ZA_rec
import os
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy as np
import cython_gsl
"""
"""

machine = os.environ['MACHINE']

if machine == 'mylaptop':
    module = [
        Extension("CGAL-IO", ["cgalio.pyx", "../c/cgalio.c"],
                  libraries=cython_gsl.get_libraries() + ["cuba"],
                  include_dirs=[
                      np.get_include(),
                      cython_gsl.get_cython_include_dir(), "../c/"
                  ],
                  library_dirs=[cython_gsl.get_library_dir(), './', "../c/"]),
    ]

elif machine == 'gwln':
    module = [
        Extension(
            "cgalio",
            ["cgalio.pyx", "../c/cgalio.c"],
            libraries=cython_gsl.get_libraries() + ["cuba"],
            include_dirs=[  #"/home/wangxin/workspace/lib/mylib/script/clib", 
                np.get_include(),
                cython_gsl.get_cython_include_dir(), "../c/"
コード例 #9
0
ファイル: setup.py プロジェクト: elfmanryan/nd
else:
    use_cython = True

ext = '.pyx' if use_cython else '.c'

# from Cython.Compiler.Options import get_directive_defaults
# directive_defaults = get_directive_defaults()
# directive_defaults['linetrace'] = True
# directive_defaults['binding'] = True

omnibus_libraries = []
omnibus_library_dirs = []
omnibus_include_dirs = ['.']

if use_cython:
    omnibus_libraries.extend(cython_gsl.get_libraries())
    omnibus_library_dirs.append(cython_gsl.get_library_dir())
    omnibus_include_dirs.append(cython_gsl.get_cython_include_dir())

cmdclass = {}

extensions = [
    Extension(
        "nd.change._omnibus",
        ["nd/change/_omnibus" + ext],
        libraries=omnibus_libraries,
        library_dirs=omnibus_library_dirs,
        include_dirs=omnibus_include_dirs,
        extra_compile_args=['-O3', '-fopenmp'],
        extra_link_args=['-fopenmp'],
    ),
コード例 #10
0
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import cython_gsl
import numpy as np

setup(cmdclass={'build_ext': build_ext},
      ext_modules=[
          Extension(
              "definitions",
              ["definitions.pyx"],
              libraries=cython_gsl.get_libraries() + ["gmp", "mpfr"],
              library_dirs=[cython_gsl.get_library_dir()],
              include_dirs=[np.get_include(),
                            cython_gsl.get_include()],
          )
      ])

setup(include_dirs=[cython_gsl.get_include()],
      cmdclass={'build_ext': build_ext},
      ext_modules=[
          Extension(
              "froutines",
              ["froutines.pyx"],
              libraries=cython_gsl.get_libraries() + ["gmp", "mpfr"],
              library_dirs=[cython_gsl.get_library_dir()],
              include_dirs=[np.get_include(),
                            cython_gsl.get_include()],
          )
      ])
コード例 #11
0
ファイル: setup.py プロジェクト: harrygun/dynpk
elif machine == 'cita':
    mpi4py_include = '/home/xwang/workspace/software/anaconda/lib/python2.7/site-packages/mpi4py/include'

else:
    raise Exception

src_dir = './'

#src_dir= '../c/'
#src_c = ['misc.c', 'kernel.c', 'abkernel.c']
#c_lib = #'libwigner.a'

kernel_src = ['covm.pyx']
print kernel_src

module = [
    Extension("covm",
              sources=[kernel_src[0]],
              include_dirs=[
                  np.get_include(), mpi4py_include, src_dir,
                  cython_gsl.get_cython_include_dir()
              ],
              libraries=cython_gsl.get_libraries() + ['m'],
              library_dirs=[cython_gsl.get_library_dir(), './', src_dir]),
]

setup(name='Quadratic_Estimator_Cython',
      cmdclass={'build_ext': build_ext},
      ext_modules=module)
コード例 #12
0
# all .pyx files in a folder
import setuptools
from Cython.Build import cythonize
from Cython.Distutils import Extension
from Cython.Distutils import build_ext
import numpy
import cython_gsl

libs = {
    'libraries': cython_gsl.get_libraries(),
    'library_dirs': [cython_gsl.get_library_dir()],
    'include_dirs': [
        cython_gsl.get_cython_include_dir(),
        numpy.get_include(),
    ]
}

extensions = [
    Extension("gbnet.cchain", ["gbnet/cchain.pyx"], **libs),
    Extension("gbnet.cnodes", ["gbnet/cnodes.pyx"], **libs),
]

with open("README.md", "r") as fh:
    long_description = fh.read()

setuptools.setup(
    name='gbnet',
    version='0.1.dev1',
    author="Argenis Arriojas",
    author_email="*****@*****.**",
    description=
コード例 #13
0
ファイル: setup.py プロジェクト: ntezak/CythonRK4
from distutils.core import setup, Extension
from Cython.Build import cythonize
import sys
import subprocess
import numpy as np
import cython_gsl

args = sys.argv[1:]

# Make a `cleanall` rule to get rid of intermediate and library files
if "cleanall" in args:
    print "Deleting cython files..."
    # Just in case the build directory was created by accident,
    # note that shell=True should be OK here because the command is constant.
    subprocess.Popen("rm -rf cythonrk4/*.c", shell=True, executable="/bin/bash")
    subprocess.Popen("rm -rf cythonrk4/*.so", shell=True, executable="/bin/bash")

    # Now do a normal clean
    sys.argv[1] = "clean"


extensions = [Extension("cythonrk4/*", ["cythonrk4/*.pyx"],
                        include_dirs=[np.get_include(),
                                      "/usr/local/include"],
                        libraries=["gsl", "gslcblas", "m"]+cython_gsl.get_libraries())]

setup(
    # ext_modules = cythonize("cythonrk4/*.pyx", include_dirs=[np.get_include()])
    ext_modules = cythonize(extensions)
)
コード例 #14
0
        else:
            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)
コード例 #15
0
ファイル: setup.py プロジェクト: paolofinelli/gsum
from distutils.core import setup, Extension
from Cython.Build import cythonize, build_ext
import numpy
import cython_gsl

# Run: python setup.py build_ext --build-lib ./

extensions = [
    Extension(
        name="gsum.cutils",
        sources=["gsum/cutils.pyx"],
        # depends=['gsl/gsl_linalg.h', 'gsl/gsl_permutation.h'],
        libraries=[*cython_gsl.get_libraries()],
        library_dirs=[cython_gsl.get_library_dir()],
        include_dirs=[
            numpy.get_include(),
            cython_gsl.get_cython_include_dir()
        ],
    )
]

setup(
    name='gsum',
    packages=['gsum'],
    # py_modules=[''],
    include_dirs=[cython_gsl.get_include()],
    cmdclass={'build_ext': build_ext},
    ext_modules=cythonize(extensions, build_dir='gsum'),
    version='0.1',
    description='A Bayesian model of series convergence using Gaussian sums',
    author='Jordan Melendez',