Exemple #1
0
    from Cython.Distutils import build_ext
except ImportError:
    use_cython = False
else:
    use_cython = True

cmdclass = { }
ext_modules = [ ]

#For this to work the .c files are not include in GIT except in the release
#release branch (the c files would be created using python setup.py sdist)
if use_cython:
    ext_modules += [
        Extension("pygom.model._tau_leap",
                  ["pygom/model/_tau_leap.pyx"],
                  include_dirs=[numpy.get_include()],
#                  extra_compile_args=['-fopenmp'],
#                  extra_link_args=['-fopenmp']),
)
    ]
    cmdclass.update({ 'build_ext': build_ext })
else:
#    raise ImportError('You will need Cython installed to create'
#                      'the c extensions. Try installing with'
#                      '"pip install cython" before installing PyGOM.')
     ext_modules += [
         Extension("pygom.model._tau_leap",
                   [ "pygom/model/_tau_leap.c" ],
                   include_dirs=[numpy.get_include()],
#                  extra_compile_args=['-fopenmp'],
#                  extra_link_args=['-fopenmp']),
)
Exemple #2
0
extensions = [
    Extension(
        "*",
        sources=cython_files,
        include_dirs=[
            os.path.abspath(os.path.join(CUDF_HOME, "cpp/include/cudf")),
            os.path.abspath(os.path.join(CUDF_HOME, "cpp/include")),
            os.path.abspath(os.path.join(CUDF_ROOT, "include")),
            os.path.join(CUDF_ROOT, "_deps/libcudacxx-src/include"),
            os.path.join(CUDF_ROOT, "_deps/dlpack-src/include"),
            os.path.join(
                os.path.dirname(sysconfig.get_path("include")),
                "libcudf/libcudacxx",
            ),
            os.path.dirname(sysconfig.get_path("include")),
            np.get_include(),
            pa.get_include(),
            cuda_include_dir,
        ],
        library_dirs=(
            pa.get_library_dirs()
            + [
                get_python_lib(),
                os.path.join(os.sys.prefix, "lib"),
                cuda_lib_dir,
            ]
        ),
        libraries=["cudart", "cudf"] + pa.get_libraries() + ["arrow_cuda"],
        language="c++",
        extra_compile_args=["-std=c++14"],
    )
]
Exemple #3
0
#!/usr/bin/env python

from setuptools import setup
from setuptools.extension import Extension

import numpy as np

try:
    from Cython.Build import cythonize
    CYTHON = True
except ImportError:
    CYTHON = False

extensions = [
    Extension('*', ['pyunicorn/%s/*.%s' % (pkg, 'pyx' if CYTHON else 'c')],
              include_dirs=[np.get_include()])
    for pkg in ['core', 'timeseries']
]

if CYTHON:
    extensions = cythonize(extensions,
                           compiler_directives={
                               'language_level': 2,
                               'embedsignature': True,
                               'boundscheck': False,
                               'wraparound': False,
                               'initializedcheck': False,
                               'nonecheck': False
                           })

setup(
Exemple #4
0
here = path.abspath(path.dirname(__file__))

with open(path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()

if '--use-cython' in sys.argv:
    USE_CYTHON = True
    sys.argv.remove('--use-cython')
else:
    USE_CYTHON = False

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

extensions = [
    Extension('adeft.score._score', ['adeft/score/_score' + ext]),
]

if USE_CYTHON:
    from Cython.Build import cythonize
    extensions = cythonize(extensions,
                           compiler_directives={'language_level': 3})

setup(name='adeft',
      version='0.10.0',
      description=('Acromine based Disambiguation of Entities From'
                   ' Text'),
      long_description=long_description,
      long_description_content_type='text/markdown',
      url='https://github.com/indralab/adeft',
      download_url='https://github.com/indralab/adeft/archive/0.10.0.tar.gz',
Exemple #5
0
pyx_file = "shapely/speedups/_speedups.pyx"
c_file = "shapely/speedups/_speedups.c"

force_cython = False
# Always regenerate for sdist or absent c file
if 'sdist' in sys.argv or not os.path.exists(c_file):
    force_cython = True
# Also regenerate if pyx_file is outdated.
elif os.path.exists(c_file):
    if os.path.getmtime(pyx_file) > os.path.getmtime(c_file):
        force_cython = True

ext_modules = [
    Extension("shapely.speedups._speedups", ["shapely/speedups/_speedups.c"],
              include_dirs=include_dirs,
              library_dirs=library_dirs,
              libraries=libraries,
              extra_link_args=extra_link_args)
]

cmd_classes = setup_args.setdefault('cmdclass', {})

try:
    import numpy
    from Cython.Distutils import build_ext as cython_build_ext
    from distutils.extension import Extension as DistutilsExtension

    if 'build_ext' in setup_args['cmdclass']:
        raise ValueError('We need to put the Cython build_ext in '
                         'cmd_classes, but it is already defined.')
    setup_args['cmdclass']['build_ext'] = cython_build_ext
Exemple #6
0
    import commands
    get_output = commands.getoutput
except ImportError:
    import subprocess

    def _get_output(*args, **kwargs):
        res = subprocess.check_output(*args, shell=True, **kwargs)
        decoded = res.decode('utf-8')
        return decoded.strip()

    get_output = _get_output

ext_module_misc = Extension(
    'gssapi.base.misc',
    extra_link_args=get_output('krb5-config --libs gssapi').split(),
    extra_compile_args=get_output('krb5-config --cflags gssapi').split(),
    sources=[
        'gssapi/base/misc.pyx',
        #        'gssapi/base/cython_converters.pyx'
    ])

ext_module_creds = Extension(
    'gssapi.base.creds',
    extra_link_args=get_output('krb5-config --libs gssapi').split(),
    extra_compile_args=get_output('krb5-config --cflags gssapi').split(),
    sources=[
        'gssapi/base/creds.pyx',
        #        'gssapi/base/cython_converters.pyx'
    ])

ext_module_names = Extension(
    'gssapi.base.names',
Exemple #7
0
    libs.append('CUDA')
    runtime_lib_dirs.append(cuda_lib_dir)
    include_dirs.append(cuda_include_dir)
    exc_list = []
else:
    exc_list = ['AlgoLibR/**/*gpu.pyx']

cython_files = ['AlgoLibR/**/**.pyx']

extensions = [
    Extension(
        "*",
        sources=cython_files,
        include_dirs=include_dirs,
        library_dirs=[get_python_lib()],
        libraries=libs,
        language='c++',
        runtime_library_dirs=runtime_lib_dirs,
        extra_compile_args=['-std=c++11'],  #,'-fopenmp'],
        #extra_link_args=['-lgomp']
    )
]

shutil.rmtree('build', ignore_errors=True)

setup(
    name=name,
    description='AlgoLibR - Algorithms Lib R',
    #long_description=open('README.md', encoding='UTF-8').read(),
    #long_description_content_type='text/markdown',
    #url='https://github.com/raoqiyu',
Exemple #8
0
 version=__version__,
 platforms='Windows, Linux, Darwin',
 author=__author__,
 author_email='*****@*****.**',
 maintainer='Brockmann Consult GmbH',
 maintainer_email='*****@*****.**',
 license=__license__,
 url='https://github.com/bcdev/jpy',
 download_url='https://pypi.python.org/pypi/jpy/' + __version__,
 py_modules=['jpyutil'],
 ext_modules=[
     Extension('jpy',
               sources=sources,
               depends=headers,
               include_dirs=include_dirs,
               library_dirs=library_dirs,
               libraries=libraries,
               extra_link_args=extra_link_args,
               extra_compile_args=extra_compile_args,
               define_macros=define_macros),
     Extension('jdl',
               sources=[os.path.join(src_main_c_dir, 'jni/org_jpy_DL.c')],
               depends=[os.path.join(src_main_c_dir, 'jni/org_jpy_DL.h')],
               include_dirs=include_dirs,
               library_dirs=library_dirs,
               libraries=libraries,
               extra_link_args=extra_link_args,
               extra_compile_args=extra_compile_args,
               define_macros=define_macros),
 ],
 test_suite='setup.test_suite',
Exemple #9
0
    "../cpp/src/twisterx/util",
    arrow_library_directory,
    arrow_lib_include_dir,
    pyarrow_include_dir,
    np.get_include(),
]

# Adopted the Cudf Python Build format
# https://github.com/rapidsai/cudf

extensions = [
    Extension(
        "*",
        sources=cython_files,
        include_dirs=_include_dirs,
        language='c++',
        extra_compile_args=extra_compile_args,
        extra_link_args=extra_link_args,
        libraries=libraries,
        library_dirs=library_directories,
    )
]

compiler_directives = {"language_level": 3, "embedsignature": True}
packages = find_packages(include=["pytwisterx", "pytwisterx.*"])

setup(
    name="pytwisterx",
    packages=packages,
    version='0.0.1',
    setup_requires=[
        "cython",
Exemple #10
0
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
#     Unless required by applicable law or agreed to in writing, software
#     distributed under the License is distributed on an "AS IS" BASIS,
#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#     See the License for the specific language governing permissions and
#     limitations under the License.
"""Installer and testing script for fanotify."""

from setuptools import setup
from setuptools.extension import Extension

EXT_MODULES = [
    Extension(
        'fanotify',
        sources=['fanotify.c'],
    ),
]

setup(
    name='fanotify',
    version='0.1',
    author='Mike Gerow',
    author_email='*****@*****.**',
    description=('Library to interface with linux fanotify features.'),
    license='Apache 2.0',
    test_suite='nose.collector',
    ext_modules=EXT_MODULES,
)
Exemple #11
0

def _remove_prefix(string, prefix='hadoopy/'):
    if string.startswith(prefix):
        return string[len(prefix):]

glibc_version = get_glibc_version()
tb_extra_args = []
if sys.byteorder != 'little':
    tb_extra_args.append('-D BYTECONVERSION_ISBIGENDIAN')

if glibc_version and (glibc_version[0] == 2 and glibc_version[1] >= 9):
    tb_extra_args.append('-D BYTECONVERSION_HASENDIAN_H')

# Since package_data doesn't handle directories, we find all of the files
thirdparty_paths = map(_remove_prefix, _glob_recursive('hadoopy/thirdparty/*'))
ext_modules = [Extension("_hadoopy_main", ["hadoopy/_hadoopy_main" + source_ext,
                                   "hadoopy/getdelim.c"]),
               Extension("_hadoopy_typedbytes", ["hadoopy/_hadoopy_typedbytes" + source_ext],
                         extra_compile_args=tb_extra_args)]
setup(name='hadoopy',
      cmdclass=cmdclass,
      version='0.6.0',
      packages=find_packages(),
      package_data={'hadoopy': thirdparty_paths},
      author='Brandyn A. White',
      author_email='*****@*****.**',
      license='GPLv3',
      url='https://github.com/bwhite/hadoopy',
      ext_modules=ext_modules)
Exemple #12
0
if os.path.exists('MANIFEST'):
    os.remove('MANIFEST')

if check_for_openmp() is True:
    omp_args = ['-fopenmp']
else:
    omp_args = None

if os.name == "nt":
    std_libs = []
else:
    std_libs = ["m"]

cython_extensions = [
    Extension("yt_astro_analysis.ppv_cube.ppv_utils",
              ["yt_astro_analysis/ppv_cube/ppv_utils.pyx"],
              libraries=std_libs),
]

extensions = [
    Extension("yt_astro_analysis.halo_finding.fof.EnzoFOF", [
        "yt_astro_analysis/halo_finding/fof/EnzoFOF.c",
        "yt_astro_analysis/halo_finding/fof/kd.c"
    ],
              libraries=std_libs),
    Extension("yt_astro_analysis.halo_finding.hop.EnzoHop",
              glob.glob("yt_astro_analysis/halo_finding/hop/*.c")),
]

# ROCKSTAR
if os.path.exists("rockstar.cfg"):
Exemple #13
0
        "deps/gsl/sys/infnan.c",
        "deps/gsl/sys/fdiv.c",
        "deps/gsl/sys/coerce.c",
        "deps/gsl/err/stream.c"
    ]

# Create the extensions. Manually enumerate the required
extensions = []

# PyPolyaGamma and GSL source files
extensions.append(
    Extension(
        'pypolyagamma.pypolyagamma',
        depends=headers,
        extra_compile_args=["-w", "-DHAVE_INLINE"],
        extra_link_args=[],
        include_dirs=include_dirs,
        language="c++",
        sources=["pypolyagamma/pypolyagamma" + ext] + sources,
    ))

# If OpenMP is requested, compile the parallel extension
if USE_OPENMP:
    extensions.append(
        Extension(
            'pypolyagamma.parallel',
            depends=headers,
            extra_compile_args=["-w", "-fopenmp", "-DHAVE_INLINE"],
            extra_link_args=["-fopenmp"],
            include_dirs=include_dirs,
            language="c++",
Exemple #14
0
cddlib_pxi.close()
cddlib_f_pxi = open("cddlib_f.pxi", "w")
cddlib_f_pxi.write(
    cddlib_pxi_in.replace("@cddhdr@",
                          "cdd_f.h").replace("@dd@", "ddf").replace(
                              "@mytype@", "myfloat"))
cddlib_f_pxi.close()

setup(
    name="pycddlib",
    version=version,
    ext_modules=[
        Extension(
            "cdd",
            ["cdd.pyx"] + cddgmp_sources,
            include_dirs=[cdd_dir],
            depends=cddgmp_headers,
            define_macros=define_macros,
            libraries=libraries,
        ),
    ],
    author="Matthias Troffaes",
    author_email="*****@*****.**",
    license="GPL",
    keywords=
    "convex, polyhedron, linear programming, double description method",
    platforms="any",
    description=doclines[0],
    long_description="\n".join(doclines[2:]),
    url="http://pypi.python.org/pypi/pycddlib",
    classifiers=classifiers.split('\n'),
    setup_requires=[
Exemple #15
0
from setuptools import setup
from setuptools.extension import Extension
from Cython.Build import cythonize
import numpy
#import Cython.Compiler.Options
#Cython.Compiler.Options.get_directive_defaults()['cdivision'] = True
#Cython.Compiler.Options.get_directive_defaults()['boundscheck'] = False
#Cython.Compiler.Options.get_directive_defaults()['wraparound'] = False
#Cython.Compiler.Options.get_directive_defaults()['profile'] = True

ext_modules=[
    Extension('slowquant.molecularintegrals.runMIcython',['slowquant/molecularintegrals/runMIcython.pyx']),
    Extension('slowquant.coupledcluster.CythonCC',['slowquant/coupledcluster/CythonCC.pyx'])]

setup(ext_modules=cythonize(ext_modules), include_dirs=[numpy.get_include()])
data_files = [('share/caiman', ['LICENSE.txt', 'README.md', 'test_demos.sh']),
              ('share/caiman/example_movies', ['example_movies/data_endoscope.tif', 'example_movies/demoMovie.tif']),
              ('share/caiman/testdata', ['testdata/groundtruth.npz', 'testdata/example.npz'])
             ]
for part in extra_dirs:
	newpart = [("share/caiman/" + d, [os.path.join(d,f) for f in files]) for d, folders, files in os.walk(part)]
	for newcomponent in newpart:
		data_files.append(newcomponent)

data_files.append(['bin', binaries])
############

# compile with:     python setup.py build_ext -i
# clean up with:    python setup.py clean --all
ext_modules = [Extension("caiman.source_extraction.cnmf.oasis",
                         sources=["caiman/source_extraction/cnmf/oasis.pyx"],
                         include_dirs=[np.get_include()],
                         language="c++")]

setup(
    name='caiman',
    version='1.0',
    author='Andrea Giovannucci, Eftychios Pnevmatikakis, Johannes Friedrich, Valentina Staneva, Ben Deverett, Erick Cobos, Jeremie Kalfon',
    author_email='*****@*****.**',
    url='https://github.com/simonsfoundation/CaImAn',
    license='GPL-2',
    description='Advanced algorithms for ROI detection and deconvolution of Calcium Imaging datasets.',
    long_description=readme,
    # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        # How mature is this project? Common values are
        #   3 - Alpha
Exemple #17
0
try:
    import numpy
except ImportError:
    build_requires = ['numpy>=1.9.0']

hgversion = 'unknown'

clstm = Extension('_clstm',
                  libraries=['png', 'protobuf'],
                  include_dirs=[
                      '/usr/include/eigen3', '/usr/local/include/eigen3',
                      '/usr/local/include', '/usr/include/hdf5/serial'
                  ],
                  swig_opts=['-c++', '-I/usr/local/include/eigen3'],
                  extra_compile_args=[
                      '-std=c++11', '-w', '-Dadd_raw=add', '-DNODISPLAY=1',
                      '-DTHROW=throw', '-DHGVERSION="\\"' + hgversion + '\\""'
                  ],
                  sources=[
                      'clstm.i', 'clstm.cc', 'clstm_prefab.cc', 'extras.cc',
                      'ctc.cc', 'clstm_proto.cc', 'clstm.pb.cc'
                  ])

print("making proto file")
os.system("protoc clstm.proto --cpp_out=.")

setup(
    name='clstm',
    version='0.0.5',
    cmdclass=custom_cmd_class,
Exemple #18
0
#!/usr/bin/env python
if __name__ == '__main__':
    from setuptools import setup
    from setuptools.extension import Extension
    from Cython.Build import cythonize
    import numpy as np
    ext = []
    ext += [
        Extension(name='rbf.halton',
                  sources=['rbf/halton.pyx'],
                  include_dirs=[np.get_include()])
    ]
    ext += [
        Extension(name='rbf.misc.bspline',
                  sources=['rbf/misc/bspline.pyx'],
                  include_dirs=[np.get_include()])
    ]
    ext += [
        Extension(name='rbf.geometry',
                  sources=['rbf/geometry.pyx'],
                  include_dirs=[np.get_include()])
    ]
    ext += [
        Extension(name='rbf.poly',
                  sources=['rbf/poly.pyx'],
                  include_dirs=[np.get_include()])
    ]
    setup(
        name='RBF',
        version='2018.10.31',
        description=
Exemple #19
0
 include_package_data=True,
 zip_safe=False,
 setup_requires=['numpy>=1.5', 'cython>=0.26'],
 install_requires=['numpy>=1.5', 'nose>=0.11', 'cython>=0.26', 'matplotlib>1.0.0',
                   'h5py>=2.0.0', 'molmod>=1.4.1', 'scipy>=0.17.1'],
 ext_modules=[
     Extension("yaff.pes.ext",
         sources=['yaff/pes/ext.pyx', 'yaff/pes/nlist.c',
                  'yaff/pes/pair_pot.c', 'yaff/pes/ewald.c', 'yaff/pes/comlist.c',
                  'yaff/pes/dlist.c', 'yaff/pes/grid.c', 'yaff/pes/iclist.c',
                  'yaff/pes/vlist.c', 'yaff/pes/cell.c',
                  'yaff/pes/truncation.c', 'yaff/pes/slater.c', 'yaff/pes/tailcorr.c'],
         depends=['yaff/pes/nlist.h', 'yaff/pes/nlist.pxd',
                  'yaff/pes/pair_pot.h', 'yaff/pes/pair_pot.pxd',
                  'yaff/pes/ewald.h', 'yaff/pes/ewald.pxd',
                  'yaff/pes/comlist.h', 'yaff/pes/comlist.pxd',
                  'yaff/pes/dlist.h', 'yaff/pes/dlist.pxd',
                  'yaff/pes/grid.h', 'yaff/pes/grid.pxd',
                  'yaff/pes/iclist.h', 'yaff/pes/iclist.pxd',
                  'yaff/pes/vlist.h', 'yaff/pes/vlist.pxd',
                  'yaff/pes/cell.h', 'yaff/pes/cell.pxd',
                  'yaff/pes/truncation.h', 'yaff/pes/truncation.pxd',
                  'yaff/pes/slater.h', 'yaff/pes/slater.pxd',
                  'yaff/pes/constants.h', 'yaff/pes/tailcorr.h'],
         include_dirs=[np.get_include()],
     ),
 ],
 classifiers=[
     'Environment :: Console',
     'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
     'Operating System :: POSIX :: Linux',
     'Programming Language :: Python :: 2.7',
Exemple #20
0
    author_email="*****@*****.**",
    license="MIT",
    classifiers=[
        "Development Status :: 4 - Beta",
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Intended Audience :: Developers",
        "Intended Audience :: Science/Research",
        "Topic :: Scientific/Engineering :: Mathematics",
    ],
    setup_requires=["pytest-runner"],
    install_requires=["pybind11>=2.2"],
    tests_require=["pytest"],
    packages=["pysarplus"],
    ext_modules=[
        Extension(
            "pysarplus_cpp",
            ["src/pysarplus.cpp"],
            include_dirs=[get_pybind_include(),
                          get_pybind_include(user=True)],
            extra_compile_args=sysconfig.get_config_var("CFLAGS").split() +
            ["-std=c++11", "-Wall", "-Wextra"],
            libraries=["stdc++"],
            language="c++11",
        )
    ],
    zip_safe=False,
)
Exemple #21
0
import numpy
import sys

from setuptools import setup
from setuptools.extension import Extension
from Cython.Build import cythonize

ext = 'tensornets.references.darkflow_utils'
ext_modules = [
    Extension("%s.%s" % (ext, n),
              sources=["%s/%s.pyx" % (ext.replace('.', '/'), n)],
              libraries=([] if sys.platform.startswith("win") else ['m']),
              include_dirs=[numpy.get_include()])
    for n in ['nms', 'get_boxes']
]

setup(name='tensornets',
      version='0.3.5',
      description='high level network definitions in tensorflow',
      author='Taehoon Lee',
      author_email='*****@*****.**',
      url='https://github.com/taehoonlee/tensornets',
      download_url='https://github.com/taehoonlee/tensornets/tarball/0.3.5',
      license='MIT',
      packages=[
          'tensornets', 'tensornets.datasets', 'tensornets.references', ext
      ],
      include_package_data=True,
      ext_modules=cythonize(ext_modules))
Exemple #22
0
#!/usr/bin/env python
import os
import sys

from setuptools import setup, find_packages
from setuptools.extension import Extension

try:
    from Cython.Build import cythonize
    USE_CYTHON = True
except ImportError:
    USE_CYTHON = False

ext = 'pyx' if USE_CYTHON else 'c'
extensions = [
    Extension('blitzloop._audio', ['blitzloop/_audio.%s' % ext],
              libraries=['jack']),
]
if USE_CYTHON:
    extensions = cythonize(extensions)

# res_files = []
# for dirpath, dirname, files in os.walk('blitzloop/res'):
#     for fn in files:
#         res_files.append(os.path.join(dirpath, fn))
# print res_files

if sys.version_info[0] >= 3:
    extra_requires = []
else:
    extra_requires = ['3to2']
Exemple #23
0
cmdclass = {}
ext_modules = []

# pypy detection
PYPY = "__pypy__" in sys.modules
UNIX = platform.system() in ("Linux", "Darwin")

# only build ext in CPython with UNIX platform
if UNIX and not PYPY:
    # rebuild .c files if cython available
    if CYTHON:
        cythonize("thriftpy/transport/cybase.pyx")
        cythonize("thriftpy/transport/**/*.pyx")
        cythonize("thriftpy/protocol/cybin/cybin.pyx")

    ext_modules.append(Extension("thriftpy.transport.cybase",
                                 ["thriftpy/transport/cybase.c"]))
    ext_modules.append(Extension("thriftpy.transport.buffered.cybuffered",
                                 ["thriftpy/transport/buffered/cybuffered.c"]))
    ext_modules.append(Extension("thriftpy.transport.memory.cymemory",
                                 ["thriftpy/transport/memory/cymemory.c"]))
    ext_modules.append(Extension("thriftpy.transport.framed.cyframed",
                                 ["thriftpy/transport/framed/cyframed.c"]))
    ext_modules.append(Extension("thriftpy.protocol.cybin",
                                 ["thriftpy/protocol/cybin/cybin.c"]))

setup(name="thriftpy",
      version=version,
      description="Pure python implementation of Apache Thrift.",
      keywords="thrift python thriftpy",
      author="Lx Yu",
      author_email="*****@*****.**",
Exemple #24
0
# TODO:
# - Wrap learning.
# - Make LabelCompatibility, UnaryEnergy, PairwisePotential extensible? (Maybe overkill?)

# If Cython is available, build using Cython.
# Otherwise, use the pre-built (by someone who has Cython, i.e. me) wrapper `.cpp` files.
try:
    from Cython.Build import cythonize
    ext_modules = cythonize(
        ['pydensecrf/eigen.pyx', 'pydensecrf/densecrf.pyx'])
except ImportError:
    from setuptools.extension import Extension
    ext_modules = [
        Extension("pydensecrf/eigen",
                  ["pydensecrf/eigen.cpp", "pydensecrf/eigen_impl.cpp"],
                  language="c++",
                  include_dirs=["pydensecrf/densecrf/include"]),
        Extension("pydensecrf/densecrf", [
            "pydensecrf/densecrf.cpp", "pydensecrf/densecrf/src/densecrf.cpp",
            "pydensecrf/densecrf/src/unary.cpp",
            "pydensecrf/densecrf/src/pairwise.cpp",
            "pydensecrf/densecrf/src/permutohedral.cpp",
            "pydensecrf/densecrf/src/optimization.cpp",
            "pydensecrf/densecrf/src/objective.cpp",
            "pydensecrf/densecrf/src/labelcompatibility.cpp",
            "pydensecrf/densecrf/src/util.cpp",
            "pydensecrf/densecrf/external/liblbfgs/lib/lbfgs.c"
        ],
                  language="c++",
                  include_dirs=[
                      "pydensecrf/densecrf/include",
Exemple #25
0
        cython_installed = extension_support = False
        warnings.warn('Cython C extensions disabled as you are not using '
                      'CPython.')
    else:
        cython_installed = True

NO_SQLITE = os.environ.get('NO_SQLITE') or False

if cython_installed:
    src_ext = '.pyx'
else:
    src_ext = '.c'
    cythonize = lambda obj: obj

speedups_ext_module = Extension(
    'playhouse._speedups',
    ['playhouse/_speedups' + src_ext])
sqlite_udf_module = Extension(
    'playhouse._sqlite_udf',
    ['playhouse/_sqlite_udf' + src_ext])
sqlite_ext_module = Extension(
    'playhouse._sqlite_ext',
    ['playhouse/_sqlite_ext' + src_ext],
    libraries=['sqlite3'])

if not extension_support:
    ext_modules = None
elif NO_SQLITE:
    ext_modules = [speedups_ext_module]
    warnings.warn('SQLite extensions will not be built at users request.')
else:
Exemple #26
0
        if proc.returncode != 0:
            print "WARN: fail to build Google url code from SVN, error code: ", proc.returncode

    def run(self):
        self.checkout_googleurl()
        self.patch_googleurl()
        self.build_googleurl()

        _build.run(self)


gurl_module = Extension(
    name="_gurl",
    sources=[os.path.join("src", file) for file in source_files],
    define_macros=macros,
    include_dirs=include_dirs,
    library_dirs=library_dirs,
    libraries=libraries,
    extra_compile_args=extra_compile_args,
    extra_link_args=extra_link_args,
)

setup(
    name="python-google-url",
    version="0.5",
    cmdclass={'build': build},
    ext_package="gurl",
    ext_modules=[gurl_module],
    packages=["gurl"],
    package_dir={"gurl": os.path.join("src", "gurl")},
    package_data={"gurl": ["*.dat", "*.dll"]},
# See if this is being built from an sdist structure
if os.path.exists('lib') and os.path.exists('third_party'):
    _sdist_build = True
else:
    _sdist_build = False

# See if the library is already installed
try:
    lib = cdll.LoadLibrary('libcryptoauth.so')
    # Test to ensure it has the required features to support the
    # python wrapper. It may change later to a version check
    assert 0 != lib.ATCAIfacecfg_size
    _EXTENSIONS = None
except:
    _EXTENSIONS = [Extension('cryptoauthlib', sources=[])]

# Try to load the version
try:
    _VERSION = open('VERSION', 'r').read().strip()
except FileNotFoundError:
    with open('../lib/atca_version.h', 'r') as f:
        m = re.search(r'ATCA_LIBRARY_VERSION_DATE\s+\"([0-9]+)\"', f.read(),
                      re.M)
        _VERSION = m.groups()[0]


def copy_udev_rules(target):
    if _sdist_build:
        rules = 'lib/hal/90-cryptohid.rules'
    else:
Exemple #28
0
url = "https://github.com/KlugerLab/FIt-SNE"
download_url = "https://github.com/KlugerLab/pyFIt-SNE/archive/%s.tar.gz" % __version__
keywords = ["tSNE", "embedding"]
description = "Fast Fourier Transform-accelerated Interpolation-based t-SNE (FIt-SNE)"
license = "BSD3"

#Try...except because for some OS X setups, the compilation fails without -stdlib=libc++
try:
    if platform == "darwin":
        extensions = [
            Extension("fitsne.cppwrap", [
                "fitsne/cppwrap.pyx", "fitsne/src/nbodyfft.cpp",
                "fitsne/src/sptree.cpp", "fitsne/src/tsne.cpp"
            ],
                      language="c++",
                      extra_compile_args=[
                          "-std=c++11", "-O3", '-pthread', "-lfftw3", "-lm"
                      ],
                      extra_link_args=[
                          '-lfftw3', '-lm', "-mmacosx-version-min=10.9"
                      ])
        ]
    else:
        extensions = [
            Extension("fitsne.cppwrap", [
                "fitsne/cppwrap.pyx", "fitsne/src/nbodyfft.cpp",
                "fitsne/src/sptree.cpp", "fitsne/src/tsne.cpp"
            ],
                      language="c++",
                      extra_compile_args=[
                          "-std=c++11", "-O3", '-pthread', "-lfftw3", "-lm"
import os
from setuptools import setup
from setuptools.extension import Extension
from Cython.Distutils import build_ext


CMDCLASS = {"build_ext": build_ext}


VERSION_SCHEME = {
    "version_scheme": os.getenv("SCM_VERSION_SCHEME", "guess-next-dev"),
    "local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
}


EXT_MODULES = [
    Extension(
        "labscript_c_extensions.runviewer.resample",
        sources=[os.path.join("src", "runviewer", "resample.pyx")],
    )
]

setup(
    use_scm_version=VERSION_SCHEME,
    cmdclass=CMDCLASS,
    ext_modules=EXT_MODULES,
)
Exemple #30
0
    def initialize_options(self, *args, **kwargs):
        return self._command.initialize_options(*args, **kwargs)

    def finalize_options(self, *args, **kwargs):
        ret = self._command.finalize_options(*args, **kwargs)
        import numpy
        self.include_dirs.append(numpy.get_include())
        return ret

    def run(self, *args, **kwargs):
        return self._command.run(*args, **kwargs)


extensions = [
    Extension('keras_retinanet.utils.compute_overlap',
              ['keras_retinanet/utils/compute_overlap.pyx']),
]

setuptools.setup(
    name='keras-retinanet',
    version='0.5.1',
    description='Keras implementation of RetinaNet object detection.',
    url='https://github.com/fizyr/keras-retinanet',
    author='Hans Gaiser',
    author_email='*****@*****.**',
    maintainer='Hans Gaiser',
    maintainer_email='*****@*****.**',
    cmdclass={'build_ext': BuildExtension},
    packages=setuptools.find_packages(),
    install_requires=[
        'keras-resnet==0.2.0', 'six', 'scipy', 'cython', 'Pillow',