Example #1
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup, Extension

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = conf["TAGLIB_INC_DIR"] + conf["BOOST_INC_DIR"]
    LIBRARY_DIRS = conf["TAGLIB_LIB_DIR"] + conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["TAGLIB_LIBNAME"] + conf["BOOST_PYTHON_LIBNAME"]

    setup(name="tagpy",
          version="2018.1.1",
          description="Python Bindings for TagLib",
          long_description=open("README.rst", "rt").read(),
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          classifiers=
          [
              "Development Status :: 5 - Production/Stable",
              "Intended Audience :: Developers",
              "License :: OSI Approved :: MIT License",
              "Natural Language :: English",
              "Operating System :: OS Independent",
              "Operating System :: POSIX",
              "Operating System :: Unix",
              "Programming Language :: Python",
              "Programming Language :: Python :: 3",
              "Topic :: Multimedia :: Sound/Audio",
              "Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping",
              "Topic :: Multimedia :: Sound/Audio :: Editors",
              "Topic :: Software Development :: Libraries :: Python Modules",
              "Topic :: Utilities"],
          license="MIT",

          install_requires=["pytest"],

          url="http://mathema.tician.de/software/tagpy",
          packages=["tagpy", "tagpy.ogg"],
          ext_modules=[
              Extension("_tagpy",
                  ["src/wrapper/basics.cpp",
                      "src/wrapper/id3.cpp",
                      "src/wrapper/rest.cpp"],
                  include_dirs=INCLUDE_DIRS,
                  library_dirs=LIBRARY_DIRS,
                  libraries=LIBRARIES,
                  extra_compile_args=conf["CXXFLAGS"],
                  ),
                        ]
          )
Example #2
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup, Extension

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = conf["TAGLIB_INC_DIR"] + conf["BOOST_INC_DIR"]
    LIBRARY_DIRS = conf["TAGLIB_LIB_DIR"] + conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["TAGLIB_LIBNAME"] + conf["BOOST_PYTHON_LIBNAME"]

    setup(name="tagpy",
          version="2013.1",
          description="Python Bindings for TagLib",
          long_description=open("README.rst", "rt").read(),
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          classifiers=
          [
              "Development Status :: 5 - Production/Stable",
              "Intended Audience :: Developers",
              "License :: OSI Approved :: MIT License",
              "Natural Language :: English",
              "Operating System :: OS Independent",
              "Operating System :: POSIX",
              "Operating System :: Unix",
              "Programming Language :: Python",
              "Programming Language :: Python :: 3",
              "Topic :: Multimedia :: Sound/Audio",
              "Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping",
              "Topic :: Multimedia :: Sound/Audio :: Editors",
              "Topic :: Software Development :: Libraries :: Python Modules",
              "Topic :: Utilities"],
          license="MIT",

          install_requires=["pytest"],

          url="http://mathema.tician.de/software/tagpy",
          packages=["tagpy", "tagpy.ogg"],
          ext_modules=[
              Extension("_tagpy",
                  ["src/wrapper/basics.cpp",
                      "src/wrapper/id3.cpp",
                      "src/wrapper/rest.cpp"],
                  include_dirs=INCLUDE_DIRS,
                  library_dirs=LIBRARY_DIRS,
                  libraries=LIBRARIES,
                  extra_compile_args=conf["CXXFLAGS"],
                  ),
                        ]
          )
Example #3
0
def main():
    import os
    from aksetup_helper import (hack_distutils, get_config, setup,
                                NumpyExtension,
                                set_up_shipped_boost_if_requested,
                                check_git_submodules)

    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema(), warn_about_no_config=False)

    EXTRA_OBJECTS, EXTRA_DEFINES = \
            set_up_shipped_boost_if_requested(
                    "pyviennacl", conf,
                    source_path="external/boost-python-ublas-subset/boost_subset")

    INCLUDE_DIRS = conf["BOOST_INC_DIR"] + ["external/boost_numpy/"]
    if conf["USE_SHIPPED_VIENNACL"]:
        INCLUDE_DIRS += ["external/viennacl-dev/"]

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    # {{{ get version number

    ver_dic = {}
    version_file = open("pyviennacl/version.py")
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()

    exec(compile(version_file_contents, "pyviennacl/version.py", 'exec'),
         ver_dic)

    # }}}

    if conf["USE_OPENCL"]:
        EXTRA_DEFINES["VIENNACL_WITH_OPENCL"] = None
    EXTRA_DEFINES["VIENNACL_WITH_UBLAS"] = None

    platform_cflags["msvc"] = ["/EHsc"]
    platform_cflags["mingw32"] = ["-Wno-unused-function"]
    platform_cflags["unix"] = ["-Wno-unused-function"]

    if EXTRA_OBJECTS:
        platform_cflags['mingw32'] += ["-Wno-unused-local-typedefs"]
        if not sys.platform.startswith("darwin"):
            platform_cflags['unix'] += ["-Wno-unused-local-typedefs"]

    source_files = [
        "core", "vector_float", "vector_double", "vector_int", "vector_long",
        "vector_uint", "vector_ulong", "dense_matrix_float",
        "dense_matrix_double", "dense_matrix_int", "dense_matrix_long",
        "dense_matrix_uint", "dense_matrix_ulong", "compressed_matrix",
        "coordinate_matrix", "ell_matrix", "hyb_matrix", "direct_solvers",
        "iterative_solvers", "eig", "extra_functions", "scheduler",
        "opencl_support"
    ]

    from glob import glob

    setup(
        name="pyviennacl",
        version=ver_dic["VERSION_TEXT"],
        description="Sparse/dense linear algebra on GPUs and CPUs using OpenCL",
        long_description=open("README.rst", "rt").read(),
        author='Toby St Clere Smithe',
        author_email='*****@*****.**',
        url="http://viennacl.sourceforge.net/pyviennacl.html",
        classifiers=[
            'Environment :: Console',
            'Development Status :: 5 - Production/Stable',
            'Intended Audience :: Developers',
            'Intended Audience :: Other Audience',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'Natural Language :: English',
            'Programming Language :: C++',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.2',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: Python :: 3.4',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Physics',
        ],
        packages=["pyviennacl"],
        ext_package="pyviennacl",
        ext_modules=[
            NumpyExtension(
                "_viennacl",
                [
                    os.path.join("src", "_viennacl", sf + ".cpp")
                    for sf in source_files
                ] + glob("external/boost_numpy/libs/numpy/src/*.cpp") +
                EXTRA_OBJECTS,
                depends=[os.path.join("src", "_viennacl", "viennacl.h")],
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
                define_macros=list(EXTRA_DEFINES.items()),
                include_dirs=INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS + conf["CL_LIB_DIR"],
                libraries=LIBRARIES + conf["CL_LIBNAME"],
            )
        ],
        cmdclass={'build_ext': build_ext_subclass})
Example #4
0
def main():
    import glob
    import os
    from aksetup_helper import hack_distutils, get_config, setup, \
            PyUblasExtension

    hack_distutils()
    conf = get_config(get_config_schema())

    # These are in Fortran. No headers available.
    conf["BLAS_INC_DIR"] = []
    conf["LAPACK_INC_DIR"] = []
    conf["ARPACK_INC_DIR"] = []
    conf["DASKR_INC_DIR"] = []
    conf["XERBLA_INC_DIR"] = []

    conf["DASKR_LIB_DIR"] = ["fortran/daskr"]
    conf["DASKR_LIBNAME"] = ["daskr"]
    conf["XERBLA_LIB_DIR"] = ["fortran/xerbla"]
    conf["XERBLA_LIBNAME"] = ["xerbla"]

    if conf["COMPILE_DASKR"]:
        os.system("cd fortran/daskr; ./build.sh")
    if conf["COMPILE_XERBLA"]:
        os.system("cd fortran/xerbla; ./build.sh")

    INCLUDE_DIRS = ["pyublasext/include"] + conf["BOOST_INC_DIR"]

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    OP_EXTRA_INCLUDE_DIRS = conf["BOOST_BINDINGS_INC_DIR"]
    OP_EXTRA_LIBRARY_DIRS = []
    OP_EXTRA_LIBRARIES = []

    conf["USE_XERBLA"] = conf["COMPILE_XERBLA"]
    conf["USE_BLAS"] = conf["HAVE_BLAS"]
    conf["USE_LAPACK"] = conf["HAVE_LAPACK"] and conf["HAVE_BLAS"]
    conf["USE_ARPACK"] = conf["HAVE_ARPACK"] and conf["USE_LAPACK"]
    conf["USE_UMFPACK"] = conf["USE_BLAS"] and conf["HAVE_UMFPACK"]
    conf["USE_DASKR"] = conf["USE_LAPACK"] and conf["COMPILE_DASKR"]

    if conf["HAVE_LAPACK"] and not conf["USE_LAPACK"]:
        print "*** LAPACK disabled because BLAS is missing"
    if conf["HAVE_ARPACK"] and not conf["USE_LAPACK"]:
        print "*** ARPACK disabled because LAPACK is not usable/missing"
    if conf["HAVE_UMFPACK"] and not conf["USE_UMFPACK"]:
        print "*** UMFPACK disabled because BLAS is missing"

    OP_EXTRA_DEFINES = { "PYUBLAS_HAVE_BOOST_BINDINGS":1 }

    def handle_component(comp):
        if conf["USE_"+comp]:
            OP_EXTRA_DEFINES["USE_"+comp] = 1
            OP_EXTRA_INCLUDE_DIRS.extend(conf[comp+"_INC_DIR"])
            OP_EXTRA_LIBRARY_DIRS.extend(conf[comp+"_LIB_DIR"])
            OP_EXTRA_LIBRARIES.extend(conf[comp+"_LIBNAME"])

    handle_component("ARPACK")
    handle_component("UMFPACK")
    handle_component("DASKR")
    handle_component("LAPACK")
    handle_component("BLAS")
    handle_component("XERBLA")

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    setup(name="PyUblasExt",
          version="0.92.4",
          description="Added functionality for PyUblas",
          long_description="""
          PyUblasExt is a companion to
          `PyUblas <http://mathema.tician.de/software/pyublas>`_
          and exposes a variety of useful additions to it:

          * A cross-language "operator" class for building matrix-free algorithms
          * CG and BiCGSTAB linear solvers that use this operator class
          * An `ARPACK <http://mathema.tician.de/software/arpack>`_ interface
            that also uses this operator class
          * An UMFPACK interface for PyUblas's sparse matrices
          * An interface to the `DASKR <http://www.netlib.org/ode/>`_ ODE solver.

          Please refer to the `PyUblas build documentation
          <http://tiker.net/doc/pyublas>`_ for build instructions.
          """,
          author=u"Andreas Kloeckner",
          author_email="*****@*****.**",
          license="MIT",
          url="http://mathema.tician.de/software/pyublas/pyublasext",
          classifiers=[
              'Development Status :: 4 - Beta',
              'Environment :: Console',
              'Intended Audience :: Developers',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: BSD License',
              'Operating System :: MacOS :: MacOS X',
              'Operating System :: POSIX',
              'Programming Language :: Python',
              'Programming Language :: C++',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Utilities',
              ],

          # dependencies
          setup_requires=[
              "PyUblas>=0.92.4",
              ],
          install_requires=[
              "PyUblas>=0.92.4",
              ],

          packages=["pyublasext"],
          ext_package="pyublasext",
          ext_modules=[PyUblasExtension("_internal",
              [
                  "src/wrapper/operation.cpp",
                  "src/wrapper/op_daskr.cpp",
                  ],
              define_macros=list(OP_EXTRA_DEFINES.iteritems()),
              include_dirs=INCLUDE_DIRS + OP_EXTRA_INCLUDE_DIRS,
              library_dirs=LIBRARY_DIRS + OP_EXTRA_LIBRARY_DIRS,
              libraries=LIBRARIES + OP_EXTRA_LIBRARIES,
              extra_compile_args=conf["CXXFLAGS"],
              extra_link_args=conf["LDFLAGS"],
              ), ],

          data_files=[("include/pyublasext", glob.glob("src/cpp/pyublasext/*.hpp"))],
          include_package_data=True,
          package_data={
                  "pyublasext": [
                      "include/pyublasext/*.hpp",
                      ]
                  },

          zip_safe=False,

          # 2to3 invocation
          cmdclass={'build_py': build_py})
Example #5
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup, NumpyExtension
    from setuptools import find_packages

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = ['C++/myrrh'] + conf['BOOST_INC_DIR']
    LIBRARY_DIRS = conf['BOOST_LIB_DIR']
    LIBRARIES = conf['BOOST_PYTHON_LIBNAME']
    EXTRA_DEFINES = {}

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    #
    # C++ extension
    #
    cNetwork = NumpyExtension(
        'pybool.cNetwork',
        [
            'C++/module_network.cpp',
            'C++/myrrh/src/python/multi_array_to_numpy.cpp',
        ],
        include_dirs=INCLUDE_DIRS,
        library_dirs=LIBRARY_DIRS,
        libraries=LIBRARIES,
        define_macros=list(EXTRA_DEFINES.items()),
        extra_compile_args=conf['CXXFLAGS'],
        extra_link_args=conf['LDFLAGS'],
    )

    #
    # Main setup
    #
    setup(
        name='pybool',
        version=read('python', 'pybool', 'VERSION').strip().split('-')[0],
        description='pybool: A package to infer Boolean networks.',
        long_description=read('python', 'pybool', 'README'),
        author='John Reid',
        author_email='*****@*****.**',
        license='BSD',
        url=
        'http://sysbio.mrc-bsu.cam.ac.uk/johns/pybool/docs/build/html/index.html',
        classifiers=[
            'Development Status :: 5 - Production/Stable',
            'Environment :: Console',
            'Intended Audience :: Developers',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: BSD License',
            'Operating System :: MacOS :: MacOS X',
            'Operating System :: POSIX',
            'Operating System :: Microsoft :: Windows',
            'Programming Language :: Python',
            'Programming Language :: C++',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Bio-Informatics',
            'Topic :: Utilities',
        ],
        packages=find_packages(where='python'),
        package_dir={'': 'python'},
        py_modules=['pybool.examples.tutorial'],
        package_data={'pybool': ['README', 'LICENSE', 'VERSION']},
        install_requires=[
            'cookbook>=2.2',
            'numpy>=1.6.1',
            'matplotlib>=1.1.1',
            'networkx>=1.6',
            'pygraphviz>=1.1',
        ],
        scripts=['python/scripts/pybool-find-consistent'],
        ext_modules=[cNetwork],

        # 2to3 invocation
        cmdclass={'build_py': build_py},
        include_package_data=False,
    )
Example #6
0
def main():
    import glob
    import sys

    from aksetup_helper import (hack_distutils, get_config, setup, \
            NumpyExtension, set_up_shipped_boost_if_requested,
            check_git_submodules)

    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema())

    EXTRA_SOURCES, EXTRA_DEFINES = set_up_shipped_boost_if_requested("pycuda", conf)

    EXTRA_DEFINES["PYGPU_PACKAGE"] = "pycuda"
    EXTRA_DEFINES["PYGPU_PYCUDA"] = "1"

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"] + conf["CUDADRV_LIB_DIR"]
    LIBRARIES = (conf["BOOST_PYTHON_LIBNAME"] + conf["BOOST_THREAD_LIBNAME"]
            + conf["CUDADRV_LIBNAME"])

    if not conf["CUDA_INC_DIR"]:
        conf["CUDA_INC_DIR"] = [join(conf["CUDA_ROOT"], "include")]

    if conf["CUDA_TRACE"]:
        EXTRA_DEFINES["CUDAPP_TRACE_CUDA"] = 1

    if conf["CUDA_PRETEND_VERSION"]:
        EXTRA_DEFINES["CUDAPP_PRETEND_CUDA_VERSION"] = conf["CUDA_PRETEND_VERSION"]

    INCLUDE_DIRS = ['src/cpp'] + conf["BOOST_INC_DIR"] + conf["CUDA_INC_DIR"]
    conf["USE_CUDA"] = True

    if 'darwin' in sys.platform and sys.maxsize == 2147483647:
        # The Python interpreter is running in 32 bit mode on OS X
        if "-arch" not in conf["CXXFLAGS"]:
            conf["CXXFLAGS"].extend(['-arch', 'i386', '-m32'])
        if "-arch" not in conf["LDFLAGS"]:
            conf["LDFLAGS"].extend(['-arch', 'i386', '-m32'])

    if 'darwin' in sys.platform:
        # set path to Cuda dynamic libraries,
        # as a safe substitute for DYLD_LIBRARY_PATH
        for lib_dir in conf["CUDADRV_LIB_DIR"]:
            conf["LDFLAGS"].extend(["-Xlinker", "-rpath", "-Xlinker", lib_dir])

    if conf["CUDA_ENABLE_GL"]:
        EXTRA_SOURCES.append("src/wrapper/wrap_cudagl.cpp")
        EXTRA_DEFINES["HAVE_GL"] = 1

    if conf["CUDA_ENABLE_CURAND"]:
        EXTRA_DEFINES["HAVE_CURAND"] = 1
        EXTRA_SOURCES.extend([
            "src/wrapper/wrap_curand.cpp"
            ])
        LIBRARIES.extend(conf["CURAND_LIBNAME"])
        LIBRARY_DIRS.extend(conf["CURAND_LIB_DIR"])

    ver_dic = {}
    exec(compile(open("pycuda/__init__.py").read(), "pycuda/__init__.py", 'exec'), ver_dic)

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    import sys
    if sys.version_info >= (3,):
        pvt_struct_source = "src/wrapper/_pvt_struct_v3.cpp"
    else:
        pvt_struct_source = "src/wrapper/_pvt_struct_v2.cpp"

    setup(name="pycuda",
            # metadata
            version=ver_dic["VERSION_TEXT"],
            description="Python wrapper for Nvidia CUDA",
            long_description="""
            PyCUDA lets you access `Nvidia <http://nvidia.com>`_'s `CUDA
            <http://nvidia.com/cuda/>`_ parallel computation API from Python.
            Several wrappers of the CUDA API already exist-so what's so special
            about PyCUDA?

            * Object cleanup tied to lifetime of objects. This idiom, often
              called
              `RAII <http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>`_
              in C++, makes it much easier to write correct, leak- and
              crash-free code. PyCUDA knows about dependencies, too, so (for
              example) it won't detach from a context before all memory
              allocated in it is also freed.

            * Convenience. Abstractions like pycuda.driver.SourceModule and
              pycuda.gpuarray.GPUArray make CUDA programming even more
              convenient than with Nvidia's C-based runtime.

            * Completeness. PyCUDA puts the full power of CUDA's driver API at
              your disposal, if you wish. It also includes code for
              interoperability with OpenGL.

            * Automatic Error Checking. All CUDA errors are automatically
              translated into Python exceptions.

            * Speed. PyCUDA's base layer is written in C++, so all the niceties
              above are virtually free.

            * Helpful `Documentation <http://documen.tician.de/pycuda>`_ and a
              `Wiki <http://wiki.tiker.net/PyCuda>`_.

            Relatedly, like-minded computing goodness for `OpenCL <http://khronos.org>`_
            is provided by PyCUDA's sister project `PyOpenCL <http://pypi.python.org/pypi/pyopencl>`_.
            """,
            author="Andreas Kloeckner",
            author_email="*****@*****.**",
            license = "MIT",
            url="http://mathema.tician.de/software/pycuda",
            classifiers=[
              'Environment :: Console',
              'Development Status :: 5 - Production/Stable',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: MIT License',
              'Natural Language :: English',
              'Programming Language :: C++',
              'Programming Language :: Python',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Physics',
              'Topic :: Scientific/Engineering :: Visualization',
              ],

            # build info
            packages=["pycuda", "pycuda.gl", "pycuda.sparse", "pycuda.compyte"],

            install_requires=[
                "pytools>=2011.2",
                "pytest>=2",
                "decorator>=3.2.0"
                ],

            ext_package="pycuda",
            ext_modules=[
                NumpyExtension("_driver",
                    [
                        "src/cpp/cuda.cpp",
                        "src/cpp/bitlog.cpp",
                        "src/wrapper/wrap_cudadrv.cpp",
                        "src/wrapper/mempool.cpp",
                        ]+EXTRA_SOURCES,
                    include_dirs=INCLUDE_DIRS,
                    library_dirs=LIBRARY_DIRS,
                    libraries=LIBRARIES,
                    define_macros=list(EXTRA_DEFINES.items()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                NumpyExtension("_pvt_struct",
                    [pvt_struct_source],
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                ],

            data_files=[
                ("include/pycuda", glob.glob("src/cuda/*.hpp"))
                ],

            # 2to3 invocation
            cmdclass={'build_py': build_py})
Example #7
0
def main():
    import glob
    from aksetup_helper import (hack_distutils, get_config, setup, \
            NumpyExtension, Extension, set_up_shipped_boost_if_requested)

    hack_distutils()
    conf = get_config(get_config_schema())
    EXTRA_SOURCES, EXTRA_DEFINES = set_up_shipped_boost_if_requested(conf)

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"] + conf["BOOST_THREAD_LIBNAME"]

    from os.path import dirname, join, normpath

    if conf["CUDA_ROOT"] is None:
        nvcc_path = search_on_path(["nvcc", "nvcc.exe"])
        if nvcc_path is None:
            print "*** CUDA_ROOT not set, and nvcc not in path. Giving up."
            import sys
            sys.exit(1)

        conf["CUDA_ROOT"] = normpath(join(dirname(nvcc_path), ".."))

    if conf["CUDA_INC_DIR"] is None:
        conf["CUDA_INC_DIR"] = [join(conf["CUDA_ROOT"], "include")]
    if not conf["CUDADRV_LIB_DIR"]:
        conf["CUDADRV_LIB_DIR"] = [join(conf["CUDA_ROOT"], "lib")]

    verify_siteconfig(conf)

    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    if conf["CUDA_TRACE"]:
        EXTRA_DEFINES["CUDAPP_TRACE_CUDA"] = 1

    INCLUDE_DIRS = ['src/cpp'] + conf["BOOST_INC_DIR"] + conf["CUDA_INC_DIR"]
    conf["USE_CUDA"] = True

    import sys

    if 'darwin' in sys.platform:
        # prevent from building ppc since cuda on OS X is not compiled for ppc
        # also, default to 32-bit build, since there doesn't appear to be a
        # 64-bit CUDA on Mac yet.
        if "-arch" not in conf["CXXFLAGS"]:
            conf["CXXFLAGS"].extend(['-arch', 'i386', '-m32'])
        if "-arch" not in conf["LDFLAGS"]:
            conf["LDFLAGS"].extend(['-arch', 'i386', '-m32'])

    ext_kwargs = dict()

    if conf["CUDA_ENABLE_GL"]:
        EXTRA_SOURCES.append("src/wrapper/wrap_cudagl.cpp")
        EXTRA_DEFINES["HAVE_GL"] = 1

    ver_dic = {}
    execfile("pycuda/__init__.py", ver_dic)

    setup(name="pycuda",
            # metadata
            version=ver_dic["VERSION_TEXT"],
            description="Python wrapper for Nvidia CUDA",
            long_description="""
            PyCUDA lets you access `Nvidia <http://nvidia.com>`_'s `CUDA
            <http://nvidia.com/cuda/>`_ parallel computation API from Python.
            Several wrappers of the CUDA API already exist-so what's so special
            about PyCUDA?

            * Object cleanup tied to lifetime of objects. This idiom, often
              called
              `RAII <http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>`_
              in C++, makes it much easier to write correct, leak- and
              crash-free code. PyCUDA knows about dependencies, too, so (for
              example) it won't detach from a context before all memory
              allocated in it is also freed.

            * Convenience. Abstractions like pycuda.driver.SourceModule and
              pycuda.gpuarray.GPUArray make CUDA programming even more
              convenient than with Nvidia's C-based runtime.

            * Completeness. PyCUDA puts the full power of CUDA's driver API at
              your disposal, if you wish. It also includes code for
              interoperability with OpenGL.

            * Automatic Error Checking. All CUDA errors are automatically
              translated into Python exceptions.

            * Speed. PyCUDA's base layer is written in C++, so all the niceties
              above are virtually free.

            * Helpful `Documentation <http://documen.tician.de/pycuda>`_ and a
              `Wiki <http://wiki.tiker.net/PyCuda>`_.

            Relatedly, like-minded computing goodness for `OpenCL <http://khronos.org>`_
            is provided by PyCUDA's sister project `PyOpenCL <http://pypi.python.org/pypi/pyopencl>`_.
            """,
            author=u"Andreas Kloeckner",
            author_email="*****@*****.**",
            license = "MIT",
            url="http://mathema.tician.de/software/pycuda",
            classifiers=[
              'Environment :: Console',
              'Development Status :: 5 - Production/Stable',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: MIT License',
              'Natural Language :: English',
              'Programming Language :: C++',
              'Programming Language :: Python',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Physics',
              'Topic :: Scientific/Engineering :: Visualization',
              ],

            # build info
            packages=["pycuda", "pycuda.gl", "pycuda.sparse"],

            install_requires=[
                "pytools>=8",
                "py>=1.0.0b7",
                "decorator>=3.2.0"
                ],

            ext_package="pycuda",
            ext_modules=[
                NumpyExtension("_driver",
                    [
                        "src/cpp/cuda.cpp",
                        "src/cpp/bitlog.cpp",
                        "src/wrapper/wrap_cudadrv.cpp",
                        "src/wrapper/mempool.cpp",
                        ]+EXTRA_SOURCES,
                    include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                    library_dirs=LIBRARY_DIRS + conf["CUDADRV_LIB_DIR"],
                    libraries=LIBRARIES + conf["CUDADRV_LIBNAME"],
                    define_macros=list(EXTRA_DEFINES.iteritems()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                Extension("_pvt_struct",
                    ["src/wrapper/_pycuda_struct.c"],
                    )],

            data_files=[
                ("include/pycuda", glob.glob("src/cuda/*.hpp"))
                ],
            )
Example #8
0
def main():
    from aksetup_helper import (hack_distutils,
            check_pybind11, get_config, setup, check_git_submodules,
            Extension,
            get_pybind_include, PybindBuildExtCommand)

    check_pybind11()
    check_git_submodules()

    hack_distutils(what_opt=1)
    conf = get_config(
            get_config_schema(),
            warn_about_no_config=False)

    triangle_macros = [
            ("EXTERNAL_TEST", 1),
            ("ANSI_DECLARATORS", 1),
            ("TRILIBRARY", 1),
            ]

    tetgen_macros = [
            ("TETLIBRARY", 1),
            ("SELF_CHECK", 1),
            ]

    # }}}

    include_dirs = [
            get_pybind_include(),
            get_pybind_include(user=True)
            ] + ["src/cpp"]

    init_filename = "meshpy/__init__.py"
    exec(compile(open(init_filename, "r").read(), init_filename, "exec"), conf)

    import codecs
    setup(name="MeshPy",
          version=conf["version"],
          description="Triangular and Tetrahedral Mesh Generator",
          long_description=codecs.open("README.rst", "r", "utf-8").read(),
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          license=("MIT for the wrapper/non-commercial for "
              "the Triangle/GNU Affero Public License for TetGen"),
          url="https://documen.tician.de/meshpy",
          classifiers=[
              "Development Status :: 4 - Beta",
              "Intended Audience :: Developers",
              "Intended Audience :: Other Audience",
              "Intended Audience :: Science/Research",
              "License :: OSI Approved :: MIT License",
              "License :: Free for non-commercial use",
              "Natural Language :: English",
              "Programming Language :: C++",
              "Programming Language :: Python",
              "Programming Language :: Python :: 3",
              "Topic :: Multimedia :: Graphics :: 3D Modeling",
              "Topic :: Scientific/Engineering",
              "Topic :: Scientific/Engineering :: Mathematics",
              "Topic :: Scientific/Engineering :: Physics",
              "Topic :: Scientific/Engineering :: Visualization",
              "Topic :: Software Development :: Libraries",
              ],

          packages=["meshpy"],
          setup_requires=["pybind11"],
          python_requires="~=3.6",
          install_requires=[
                  "pytools>=2011.2",
                  "pytest>=2",
                  "numpy",
                  "gmsh_interop",
                  ],
          ext_modules=[
              Extension(
                  "meshpy._internals",
                  [
                      "src/cpp/wrapper.cpp",

                      "src/cpp/wrap_triangle.cpp",
                      "src/cpp/triangle.cpp",

                      "src/cpp/wrap_tetgen.cpp",
                      "src/cpp/tetgen.cpp",
                      "src/cpp/predicates.cpp",
                      ],
                  include_dirs=include_dirs,
                  define_macros=triangle_macros + tetgen_macros,
                  extra_compile_args=conf["CXXFLAGS"],
                  extra_link_args=conf["LDFLAGS"],
                  ),
              ],
          cmdclass={"build_ext": PybindBuildExtCommand},
          zip_safe=False,
          )
Example #9
0
def main():
    from setuptools import find_packages
    from aksetup_helper import (hack_distutils, get_config, setup,
            check_pybind11, check_git_submodules, ExtensionUsingNumpy,
            get_pybind_include, PybindBuildExtCommand)
    check_pybind11()
    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema(),
            warn_about_no_config=False)

    extra_defines = {}

    extra_defines["PYGPU_PACKAGE"] = "pyopencl"
    extra_defines["PYGPU_PYOPENCL"] = "1"

    if conf["CL_TRACE"]:
        extra_defines["PYOPENCL_TRACE"] = 1

    if conf["CL_ENABLE_GL"]:
        extra_defines["HAVE_GL"] = 1

    if conf["CL_USE_SHIPPED_EXT"]:
        extra_defines["PYOPENCL_USE_SHIPPED_EXT"] = 1

    if conf["CL_PRETEND_VERSION"]:
        try:
            major, minor = [int(x) for x in conf["CL_PRETEND_VERSION"].split(".")]
            extra_defines["PYOPENCL_PRETEND_CL_VERSION"] = \
                    0x1000*major + 0x10 * minor
        except Exception:
            print("CL_PRETEND_VERSION must be of the form M.N, "
                    "with two integers M and N")
            raise

    conf["EXTRA_DEFINES"] = extra_defines

    INCLUDE_DIRS = conf["CL_INC_DIR"] + ["pybind11/include"]  # noqa: N806

    ver_dic = {}
    version_file = open("pyopencl/version.py")
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()

    exec(compile(version_file_contents, "pyopencl/version.py", "exec"), ver_dic)

    if not exists("pyopencl/compyte/dtypes.py"):
        print(75 * "-")
        print("You are missing important files from the pyopencl distribution.")
        print(75 * "-")
        print("You may have downloaded a zip or tar file from Github.")
        print("Those do not work, and I am unable to prevent Github from showing")
        print("them. Delete that file, and get an actual release file from the")
        print("Python package index:")
        print()
        print("https://pypi.python.org/pypi/pyopencl")
        sys.exit(1)

    setup(name="pyopencl",
            # metadata
            version=ver_dic["VERSION_TEXT"],
            description="Python wrapper for OpenCL",
            long_description=open("README.rst").read(),
            author="Andreas Kloeckner",
            author_email="*****@*****.**",
            license="MIT",
            url="http://mathema.tician.de/software/pyopencl",
            classifiers=[
                "Environment :: Console",
                "Development Status :: 5 - Production/Stable",
                "Intended Audience :: Developers",
                "Intended Audience :: Other Audience",
                "Intended Audience :: Science/Research",
                "License :: OSI Approved :: MIT License",
                "Natural Language :: English",
                "Programming Language :: C++",
                "Programming Language :: Python",
                "Programming Language :: Python :: 3",
                "Topic :: Scientific/Engineering",
                "Topic :: Scientific/Engineering :: Mathematics",
                "Topic :: Scientific/Engineering :: Physics",
                ],

            # build info
            packages=find_packages(),

            ext_modules=[
                ExtensionUsingNumpy("pyopencl._cl",
                    [
                        "src/wrap_constants.cpp",
                        "src/wrap_cl.cpp",
                        "src/wrap_cl_part_1.cpp",
                        "src/wrap_cl_part_2.cpp",
                        "src/wrap_mempool.cpp",
                        "src/bitlog.cpp",
                        ],
                    include_dirs=INCLUDE_DIRS + [
                        get_pybind_include(),
                        ],
                    library_dirs=conf["CL_LIB_DIR"],
                    libraries=conf["CL_LIBNAME"],
                    define_macros=list(conf["EXTRA_DEFINES"].items()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    language="c++",
                    ),
                ],

            setup_requires=[
                "pybind11>=2.5.0",
                "numpy",
                ],

            python_requires="~=3.6",
            install_requires=[
                "numpy",
                "pytools>=2021.2.7",
                "platformdirs>=2.2.0",
                # "Mako>=0.3.6",

                "dataclasses; python_version<'3.7'",
                ],
            extras_require={
                "pocl":  ["pocl_binary_distribution>=1.2"],
                "oclgrind":  ["oclgrind_binary_distribution>=18.3"],
                "test": ["pytest>=7.0.0", "Mako"],
            },
            include_package_data=True,
            package_data={
                    "pyopencl": [
                        "cl/*.cl",
                        "cl/*.h",
                        "cl/pyopencl-random123/*.cl",
                        "cl/pyopencl-random123/*.h",
                        ]
                    },

            cmdclass={"build_ext": PybindBuildExtCommand},
            zip_safe=False)
Example #10
0
def main():
    from setuptools import find_packages
    from aksetup_helper import hack_distutils, get_config, setup, \
            PyUblasExtension

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = conf["BOOST_INC_DIR"] \

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_DEFINES = {}
    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    ver_dic = {}
    ver_file_name = "pyvisfile/__init__.py"
    with open(ver_file_name, "r") as inf:
        exec(compile(inf.read(), ver_file_name, 'exec'), ver_dic)

    requirements = []
    ext_modules = []

    if conf["USE_SILO"]:
        EXTRA_DEFINES["USE_SILO"] = 1
        EXTRA_INCLUDE_DIRS.extend(conf["SILO_INC_DIR"])
        EXTRA_LIBRARY_DIRS.extend(conf["SILO_LIB_DIR"])
        EXTRA_LIBRARIES.extend(conf["SILO_LIBNAME"])

        ext_modules.append(PyUblasExtension("_internal",
            ["src/wrapper/wrap_silo.cpp"],
            include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
            library_dirs=LIBRARY_DIRS + EXTRA_LIBRARY_DIRS,
            libraries=LIBRARIES + EXTRA_LIBRARIES,
            extra_compile_args=conf["CXXFLAGS"],
            define_macros=list(EXTRA_DEFINES.items()),
            ))

        requirements.append("PyUblas>=0.92.1")

    setup(name="pyvisfile",
            version=ver_dic["VERSION_TEXT"],
            description="Large-scale Visualization Data Storage",
            long_description="""
            Pyvisfile allows you to write a variety of visualization file formats,
            including

            * `Kitware's <http://www.kitware.com>`_
              `XML-style <http://www.vtk.org/VTK/help/documentation.html>`_
              `Vtk <http://vtk.org>`_ data files.

            * Silo visualization files, as
              introduced by LLNL's
              `MeshTV <https://wci.llnl.gov/codes/meshtv/>`_ and
              more recently used by the
              `VisIt <https://wci.llnl.gov/codes/visit/>`_
              large-scale visualization program.

            pyvisfiles supports many mesh geometries, such such as unstructured
            and rectangular structured meshes, particle meshes, as well as
            scalar and vector variables on them. In addition, pyvisfile allows the
            semi-automatic writing of parallelization-segmented visualization files
            in both Silo and Vtk formats. For Silo files, pyvisfile also
            supports the writing of expressions as visualization variables.

            pyvisfile can write Vtk files without any extra software installed.

            To use pyvisfile to create Silo files, you need `libsilo
            <https://wci.llnl.gov/codes/silo/>`_ as well as `Boost.Python
            <http://www.boost.org>`_ and `PyUblas
            <http://mathema.tician.de/software/pyublas>`_.  To build
            pyvisfile's Silo support, please refer to the `PyUblas
            documentation <http://tiker.net/doc/pyublas>`_ for build
            instructions first. Check the
            `VisIt source page <https://wci.llnl.gov/codes/visit/source.html>`_
            for the latest Silo source code.
            """,
            classifiers=[
                'Development Status :: 4 - Beta',
                'Intended Audience :: Developers',
                'Intended Audience :: Other Audience',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: MIT License',
                'Natural Language :: English',
                'Programming Language :: C++',
                'Programming Language :: Python',
                'Programming Language :: Python :: 2',
                'Programming Language :: Python :: 2.6',
                'Programming Language :: Python :: 2.7',
                'Programming Language :: Python :: 3',
                'Programming Language :: Python :: 3.3',
                'Programming Language :: Python :: 3.4',
                'Topic :: Multimedia :: Graphics :: 3D Modeling',
                'Topic :: Scientific/Engineering',
                'Topic :: Scientific/Engineering :: Mathematics',
                'Topic :: Scientific/Engineering :: Physics',
                'Topic :: Scientific/Engineering :: Visualization',
                'Topic :: Software Development :: Libraries',
                ],

            author=u"Andreas Kloeckner",
            author_email="*****@*****.**",
            license="MIT",
            url="http://mathema.tician.de/software/pyvisfile",

            # dependencies
            setup_requires=requirements,
            install_requires=[
                    "pytools>=2013.2",
                    ] + requirements,

            packages=find_packages(),
            ext_package="pyvisfile.silo",
            ext_modules=ext_modules,

            zip_safe=False)
Example #11
0
def main():
    # pylint: disable=too-many-statements, too-many-branches, too-many-locals

    from aksetup_helper import (hack_distutils,
            get_config, setup, check_git_submodules)

    check_git_submodules()

    hack_distutils(what_opt=None)
    conf = get_config(get_config_schema(), warn_about_no_config=False)

    EXTRA_SOURCES = []  # noqa
    EXTRA_DEFINES = {}  # noqa
    INCLUDE_DIRS = []  # noqa
    LIBRARY_DIRS = []  # noqa
    LIBRARIES = []  # noqa
    CXXFLAGS = conf["CXXFLAGS"]  # noqa: N806

    if conf["USE_SHIPPED_ISL"]:
        from glob import glob
        isl_blacklist = [
                "_templ.c",
                "_templ_yaml.c",
                "mp_get",
                "extract_key.c",
                "isl_multi_templ.c",
                "isl_multi_apply_set.c",
                "isl_multi_gist.c",
                "isl_multi_coalesce.c",
                "isl_multi_intersect.c",
                "isl_multi_floor.c",
                "isl_multi_apply_union_set.c",
                "isl_multi_cmp.c",
                "isl_multi_pw_aff_explicit_domain.c",
                "isl_multi_hash.c",
                "isl_multi_dims.c",
                "isl_multi_explicit_domain.c",
                "isl_multi_no_explicit_domain.c",
                "isl_multi_align_set.c",
                "isl_multi_align_union_set.c",
                "isl_multi_union_pw_aff_explicit_domain.c",
                "isl_union_templ.c",
                "isl_union_multi.c",
                "isl_union_eval.c",
                "isl_union_neg.c",
                "isl_union_single.c",
                "isl_pw_hash.c",
                "isl_pw_eval.c",
                "isl_pw_union_opt.c",
                "isl_pw_union_opt.c",
                ]

        for fn in glob("isl/*.c"):
            blacklisted = False
            for bl in isl_blacklist:
                if bl in fn:
                    blacklisted = True
                    break

            if "no_piplib" in fn:
                pass
            elif "piplib" in fn:
                blacklisted = True

            if "gmp" in fn:
                if conf["USE_SHIPPED_IMATH"]:
                    continue
            if "imath" in fn:
                if not conf["USE_SHIPPED_IMATH"]:
                    continue

                if "sioimath" in fn and not conf["USE_IMATH_SIO"]:
                    continue
                if "isl_val_imath" in fn and conf["USE_IMATH_SIO"]:
                    continue

            if "isl_ast_int.c" in fn and conf["USE_SHIPPED_IMATH"]:
                continue

            inf = open(fn, "r", encoding="utf-8")
            try:
                contents = inf.read()
            finally:
                inf.close()

            if "int main(" not in contents and not blacklisted:
                EXTRA_SOURCES.append(fn)

        conf["ISL_INC_DIR"] = ["isl-supplementary", "isl/include", "isl"]

        if conf["USE_SHIPPED_IMATH"]:
            EXTRA_SOURCES.extend([
                "isl/imath/imath.c",
                "isl/imath/imrat.c",
                "isl/imath/gmp_compat.c",
                #"isl/imath_wrap/imath.c",
                #"isl/imath_wrap/imrat.c",
                #"isl/imath_wrap/gmp_compat.c",
                ])
            EXTRA_DEFINES["USE_IMATH_FOR_MP"] = 1
            if conf["USE_IMATH_SIO"]:
                EXTRA_DEFINES["USE_SMALL_INT_OPT"] = 1

                import sys
                if sys.platform in ['linux', 'linux2', 'darwin']:
                    CXXFLAGS.insert(0, "-std=gnu99")

            conf["ISL_INC_DIR"].append("isl/imath")
        else:
            EXTRA_DEFINES["USE_GMP_FOR_MP"] = 1

    else:
        LIBRARY_DIRS.extend(conf["ISL_LIB_DIR"])
        LIBRARIES.extend(conf["ISL_LIBNAME"])

    wrapper_dirs = conf["ISL_INC_DIR"][:]

    # {{{ configure barvinok

    if conf["USE_BARVINOK"]:
        if conf["USE_SHIPPED_ISL"]:
            raise RuntimeError("barvinok wrapper is not compatible with using "
                    "shipped isl")
        if conf["USE_SHIPPED_IMATH"]:
            raise RuntimeError("barvinok wrapper is not compatible with using "
                    "shipped imath")

        INCLUDE_DIRS.extend(conf["BARVINOK_INC_DIR"])
        LIBRARY_DIRS.extend(conf["BARVINOK_LIB_DIR"])
        LIBRARIES.extend(conf["BARVINOK_LIBNAME"])

        wrapper_dirs.extend(conf["BARVINOK_INC_DIR"])

        #EXTRA_DEFINES["ISLPY_ISL_VERSION"] = 15

    # }}}

    INCLUDE_DIRS.extend(conf["ISL_INC_DIR"])

    if not (conf["USE_SHIPPED_ISL"] and conf["USE_SHIPPED_IMATH"]) and \
            conf["USE_GMP"]:
        INCLUDE_DIRS.extend(conf["GMP_INC_DIR"])
        LIBRARY_DIRS.extend(conf["GMP_LIB_DIR"])
        LIBRARIES.extend(conf["GMP_LIBNAME"])

    init_filename = "islpy/version.py"
    with open(init_filename, "r") as version_f:
        version_py = version_f.read()
    exec(compile(version_py, init_filename, "exec"), conf)

    from gen_wrap import gen_wrapper
    headers = gen_wrapper(wrapper_dirs, include_barvinok=conf["USE_BARVINOK"],
            isl_version=EXTRA_DEFINES.get("ISLPY_ISL_VERSION"))

    write_cffi_build_script(
            headers,
            EXTRA_DEFINES=EXTRA_DEFINES,
            EXTRA_SOURCES=EXTRA_SOURCES,
            INCLUDE_DIRS=INCLUDE_DIRS,
            LIBRARY_DIRS=LIBRARY_DIRS,
            LIBRARIES=LIBRARIES,
            CFLAGS=CXXFLAGS,
            LDFLAGS=conf["LDFLAGS"]
            )

    with open("README.rst", "rt") as readme_f:
        readme = readme_f.read()

    setup(name="islpy",
          version=conf["VERSION_TEXT"],
          description="Wrapper around isl, an integer set library",
          long_description=readme,
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          license="MIT",
          url="http://documen.tician.de/islpy",
          classifiers=[
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: MIT License',
              'Natural Language :: English',
              'Programming Language :: C++',
              'Programming Language :: Python',
              'Programming Language :: Python :: 2.7',
              'Programming Language :: Python :: 3',
              'Programming Language :: Python :: 3.3',
              'Programming Language :: Python :: 3.4',
              'Programming Language :: Python :: 3.5',
              'Programming Language :: Python :: 3.6',
              'Programming Language :: Python :: Implementation :: CPython',
              'Programming Language :: Python :: Implementation :: PyPy',
              'Topic :: Multimedia :: Graphics :: 3D Modeling',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Physics',
              'Topic :: Scientific/Engineering :: Visualization',
              'Topic :: Software Development :: Libraries',
              ],

          packages=["islpy"],

          setup_requires=["cffi>=1.1.0"],
          cffi_modules=["islpy_cffi_build.py:ffi"],
          install_requires=[
              "pytest>=2",
              "cffi>=1.1.0",
              # "Mako>=0.3.6",
              "six",
              ],
          )
Example #12
0
def main():
    import glob
    from aksetup_helper import (hack_distutils, get_config, setup,
                                NumpyExtension,
                                set_up_shipped_boost_if_requested,
                                check_git_submodules)

    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema(), warn_about_no_config=False)
    EXTRA_OBJECTS, EXTRA_DEFINES = set_up_shipped_boost_if_requested(
        "pyopencl", conf)

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_INCLUDE_DIRS = []

    EXTRA_DEFINES["PYGPU_PACKAGE"] = "pyopencl"
    EXTRA_DEFINES["PYGPU_PYOPENCL"] = "1"

    if conf["CL_TRACE"]:
        EXTRA_DEFINES["PYOPENCL_TRACE"] = 1

    INCLUDE_DIRS = conf["BOOST_INC_DIR"] + conf["CL_INC_DIR"]

    if conf["CL_ENABLE_GL"]:
        EXTRA_DEFINES["HAVE_GL"] = 1

    if conf["CL_ENABLE_DEVICE_FISSION"]:
        EXTRA_DEFINES["PYOPENCL_USE_DEVICE_FISSION"] = 1
    if conf["CL_PRETEND_VERSION"]:
        try:
            major, minor = [
                int(x) for x in conf["CL_PRETEND_VERSION"].split(".")
            ]
            EXTRA_DEFINES[
                "PYOPENCL_PRETEND_CL_VERSION"] = 0x1000 * major + 0x10 * minor
        except:
            print(
                "CL_PRETEND_VERSION must be of the form M.N, with two integers M and N"
            )
            raise

    ver_dic = {}
    version_file = open("pyopencl/version.py")
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()

    exec(compile(version_file_contents, "pyopencl/version.py", 'exec'),
         ver_dic)

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    try:
        import mako
    except ImportError:
        print(
            "-------------------------------------------------------------------------"
        )
        print("Mako is not installed.")
        print(
            "-------------------------------------------------------------------------"
        )
        print(
            "That is not a problem, as most of PyOpenCL will be just fine without it."
        )
        print(
            "Some higher-level parts of pyopencl (such as pyopencl.reduction)")
        print(
            "will not function without the templating engine Mako [1] being installed."
        )
        print(
            "If you would like this functionality to work, you might want to install"
        )
        print("Mako after you finish installing PyOpenCL.")
        print("")
        print("[1] http://www.makotemplates.org/")
        print(
            "-------------------------------------------------------------------------"
        )
        print("Hit Ctrl-C now if you'd like to think about the situation.")
        print(
            "-------------------------------------------------------------------------"
        )

        from aksetup_helper import count_down_delay
        count_down_delay(delay=5)

    might_be_cuda = False
    for inc_dir in conf["CL_INC_DIR"]:
        inc_dir = inc_dir.lower()
        if "nv" in inc_dir or "cuda" in inc_dir:
            might_be_cuda = True

    if might_be_cuda and conf["CL_ENABLE_DEVICE_FISSION"]:
        print(
            "-------------------------------------------------------------------------"
        )
        print(
            "You might be compiling against Nvidia CUDA with device fission enabled."
        )
        print(
            "-------------------------------------------------------------------------"
        )
        print(
            "That is not a problem on CUDA 4.0 and newer. If you are using CUDA 3.2,"
        )
        print(
            "your build will break, because Nvidia shipped a broken CL header in"
        )
        print(
            "in your version. The fix is to set CL_ENABLE_DEVICE_FISSION to False"
        )
        print("in your PyOpenCL configuration.")
        print(
            "-------------------------------------------------------------------------"
        )
        print("Hit Ctrl-C now if you'd like to think about the situation.")
        print(
            "-------------------------------------------------------------------------"
        )

        from aksetup_helper import count_down_delay
        count_down_delay(delay=5)

    import sys
    if sys.version_info >= (3, ):
        pvt_struct_source = "src/wrapper/_pvt_struct_v3.cpp"
    else:
        pvt_struct_source = "src/wrapper/_pvt_struct_v2.cpp"

    setup(
        name="pyopencl",
        # metadata
        version=ver_dic["VERSION_TEXT"],
        description="Python wrapper for OpenCL",
        long_description="""
            PyOpenCL lets you access GPUs and other massively parallel compute
            devices from Python. It tries to offer computing goodness in the
            spirit of its sister project `PyCUDA <http://mathema.tician.de/software/pycuda>`_:

            * Object cleanup tied to lifetime of objects. This idiom, often
              called
              `RAII <http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>`_
              in C++, makes it much easier to write correct, leak- and
              crash-free code.

            * Completeness. PyOpenCL puts the full power of OpenCL's API at
              your disposal, if you wish.  Every obscure `get_info()` query and 
              all CL calls are accessible.

            * Automatic Error Checking. All CL errors are automatically
              translated into Python exceptions.

            * Speed. PyOpenCL's base layer is written in C++, so all the niceties
              above are virtually free.

            * Helpful and complete `Documentation <http://documen.tician.de/pyopencl>`_
              as well as a `Wiki <http://wiki.tiker.net/PyOpenCL>`_.

            * Liberal license. PyOpenCL is open-source under the 
              `MIT license <http://en.wikipedia.org/wiki/MIT_License>`_
              and free for commercial, academic, and private use.

            * Broad support. PyOpenCL was tested and works with Apple's, AMD's, and Nvidia's 
              CL implementations.

            Like PyOpenCL? (And perhaps use it for `bitcoin
            <http://bitcoin.org>`_ mining?) Leave a (bitcoin) tip:
            1HGPQitv27CdENBcH1bstu5B3zeqXRDwtY
            """,
        author="Andreas Kloeckner",
        author_email="*****@*****.**",
        license="MIT",
        url="http://mathema.tician.de/software/pyopencl",
        classifiers=[
            'Environment :: Console',
            'Development Status :: 5 - Production/Stable',
            'Intended Audience :: Developers',
            'Intended Audience :: Other Audience',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'Natural Language :: English',
            'Programming Language :: C++',
            'Programming Language :: Python',
            'Programming Language :: Python :: 3',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Physics',
        ],

        # build info
        packages=["pyopencl", "pyopencl.characterize", "pyopencl.compyte"],
        install_requires=[
            "pytools>=2011.2",
            "pytest>=2",
            "decorator>=3.2.0",
            # "Mako>=0.3.6",
        ],
        ext_package="pyopencl",
        ext_modules=[
            NumpyExtension(
                "_cl",
                [
                    "src/wrapper/wrap_cl.cpp",
                    "src/wrapper/wrap_cl_part_1.cpp",
                    "src/wrapper/wrap_cl_part_2.cpp",
                    "src/wrapper/wrap_constants.cpp",
                    "src/wrapper/wrap_mempool.cpp",
                    "src/wrapper/bitlog.cpp",
                ] + EXTRA_OBJECTS,
                include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS + conf["CL_LIB_DIR"],
                libraries=LIBRARIES + conf["CL_LIBNAME"],
                define_macros=list(EXTRA_DEFINES.items()),
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
            NumpyExtension(
                "_pvt_struct",
                [pvt_struct_source],
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
        ],
        data_files=[("include/pyopencl",
                     glob.glob("src/cl/*.cl") + glob.glob("src/cl/*.h"))],

        # 2to3 invocation
        cmdclass={'build_py': build_py})
Example #13
0
def main():
    import glob
    from aksetup_helper import hack_distutils, get_config, setup, Extension

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = conf["TAGLIB_INC_DIR"] + conf["BOOST_INC_DIR"]
    LIBRARY_DIRS = conf["TAGLIB_LIB_DIR"] + conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["TAGLIB_LIBNAME"] + conf["BOOST_PYTHON_LIBNAME"]

    setup(name="tagpy",
          version="0.94.8",
          description="Python Bindings for TagLib",
          long_description="""
          TagPy is a set of Python bindings for Scott Wheeler's 
          `TagLib <http://developer.kde.org/~wheeler/taglib.html>`_. 
          It builds upon `Boost.Python <http://www.boost.org/libs/python/doc/>`_, 
          a wrapper generation library which is part of the renowned Boost 
          set of C++ libraries.

          Just like TagLib, TagPy can:

          * read and write ID3 tags of version 1 and 2, with many supported frame types
            for version 2 (in MPEG Layer 2 and MPEG Layer 3, FLAC and MPC),
          * access Xiph Comments in Ogg Vorbis Files and Ogg Flac Files,
          * access APE tags in Musepack and MP3 files.

          All these features have their own specific interfaces, but 
          TagLib's generic tag reading and writing mechanism is also 
          supported. It comes with a bunch of examples.
          """,
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          classifiers=
          [ "Development Status :: 5 - Production/Stable",
            "Intended Audience :: Developers",
            "License :: OSI Approved :: MIT License",
            "Natural Language :: English",
            "Operating System :: OS Independent",
            "Operating System :: POSIX",
            "Operating System :: Unix",
            "Programming Language :: Python",
            "Topic :: Multimedia :: Sound/Audio",
            "Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping",
            "Topic :: Multimedia :: Sound/Audio :: Editors",
            "Topic :: Software Development :: Libraries :: Python Modules",
            "Topic :: Utilities"],
          license = "MIT",

          url="http://mathema.tician.de/software/tagpy",
          packages=["tagpy", "tagpy.ogg"],
          ext_modules=[ Extension("_tagpy", 
                                  ["src/wrapper/basics.cpp", 
                                   "src/wrapper/id3.cpp",
                                   "src/wrapper/rest.cpp"],
                                  include_dirs=INCLUDE_DIRS,
                                  library_dirs=LIBRARY_DIRS,
                                  libraries=LIBRARIES,
                                  extra_compile_args=conf["CXXFLAGS"],
                                  ),
                        ]
          )
Example #14
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup, \
            HedgeExtension

    hack_distutils()
    conf = get_config(get_config_schema())

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_DEFINES = {
        "PYUBLAS_HAVE_BOOST_BINDINGS": 1,
    }
    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    INCLUDE_DIRS = ["src/cpp"] \
            + conf["BOOST_BINDINGS_INC_DIR"] \
            + conf["BOOST_INC_DIR"]

    conf["BLAS_INC_DIR"] = []
    conf["LAPACK_INC_DIR"] = []
    conf["USE_BLAS"] = True
    conf["USE_LAPACK"] = True

    def handle_component(comp):
        if conf["USE_" + comp]:
            EXTRA_DEFINES["USE_" + comp] = 1
            EXTRA_INCLUDE_DIRS.extend(conf[comp + "_INC_DIR"])
            EXTRA_LIBRARY_DIRS.extend(conf[comp + "_LIB_DIR"])
            EXTRA_LIBRARIES.extend(conf[comp + "_LIBNAME"])

    handle_component("LAPACK")
    handle_component("BLAS")

    setup(name="pyrticle",
          version="0.90",
          description="A high-order PIC code using Hedge",
          author=u"Andreas Kloeckner",
          author_email="*****@*****.**",
          license="GPLv3",
          url="http://mathema.tician.de/software/pyrticle",
          scripts=["bin/pyrticle"],
          packages=["pyrticle", "pyrticle.deposition"],
          ext_package="pyrticle",
          ext_modules=[
              HedgeExtension(
                  "_internal",
                  [
                      "src/cpp/tools.cpp",
                      "src/wrapper/wrap_tools.cpp",
                      "src/wrapper/wrap_grid.cpp",
                      "src/wrapper/wrap_meshdata.cpp",
                      "src/wrapper/wrap_pic.cpp",
                      "src/wrapper/wrap_pusher.cpp",
                      "src/wrapper/wrap_depositor.cpp",
                      "src/wrapper/wrap_main.cpp",
                  ],
                  include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                  library_dirs=LIBRARY_DIRS + EXTRA_LIBRARY_DIRS,
                  libraries=LIBRARIES + EXTRA_LIBRARIES,
                  extra_compile_args=conf["CXXFLAGS"],
                  define_macros=list(EXTRA_DEFINES.iteritems()),
              )
          ])
Example #15
0
def main():
    import glob
    from setuptools import find_packages
    from aksetup_helper import (
            check_pybind11,
            hack_distutils, get_config, setup, Extension,
            get_pybind_include, PybindBuildExtCommand)

    check_pybind11()

    hack_distutils()
    conf = get_config(get_config_schema(),
            warn_about_no_config=False)

    extra_defines = {}

    extra_defines["HAVE_MREMAP"] = 0  # mremap() buggy on amd64?

    ver_filename = "pymetis/version.py"
    version_file = open(ver_filename)
    ver_dic = {}
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()
    exec(compile(version_file_contents, ver_filename, 'exec'), ver_dic)

    setup(name="PyMetis",
          version=ver_dic["version"],
          description="A Graph Partitioning Package",
          long_description=open("README.rst", "rt").read(),
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          license="wrapper: MIT/METIS: Apache 2",
          url="http://mathema.tician.de/software/pymetis",
          classifiers=[
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: MIT License',
              'License :: Free for non-commercial use',
              'Natural Language :: English',
              'Programming Language :: C',
              'Programming Language :: C++',
              'Programming Language :: Python',
              'Programming Language :: Python :: 2',
              'Programming Language :: Python :: 2.6',
              'Programming Language :: Python :: 2.7',
              'Programming Language :: Python :: 3',
              'Programming Language :: Python :: 3.3',
              'Programming Language :: Python :: 3.4',
              'Topic :: Multimedia :: Graphics :: 3D Modeling',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Visualization',
              'Topic :: Software Development :: Libraries',
              ],

          packages=find_packages(),

            setup_requires=[
                "pybind11",
                ],
          install_requires=["six"],

          ext_modules=[
              Extension(
                  "pymetis._internal",
                  ["src/wrapper/wrapper.cpp"]
                  + glob.glob("src/metis/GKlib/*.c")
                  + glob.glob("src/metis/*.c")
                  + glob.glob("src/metis/libmetis/*.c"),
                  define_macros=list(extra_defines.items()),
                  include_dirs=["src/metis/GKlib"]
                  + ["src/metis/include"]
                  + ["src/metis/libmetis"]
                  + [
                        get_pybind_include(),
                        get_pybind_include(user=True)
                        ],
                  extra_compile_args=conf["CXXFLAGS"],
                  ),
              ],
            cmdclass={'build_ext': PybindBuildExtCommand},
            zip_safe=False)
Example #16
0
def main():
    import glob
    from aksetup_helper import (hack_distutils, get_config, setup,
            NumpyExtension, set_up_shipped_boost_if_requested,
            check_git_submodules)

    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema(),
            warn_about_no_config=False)
    EXTRA_OBJECTS, EXTRA_DEFINES = set_up_shipped_boost_if_requested("pyopencl", conf)

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    from os.path import dirname, join, normpath

    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    EXTRA_DEFINES["PYGPU_PACKAGE"] = "pyopencl"
    EXTRA_DEFINES["PYGPU_PYOPENCL"] = "1"

    if conf["CL_TRACE"]:
        EXTRA_DEFINES["PYOPENCL_TRACE"] = 1

    INCLUDE_DIRS = conf["BOOST_INC_DIR"] + conf["CL_INC_DIR"]

    ext_kwargs = dict()

    if conf["CL_ENABLE_GL"]:
        EXTRA_DEFINES["HAVE_GL"] = 1

    if conf["CL_ENABLE_DEVICE_FISSION"]:
        EXTRA_DEFINES["PYOPENCL_USE_DEVICE_FISSION"] = 1

    ver_dic = {}
    version_file = open("pyopencl/version.py")
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()

    exec(compile(version_file_contents, "pyopencl/version.py", 'exec'), ver_dic)

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    try:
        import mako
    except ImportError:
        print("-------------------------------------------------------------------------")
        print("Mako is not installed.")
        print("-------------------------------------------------------------------------")
        print("That is not a problem, as most of PyOpenCL will be just fine without it.")
        print("Some higher-level parts of pyopencl (pyopencl.reduction, to be precise)")
        print("will not function without the templating engine Mako [1] being installed.")
        print("If you would like this functionality to work, you might want to install")
        print("Mako after you finish installing PyOpenCL.")
        print("")
        print("[1] http://www.makotemplates.org/")
        print("-------------------------------------------------------------------------")
        print("Hit Ctrl-C now if you'd like to think about the situation.")
        print("-------------------------------------------------------------------------")

        from aksetup_helper import count_down_delay
        count_down_delay(delay=5)

    might_be_cuda = False
    for inc_dir in conf["CL_INC_DIR"]:
        inc_dir = inc_dir.lower()
        if "nv" in inc_dir or "cuda" in inc_dir:
            might_be_cuda = True

    if might_be_cuda and conf["CL_ENABLE_DEVICE_FISSION"]:
        print("-------------------------------------------------------------------------")
        print("You might be compiling against Nvidia CUDA with device fission enabled.")
        print("-------------------------------------------------------------------------")
        print("That is not a problem on CUDA 4.0 and newer. If you are using CUDA 3.2,")
        print("your build will break, because Nvidia shipped a broken CL header in")
        print("in your version. The fix is to set CL_ENABLE_DEVICE_FISSION to False")
        print("in your PyOpenCL configuration.")
        print("-------------------------------------------------------------------------")
        print("Hit Ctrl-C now if you'd like to think about the situation.")
        print("-------------------------------------------------------------------------")

        from aksetup_helper import count_down_delay
        count_down_delay(delay=5)

    import sys
    if sys.version_info >= (3,):
        pvt_struct_source = "src/wrapper/_pvt_struct_v3.cpp"
    else:
        pvt_struct_source = "src/wrapper/_pvt_struct_v2.cpp"

    setup(name="pyopencl",
            # metadata
            version=ver_dic["VERSION_TEXT"],
            description="Python wrapper for OpenCL",
            long_description="""
            PyOpenCL lets you access GPUs and other massively parallel compute
            devices from Python. It tries to offer computing goodness in the
            spirit of its sister project `PyCUDA <http://mathema.tician.de/software/pycuda>`_:

            * Object cleanup tied to lifetime of objects. This idiom, often
              called
              `RAII <http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>`_
              in C++, makes it much easier to write correct, leak- and
              crash-free code.

            * Completeness. PyOpenCL puts the full power of OpenCL's API at
              your disposal, if you wish.  Every obscure `get_info()` query and 
              all CL calls are accessible.

            * Automatic Error Checking. All CL errors are automatically
              translated into Python exceptions.

            * Speed. PyOpenCL's base layer is written in C++, so all the niceties
              above are virtually free.

            * Helpful and complete `Documentation <http://documen.tician.de/pyopencl>`_
              as well as a `Wiki <http://wiki.tiker.net/PyOpenCL>`_.

            * Liberal license. PyOpenCL is open-source under the 
              `MIT license <http://en.wikipedia.org/wiki/MIT_License>`_
              and free for commercial, academic, and private use.

            * Broad support. PyOpenCL was tested and works with Apple's, AMD's, and Nvidia's 
              CL implementations.

            Like PyOpenCL? (And perhaps use it for `bitcoin
            <http://bitcoin.org>`_ mining?) Leave a (bitcoin) tip:
            1HGPQitv27CdENBcH1bstu5B3zeqXRDwtY
            """,
            author="Andreas Kloeckner",
            author_email="*****@*****.**",
            license = "MIT",
            url="http://mathema.tician.de/software/pyopencl",
            classifiers=[
              'Environment :: Console',
              'Development Status :: 5 - Production/Stable',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: MIT License',
              'Natural Language :: English',
              'Programming Language :: C++',
              'Programming Language :: Python',
            'Programming Language :: Python :: 3',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Physics',
              ],

            # build info
            packages=["pyopencl", "pyopencl.characterize", "pyopencl.compyte"],

            install_requires=[
                "pytools>=2011.2",
                "pytest>=2",
                "decorator>=3.2.0",
                # "Mako>=0.3.6",
                ],

            ext_package="pyopencl",
            ext_modules=[
                NumpyExtension("_cl", 
                    [
                        "src/wrapper/wrap_cl.cpp", 
                        "src/wrapper/wrap_cl_part_1.cpp", 
                        "src/wrapper/wrap_cl_part_2.cpp", 
                        "src/wrapper/wrap_constants.cpp", 
                        "src/wrapper/wrap_mempool.cpp", 
                        "src/wrapper/bitlog.cpp", 
                        ]+EXTRA_OBJECTS, 
                    include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                    library_dirs=LIBRARY_DIRS + conf["CL_LIB_DIR"],
                    libraries=LIBRARIES + conf["CL_LIBNAME"],
                    define_macros=list(EXTRA_DEFINES.items()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                NumpyExtension("_pvt_struct",
                    [pvt_struct_source],
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                ],

            data_files=[
                ("include/pyopencl",
                    glob.glob("src/cl/*.cl") + glob.glob("src/cl/*.h"))
                ],

            # 2to3 invocation
            cmdclass={'build_py': build_py})
Example #17
0
def main():
    import glob
    from setuptools import Extension, find_packages
    from aksetup_helper import hack_distutils, get_config, setup

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = ["."] + conf["BOOST_INC_DIR"]
    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_DEFINES = { }

    ext_src = [
        "src/pyicl_module.cpp",
        "src/pyicl_intervals.cpp",
        "src/pyicl_interval_sets.cpp",
        "src/pyicl_interval_maps.cpp",
    ]

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    setup(
            name                 = "PyICL",
            version              = read('Python', 'pyicl', 'VERSION').strip().split('-')[0],
            description          = "Exposes the boost.icl interval container library to python",
            long_description     = read('Python', 'pyicl', 'README'),
            author               = "John Reid",
            author_email         = "*****@*****.**",
            license              = "BSD",
            url                  = "http://sysbio.mrc-bsu.cam.ac.uk/johns/PyICL/docs/build/html/",
            classifiers          = [
                'Development Status :: 4 - Beta',
                'Environment :: Console',
                'Intended Audience :: Developers',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: BSD License',
                'Operating System :: POSIX',
                'Operating System :: Unix',
                'Operating System :: MacOS :: MacOS X',
                'Operating System :: Microsoft :: Windows',
                'Programming Language :: Python',
                'Programming Language :: C++',
                'Topic :: Software Development :: Libraries :: Python Modules',
                'Topic :: Scientific/Engineering',
                'Topic :: Scientific/Engineering :: Mathematics',
                'Topic :: Office/Business',
                'Topic :: Utilities',
            ],

            packages              = ['pyicl'],
            package_dir           = {'' : 'Python'},
            package_data          = {'pyicl': ['VERSION', 'README', 'LICENSE']},
            include_package_data  = True,
            install_requires      = ['cookbook'],
            ext_modules           = [
                Extension("pyicl._pyicl",
                    ext_src,
                    include_dirs=INCLUDE_DIRS,
                    library_dirs=LIBRARY_DIRS,
                    libraries=LIBRARIES,
                    define_macros=list(EXTRA_DEFINES.items()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                ),
            ],

            # 2to3 invocation
            cmdclass               = {'build_py': build_py})
Example #18
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup, \
            NumpyExtension

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = ["pyublas/include"] + conf["BOOST_INC_DIR"]
    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_DEFINES = {}

    if conf["USE_ITERATORS"]:
        EXTRA_DEFINES["BOOST_UBLAS_USE_ITERATING"] = 1

    ext_src = [
        "src/wrapper/main.cpp",
        "src/wrapper/converters.cpp",
    ]

    if conf["WITH_SPARSE_WRAPPERS"]:
        ext_src += [
            "src/wrapper/sparse_build.cpp",
            "src/wrapper/sparse_execute.cpp",
        ]
        EXTRA_DEFINES["HAVE_SPARSE_WRAPPERS"] = 1

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    setup(
        name="PyUblas",
        version="2013.1",
        description="Seamless Numpy-UBlas interoperability",
        long_description=open("README.rst", "rt").read(),
        author="Andreas Kloeckner",
        author_email="*****@*****.**",
        license="BSD",
        url="http://mathema.tician.de/software/pyublas",
        classifiers=[
            'Development Status :: 4 - Beta',
            'Environment :: Console',
            'Intended Audience :: Developers',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: BSD License',
            'Operating System :: MacOS :: MacOS X',
            'Operating System :: POSIX',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.4',
            'Programming Language :: Python :: 2.5',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.2',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: C++',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Office/Business',
            'Topic :: Utilities',
        ],

        # numpy is often under the setuptools radar.
        #setup_requires=[
        #"numpy>=1.0.4",
        #],
        install_requires=[
            #"numpy>=1.0.4",
            "pytest>=2",
        ],
        packages=["pyublas"],
        ext_package="pyublas",
        ext_modules=[
            NumpyExtension(
                "_internal",
                ext_src,
                include_dirs=INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS,
                libraries=LIBRARIES,
                define_macros=list(EXTRA_DEFINES.items()),
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
            NumpyExtension(
                "testhelp_ext",
                ["src/test/testhelp_ext.cpp"],
                include_dirs=INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS,
                libraries=LIBRARIES,
                define_macros=list(EXTRA_DEFINES.items()),
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            )
        ],
        include_package_data=True,
        package_data={"pyublas": [
            "include/pyublas/*.hpp",
        ]},
        zip_safe=False,

        # 2to3 invocation
        cmdclass={'build_py': build_py})
Example #19
0
def main():
    from aksetup_helper import (
        hack_distutils,
        get_config,
        setup,
        NumpyExtension,
        set_up_shipped_boost_if_requested,
        check_git_submodules,
    )

    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema(), warn_about_no_config=False)
    EXTRA_OBJECTS, EXTRA_DEFINES = set_up_shipped_boost_if_requested("pyopencl", conf)

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_INCLUDE_DIRS = []

    EXTRA_DEFINES["PYGPU_PACKAGE"] = "pyopencl"
    EXTRA_DEFINES["PYGPU_PYOPENCL"] = "1"

    if conf["CL_TRACE"]:
        EXTRA_DEFINES["PYOPENCL_TRACE"] = 1

    INCLUDE_DIRS = conf["BOOST_INC_DIR"] + conf["CL_INC_DIR"]

    if conf["CL_ENABLE_GL"]:
        EXTRA_DEFINES["HAVE_GL"] = 1

    if conf["CL_ENABLE_DEVICE_FISSION"]:
        EXTRA_DEFINES["PYOPENCL_USE_DEVICE_FISSION"] = 1
    if conf["CL_PRETEND_VERSION"]:
        try:
            major, minor = [int(x) for x in conf["CL_PRETEND_VERSION"].split(".")]
            EXTRA_DEFINES["PYOPENCL_PRETEND_CL_VERSION"] = 0x1000 * major + 0x10 * minor
        except:
            print("CL_PRETEND_VERSION must be of the form M.N, " "with two integers M and N")
            raise

    ver_dic = {}
    version_file = open("pyopencl/version.py")
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()

    exec(compile(version_file_contents, "pyopencl/version.py", "exec"), ver_dic)

    SEPARATOR = "-" * 75
    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    try:
        import mako  # noqa
    except ImportError:
        print(SEPARATOR)
        print("Mako is not installed.")
        print(SEPARATOR)
        print("That is not a problem, as most of PyOpenCL will be just fine ")
        print("without it.Some higher-level parts of pyopencl (such as ")
        print("pyopencl.reduction) will not function without the templating engine ")
        print("Mako [1] being installed. If you would like this functionality to ")
        print("work, you might want to install Mako after you finish ")
        print("installing PyOpenCL.")
        print("")
        print("[1] http://www.makotemplates.org/")
        print(SEPARATOR)
        print("Hit Ctrl-C now if you'd like to think about the situation.")
        print(SEPARATOR)

        from aksetup_helper import count_down_delay

        count_down_delay(delay=5)

    might_be_cuda = False
    for inc_dir in conf["CL_INC_DIR"]:
        inc_dir = inc_dir.lower()
        if "nv" in inc_dir or "cuda" in inc_dir:
            might_be_cuda = True

    if might_be_cuda and conf["CL_ENABLE_DEVICE_FISSION"]:
        print(SEPARATOR)
        print("You might be compiling against Nvidia CUDA with device " "fission enabled.")
        print(SEPARATOR)
        print("That is not a problem on CUDA 4.0 and newer. If you are " "using CUDA 3.2,")
        print("your build will break, because Nvidia shipped a broken CL header in")
        print("in your version. The fix is to set CL_ENABLE_DEVICE_FISSION to False")
        print("in your PyOpenCL configuration.")
        print(SEPARATOR)
        print("Hit Ctrl-C now if you'd like to think about the situation.")
        print(SEPARATOR)

        from aksetup_helper import count_down_delay

        count_down_delay(delay=5)

    import sys

    if sys.version_info >= (3,):
        pvt_struct_source = "src/wrapper/_pvt_struct_v3.cpp"
    else:
        pvt_struct_source = "src/wrapper/_pvt_struct_v2.cpp"

    setup(
        name="pyopencl",
        # metadata
        version=ver_dic["VERSION_TEXT"],
        description="Python wrapper for OpenCL",
        long_description=open("README.rst", "rt").read(),
        author="Andreas Kloeckner",
        author_email="*****@*****.**",
        license="MIT",
        url="http://mathema.tician.de/software/pyopencl",
        classifiers=[
            "Environment :: Console",
            "Development Status :: 5 - Production/Stable",
            "Intended Audience :: Developers",
            "Intended Audience :: Other Audience",
            "Intended Audience :: Science/Research",
            "License :: OSI Approved :: MIT License",
            "Natural Language :: English",
            "Programming Language :: C++",
            "Programming Language :: Python",
            "Programming Language :: Python :: 2",
            "Programming Language :: Python :: 2.4",
            "Programming Language :: Python :: 2.5",
            "Programming Language :: Python :: 2.6",
            "Programming Language :: Python :: 2.7",
            "Programming Language :: Python :: 3",
            "Programming Language :: Python :: 3.2",
            "Programming Language :: Python :: 3.3",
            "Topic :: Scientific/Engineering",
            "Topic :: Scientific/Engineering :: Mathematics",
            "Topic :: Scientific/Engineering :: Physics",
        ],
        # build info
        packages=["pyopencl", "pyopencl.characterize", "pyopencl.compyte"],
        setup_requires=["numpy"],
        install_requires=[
            "pytools>=2014.2",
            "pytest>=2",
            "decorator>=3.2.0",
            # "Mako>=0.3.6",
        ],
        ext_package="pyopencl",
        ext_modules=[
            NumpyExtension(
                "_cl",
                [
                    "src/wrapper/wrap_cl.cpp",
                    "src/wrapper/wrap_cl_part_1.cpp",
                    "src/wrapper/wrap_cl_part_2.cpp",
                    "src/wrapper/wrap_constants.cpp",
                    "src/wrapper/wrap_mempool.cpp",
                    "src/wrapper/bitlog.cpp",
                ]
                + EXTRA_OBJECTS,
                include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS + conf["CL_LIB_DIR"],
                libraries=LIBRARIES + conf["CL_LIBNAME"],
                define_macros=list(EXTRA_DEFINES.items()),
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
            NumpyExtension(
                "_pvt_struct", [pvt_struct_source], extra_compile_args=conf["CXXFLAGS"], extra_link_args=conf["LDFLAGS"]
            ),
        ],
        include_package_data=True,
        package_data={"pyopencl": ["cl/*.cl", "cl/*.h"]},
        # 2to3 invocation
        cmdclass={"build_py": build_py},
        zip_safe=False,
    )
Example #20
0
def main():
    import glob
    from aksetup_helper import hack_distutils, get_config, setup, \
            PyUblasExtension, NumpyExtension

    hack_distutils()
    conf = get_config(get_config_schema())

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    from os.path import dirname, join, normpath

    if conf["CUDA_ROOT"] is None:
        nvcc_path = search_on_path("nvcc")
        if nvcc_path is None:
            print "*** CUDA_ROOT not set, and nvcc not in path. Giving up."
            import sys
            sys.exit(1)
            
        conf["CUDA_ROOT"] = normpath(join(dirname(nvcc_path), ".."))

    if conf["CUDA_INC_DIR"] is None:
        conf["CUDA_INC_DIR"] = [join(conf["CUDA_ROOT"], "include")]
    if not conf["CUDADRV_LIB_DIR"]:
        conf["CUDADRV_LIB_DIR"] = [join(conf["CUDA_ROOT"], "lib")]

    EXTRA_DEFINES = { }
    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    INCLUDE_DIRS = ['src/cpp'] + conf["BOOST_INC_DIR"] + conf["CUDA_INC_DIR"]
    conf["USE_CUDA"] = True

    import sys

    if 'darwin' in sys.platform:
        # prevent from building ppc since cuda on OS X is not compiled for ppc
        if "-arch" not in conf["CXXFLAGS"]:
            conf["CXXFLAGS"].extend(['-arch', 'i386'])
        if "-arch" not in conf["LDFLAGS"]:
            conf["LDFLAGS"].extend(['-arch', 'i386'])

    setup(name="pycuda",
            # metadata
            version="0.91",
            description="Python wrapper for Nvidia CUDA",
            long_description="""
            PyCuda lets you access `Nvidia <http://nvidia.com>`_'s `CUDA
            <http://nvidia.com/cuda/>`_ parallel computation API from Python.
            Several wrappers of the CUDA API already exist-so what's so special
            about PyCuda?

            * Object cleanup tied to lifetime of objects. This idiom, often
              called
              `RAII <http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>`_
              in C++, makes it much easier to write correct, leak- and
              crash-free code. PyCuda knows about dependencies, too, so (for
              example) it won't detach from a context before all memory
              allocated in it is also freed.

            * Convenience. Abstractions like pycuda.driver.SourceModule and
              pycuda.gpuarray.GPUArray make CUDA programming even more
              convenient than with Nvidia's C-based runtime.

            * Completeness. PyCuda puts the full power of CUDA's driver API at
              your disposal, if you wish.

            * Automatic Error Checking. All CUDA errors are automatically
              translated into Python exceptions.

            * Speed. PyCuda's base layer is written in C++, so all the niceties
              above are virtually free.

            * Helpful `Documentation <http://tiker.net/doc/pycuda>`_.
            """,
            author=u"Andreas Kloeckner",
            author_email="*****@*****.**",
            license = "MIT",
            url="http://mathema.tician.de/software/pycuda",
            classifiers=[
              'Environment :: Console',
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: MIT License',
              'Natural Language :: English',
              'Programming Language :: C++',
              'Programming Language :: Python',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Physics',
              'Topic :: Scientific/Engineering :: Visualization',
              ],

            # build info
            packages=["pycuda"],
            zip_safe=False,

            install_requires=[
                "pytools>=3",
                ],

            package_dir={"pycuda": "src/python"},
            ext_package="pycuda",

            ext_modules=[
                NumpyExtension("_driver", 
                    [
                        "src/cpp/cuda.cpp", 
                        "src/wrapper/wrap_cudadrv.cpp", 
                        "src/wrapper/tools.cpp", 
                        ],
                    include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                    library_dirs=LIBRARY_DIRS + conf["CUDADRV_LIB_DIR"],
                    libraries=LIBRARIES + conf["CUDADRV_LIBNAME"],
                    define_macros=list(EXTRA_DEFINES.iteritems()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                ]
            )
Example #21
0
def main():
    from setuptools import find_packages
    from aksetup_helper import (hack_distutils, get_config, setup,
            check_pybind11, check_git_submodules, ExtensionUsingNumpy,
            get_pybind_include, PybindBuildExtCommand)
    check_pybind11()
    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema(),
            warn_about_no_config=False)

    extra_defines = {}

    extra_defines["PYGPU_PACKAGE"] = "pyopencl"
    extra_defines["PYGPU_PYOPENCL"] = "1"

    if conf["CL_TRACE"]:
        extra_defines["PYOPENCL_TRACE"] = 1

    if conf["CL_ENABLE_GL"]:
        extra_defines["HAVE_GL"] = 1

    if conf["CL_USE_SHIPPED_EXT"]:
        extra_defines["PYOPENCL_USE_SHIPPED_EXT"] = 1

    if conf["CL_PRETEND_VERSION"]:
        try:
            major, minor = [int(x) for x in conf["CL_PRETEND_VERSION"].split(".")]
            extra_defines["PYOPENCL_PRETEND_CL_VERSION"] = \
                    0x1000*major + 0x10 * minor
        except Exception:
            print("CL_PRETEND_VERSION must be of the form M.N, "
                    "with two integers M and N")
            raise

    conf["EXTRA_DEFINES"] = extra_defines

    INCLUDE_DIRS = conf["CL_INC_DIR"] + ["pybind11/include"]  # noqa: N806

    ver_dic = {}
    version_file = open("pyopencl/version.py")
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()

    exec(compile(version_file_contents, "pyopencl/version.py", 'exec'), ver_dic)

    try:
        import mako  # noqa
    except ImportError:
        print(SEPARATOR)
        print("Mako is not installed.")
        print(SEPARATOR)
        print("That is not a problem, as most of PyOpenCL will be just fine ")
        print("without it. Some higher-level parts of pyopencl (such as ")
        print("pyopencl.reduction) will not function without the templating engine ")
        print("Mako [1] being installed. If you would like this functionality to ")
        print("work, you might want to install Mako after you finish ")
        print("installing PyOpenCL.")
        print("")
        print("Simply type")
        print("python -m pip install mako")
        print("either now or after the installation completes to fix this.")
        print("")
        print("[1] http://www.makotemplates.org/")
        print(SEPARATOR)
        print("Hit Ctrl-C now if you'd like to think about the situation.")
        print(SEPARATOR)

        from aksetup_helper import count_down_delay
        count_down_delay(delay=5)

    if not exists("pyopencl/compyte/dtypes.py"):
        print(75 * "-")
        print("You are missing important files from the pyopencl distribution.")
        print(75 * "-")
        print("You may have downloaded a zip or tar file from Github.")
        print("Those do not work, and I am unable to prevent Github from showing")
        print("them. Delete that file, and get an actual release file from the")
        print("Python package index:")
        print()
        print("https://pypi.python.org/pypi/pyopencl")
        sys.exit(1)

    setup(name="pyopencl",
            # metadata
            version=ver_dic["VERSION_TEXT"],
            description="Python wrapper for OpenCL",
            long_description=open("README.rst", "rt").read(),
            author="Andreas Kloeckner",
            author_email="*****@*****.**",
            license="MIT",
            url="http://mathema.tician.de/software/pyopencl",
            classifiers=[
                'Environment :: Console',
                'Development Status :: 5 - Production/Stable',
                'Intended Audience :: Developers',
                'Intended Audience :: Other Audience',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: MIT License',
                'Natural Language :: English',
                'Programming Language :: C++',
                'Programming Language :: Python',
                'Programming Language :: Python :: 2',
                'Programming Language :: Python :: 2.7',
                'Programming Language :: Python :: 3',
                'Programming Language :: Python :: 3.2',
                'Programming Language :: Python :: 3.3',
                'Topic :: Scientific/Engineering',
                'Topic :: Scientific/Engineering :: Mathematics',
                'Topic :: Scientific/Engineering :: Physics',
                ],

            # build info
            packages=find_packages(),

            ext_modules=[
                ExtensionUsingNumpy("pyopencl._cl",
                    [
                        "src/wrap_constants.cpp",
                        "src/wrap_cl.cpp",
                        "src/wrap_cl_part_1.cpp",
                        "src/wrap_cl_part_2.cpp",
                        "src/wrap_mempool.cpp",
                        "src/bitlog.cpp",
                        ],
                    include_dirs=INCLUDE_DIRS + [
                        get_pybind_include(),
                        get_pybind_include(user=True)
                        ],
                    library_dirs=conf["CL_LIB_DIR"],
                    libraries=conf["CL_LIBNAME"],
                    define_macros=list(conf["EXTRA_DEFINES"].items()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    language='c++',
                    ),
                ],

            setup_requires=[
                "pybind11",
                "numpy",
                ],

            install_requires=[
                "numpy",
                "pytools>=2017.6",
                "decorator>=3.2.0",
                "appdirs>=1.4.0",
                "six>=1.9.0",
                # "Mako>=0.3.6",
                ],
            extras_require={
                'pocl':  ["pocl_binary_distribution>=1.2"],
                'oclgrind':  ["oclgrind_binary_distribution>=18.3"],
            },
            include_package_data=True,
            package_data={
                    "pyopencl": [
                        "cl/*.cl",
                        "cl/*.h",
                        "cl/pyopencl-random123/*.cl",
                        "cl/pyopencl-random123/*.h",
                        ]
                    },

            cmdclass={'build_ext': PybindBuildExtCommand},
            zip_safe=False)
Example #22
0
def main():
    import sys

    from aksetup_helper import (hack_distutils, get_config, setup,
            NumpyExtension, set_up_shipped_boost_if_requested,
            check_git_submodules)

    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema())

    EXTRA_SOURCES, EXTRA_DEFINES = set_up_shipped_boost_if_requested("pycuda", conf)

    EXTRA_DEFINES["PYGPU_PACKAGE"] = "pycuda"
    EXTRA_DEFINES["PYGPU_PYCUDA"] = "1"

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"] + conf["CUDADRV_LIB_DIR"]
    LIBRARIES = (conf["BOOST_PYTHON_LIBNAME"] + conf["BOOST_THREAD_LIBNAME"]
            + conf["CUDADRV_LIBNAME"])

    if not conf["CUDA_INC_DIR"] and conf["CUDA_ROOT"]:
        conf["CUDA_INC_DIR"] = [join(conf["CUDA_ROOT"], "include")]

    if conf["CUDA_TRACE"]:
        EXTRA_DEFINES["CUDAPP_TRACE_CUDA"] = 1

    if conf["CUDA_PRETEND_VERSION"]:
        EXTRA_DEFINES["CUDAPP_PRETEND_CUDA_VERSION"] = conf["CUDA_PRETEND_VERSION"]

    INCLUDE_DIRS = ['src/cpp'] + conf["BOOST_INC_DIR"]
    if conf["CUDA_INC_DIR"]:
        INCLUDE_DIRS += conf["CUDA_INC_DIR"]

    conf["USE_CUDA"] = True

    if 'darwin' in sys.platform and sys.maxsize == 2147483647:
        # The Python interpreter is running in 32 bit mode on OS X
        if "-arch" not in conf["CXXFLAGS"]:
            conf["CXXFLAGS"].extend(['-arch', 'i386', '-m32'])
        if "-arch" not in conf["LDFLAGS"]:
            conf["LDFLAGS"].extend(['-arch', 'i386', '-m32'])

    if 'darwin' in sys.platform:
        # set path to Cuda dynamic libraries,
        # as a safe substitute for DYLD_LIBRARY_PATH
        for lib_dir in conf["CUDADRV_LIB_DIR"]:
            conf["LDFLAGS"].extend(["-Xlinker", "-rpath", "-Xlinker", lib_dir])

    if conf["CUDA_ENABLE_GL"]:
        EXTRA_SOURCES.append("src/wrapper/wrap_cudagl.cpp")
        EXTRA_DEFINES["HAVE_GL"] = 1

    if conf["CUDA_ENABLE_CURAND"]:
        EXTRA_DEFINES["HAVE_CURAND"] = 1
        EXTRA_SOURCES.extend([
            "src/wrapper/wrap_curand.cpp"
            ])
        LIBRARIES.extend(conf["CURAND_LIBNAME"])
        LIBRARY_DIRS.extend(conf["CURAND_LIB_DIR"])

    ver_dic = {}
    exec(compile(open("pycuda/__init__.py").read(), "pycuda/__init__.py", 'exec'),
            ver_dic)

    import sys
    if sys.version_info >= (3,):
        pvt_struct_source = "src/wrapper/_pvt_struct_v3.cpp"
    else:
        pvt_struct_source = "src/wrapper/_pvt_struct_v2.cpp"

    setup(name="pycuda",
            # metadata
            version=ver_dic["VERSION_TEXT"],
            description="Python wrapper for Nvidia CUDA",
            long_description=open("README.rst", "rt").read(),
            author="Andreas Kloeckner",
            author_email="*****@*****.**",
            license="MIT",
            url="http://mathema.tician.de/software/pycuda",
            classifiers=[
                'Environment :: Console',
                'Development Status :: 5 - Production/Stable',
                'Intended Audience :: Developers',
                'Intended Audience :: Other Audience',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: MIT License',
                'Natural Language :: English',
                'Programming Language :: C++',
                'Programming Language :: Python',
                'Programming Language :: Python :: 3',
                'Programming Language :: Python :: 2.6',
                'Programming Language :: Python :: 2.7',
                'Programming Language :: Python :: 3.3',
                'Programming Language :: Python :: 3.4',
                'Topic :: Scientific/Engineering',
                'Topic :: Scientific/Engineering :: Mathematics',
                'Topic :: Scientific/Engineering :: Physics',
                'Topic :: Scientific/Engineering :: Visualization',
                ],

            # build info
            packages=["pycuda", "pycuda.gl", "pycuda.sparse", "pycuda.compyte"],

            setup_requires=[
                "numpy>=1.6",
                ],

            install_requires=[
                "pytools>=2011.2",
                "pytest>=2",
                "decorator>=3.2.0",
                "appdirs>=1.4.0",
                "mako",
                ],

            ext_package="pycuda",
            ext_modules=[
                NumpyExtension("_driver",
                    [
                        "src/cpp/cuda.cpp",
                        "src/cpp/bitlog.cpp",
                        "src/wrapper/wrap_cudadrv.cpp",
                        "src/wrapper/mempool.cpp",
                        ]+EXTRA_SOURCES,
                    include_dirs=INCLUDE_DIRS,
                    library_dirs=LIBRARY_DIRS,
                    libraries=LIBRARIES,
                    define_macros=list(EXTRA_DEFINES.items()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                NumpyExtension("_pvt_struct",
                    [pvt_struct_source],
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                ],

            include_package_data=True,
            package_data={
                    "pycuda": [
                        "cuda/*.hpp",
                        ]
                    },

            zip_safe=False)
Example #23
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup, NumpyExtension

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = ["pyublas/include"] + conf["BOOST_INC_DIR"]
    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_DEFINES = {}

    if conf["USE_ITERATORS"]:
        EXTRA_DEFINES["BOOST_UBLAS_USE_ITERATING"] = 1

    ext_src = ["src/wrapper/main.cpp", "src/wrapper/converters.cpp"]

    if conf["WITH_SPARSE_WRAPPERS"]:
        ext_src += ["src/wrapper/sparse_build.cpp", "src/wrapper/sparse_execute.cpp"]
        EXTRA_DEFINES["HAVE_SPARSE_WRAPPERS"] = 1

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    setup(
        name="PyUblas",
        version="2013.1",
        description="Seamless Numpy-UBlas interoperability",
        long_description=open("README.rst", "rt").read(),
        author="Andreas Kloeckner",
        author_email="*****@*****.**",
        license="BSD",
        url="http://mathema.tician.de/software/pyublas",
        classifiers=[
            "Development Status :: 4 - Beta",
            "Environment :: Console",
            "Intended Audience :: Developers",
            "Intended Audience :: Science/Research",
            "License :: OSI Approved :: BSD License",
            "Operating System :: MacOS :: MacOS X",
            "Operating System :: POSIX",
            "Programming Language :: Python",
            "Programming Language :: Python :: 2",
            "Programming Language :: Python :: 2.4",
            "Programming Language :: Python :: 2.5",
            "Programming Language :: Python :: 2.6",
            "Programming Language :: Python :: 2.7",
            "Programming Language :: Python :: 3",
            "Programming Language :: Python :: 3.2",
            "Programming Language :: Python :: 3.3",
            "Programming Language :: C++",
            "Topic :: Scientific/Engineering",
            "Topic :: Scientific/Engineering :: Mathematics",
            "Topic :: Office/Business",
            "Topic :: Utilities",
        ],
        # numpy is often under the setuptools radar.
        # setup_requires=[
        # "numpy>=1.0.4",
        # ],
        install_requires=[
            # "numpy>=1.0.4",
            "pytest>=2"
        ],
        packages=["pyublas"],
        ext_package="pyublas",
        ext_modules=[
            NumpyExtension(
                "_internal",
                ext_src,
                include_dirs=INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS,
                libraries=LIBRARIES,
                define_macros=list(EXTRA_DEFINES.items()),
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
            NumpyExtension(
                "testhelp_ext",
                ["src/test/testhelp_ext.cpp"],
                include_dirs=INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS,
                libraries=LIBRARIES,
                define_macros=list(EXTRA_DEFINES.items()),
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
        ],
        include_package_data=True,
        package_data={"pyublas": ["include/pyublas/*.hpp"]},
        zip_safe=False,
        # 2to3 invocation
        cmdclass={"build_py": build_py},
    )
Example #24
0
def main():
    from setuptools import find_packages
    from aksetup_helper import (hack_distutils, get_config, setup,
            check_git_submodules)
    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema(),
            warn_about_no_config=False)

    extra_defines = {}

    extra_defines["PYGPU_PACKAGE"] = "pyopencl"
    extra_defines["PYGPU_PYOPENCL"] = "1"

    if conf["CL_TRACE"]:
        extra_defines["PYOPENCL_TRACE"] = 1

    if conf["CL_ENABLE_GL"]:
        extra_defines["HAVE_GL"] = 1

    if conf["CL_USE_SHIPPED_EXT"]:
        extra_defines["PYOPENCL_USE_SHIPPED_EXT"] = 1

    if conf["CL_PRETEND_VERSION"]:
        try:
            major, minor = [int(x) for x in conf["CL_PRETEND_VERSION"].split(".")]
            extra_defines["PYOPENCL_PRETEND_CL_VERSION"] = \
                    0x1000*major + 0x10 * minor
        except:
            print("CL_PRETEND_VERSION must be of the form M.N, "
                    "with two integers M and N")
            raise

    conf["EXTRA_DEFINES"] = extra_defines

    ver_dic = {}
    version_file = open("pyopencl/version.py")
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()

    exec(compile(version_file_contents, "pyopencl/version.py", 'exec'), ver_dic)

    separator = "-"*75

    try:
        import mako  # noqa
    except ImportError:
        print(separator)
        print("Mako is not installed.")
        print(separator)
        print("That is not a problem, as most of PyOpenCL will be just fine ")
        print("without it. Some higher-level parts of pyopencl (such as ")
        print("pyopencl.reduction) will not function without the templating engine ")
        print("Mako [1] being installed. If you would like this functionality to ")
        print("work, you might want to install Mako after you finish ")
        print("installing PyOpenCL.")
        print("")
        print("Simply type")
        print("python -m pip install mako")
        print("either now or after the installation completes to fix this.")
        print("")
        print("[1] http://www.makotemplates.org/")
        print(separator)
        print("Hit Ctrl-C now if you'd like to think about the situation.")
        print(separator)

        from aksetup_helper import count_down_delay
        count_down_delay(delay=5)

    # {{{ write cffi build script

    with open("cffi_build.py.in", "rt") as f:
        build_script_template = f.read()

    format_args = {}
    for k, v in conf.items():
        format_args[k] = repr(v)

    build_script = build_script_template.format(**format_args)

    with open("cffi_build.py", "wt") as f:
        f.write(build_script)

    # }}}

    setup(name="pyopencl",
            # metadata
            version=ver_dic["VERSION_TEXT"],
            description="Python wrapper for OpenCL",
            long_description=open("README.rst", "rt").read(),
            author="Andreas Kloeckner",
            author_email="*****@*****.**",
            license="MIT",
            url="http://mathema.tician.de/software/pyopencl",
            classifiers=[
                'Environment :: Console',
                'Development Status :: 5 - Production/Stable',
                'Intended Audience :: Developers',
                'Intended Audience :: Other Audience',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: MIT License',
                'Natural Language :: English',
                'Programming Language :: C++',
                'Programming Language :: Python',
                'Programming Language :: Python :: 2',
                'Programming Language :: Python :: 2.6',
                'Programming Language :: Python :: 2.7',
                'Programming Language :: Python :: 3',
                'Programming Language :: Python :: 3.2',
                'Programming Language :: Python :: 3.3',
                'Topic :: Scientific/Engineering',
                'Topic :: Scientific/Engineering :: Mathematics',
                'Topic :: Scientific/Engineering :: Physics',
                ],

            # build info
            packages=find_packages(),

            setup_requires=[
                "numpy",
                "cffi>=1.1.0",
                ],

            install_requires=[
                "numpy",
                "pytools>=2017.2",
                "pytest>=2",
                "decorator>=3.2.0",
                "cffi>=1.1.0",
                "appdirs>=1.4.0",
                "six>=1.9.0",
                # "Mako>=0.3.6",
                ],

            cffi_modules=["cffi_build.py:ffi"],

            include_package_data=True,
            package_data={
                    "pyopencl": [
                        "cl/*.cl",
                        "cl/*.h",
                        "cl/pyopencl-random123/*.cl",
                        "cl/pyopencl-random123/*.h",
                        ]
                    },

            zip_safe=False)
Example #25
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup, NumpyExtension
    from setuptools import find_packages
    import sys

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = [
        'c++',
        os.path.join('c++', 'include'),
        os.path.join('c++', 'hmm', 'myrrh'),
        os.path.join('c++', 'hmm'),
        os.path.join('c++', 'indexing_suite_v2'),
        os.path.join('c++', 'FAST'),
        os.path.join(conf['SEQAN_DIR'], 'include'),
    ] + conf['BOOST_INC_DIR']
    LIBRARY_DIRS = conf['BOOST_LIB_DIR']
    LIBRARIES = conf['BOOST_PYTHON_LIBNAME'] + ['fftw3']
    CXXFLAGS = conf['CXXFLAGS']
    LDFLAGS = conf['LDFLAGS']
    EXTRA_DEFINES = [
        ("SEQAN_ENABLE_TESTING"  , "0"),
        ("SEQAN_ENABLE_DEBUG"    , "0"),
        ("BOOST_DISABLE_ASSERTS" , None),
        ("MYRRH_DISABLE_ASSERTS" , None),
        ("PVAL_LOOKUP"           , None),
        ("NDEBUG"                , None),
    ]

    # need to link against librt otherwise get an undefined aio_cancel
    # error or somesuch.
    if 'linux' in sys.platform:
        LIBRARIES.append('rt')

    # want to add these options to all GCC builds
    if 'linux' in sys.platform or 'darwin' in sys.platform:
        CXXFLAGS += [
            "-Wno-unused",
            "-Wno-deprecated",
            "-Wno-long-long",
            "-Wno-variadic-macros",
            "-Wno-sequence-point",
            "-Wno-uninitialized",
            "-finline-functions",
            "-ftemplate-depth-128",
        ]

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    #
    # C++ extensions
    #
    lib_srcs = [
        'c++/hmm/myrrh/src/python/multi_array_to_numpy.cpp',
        'c++/FAST/HS.cpp',
        'c++/FAST/motif_evaluator.cpp',
        'c++/FAST/theta_fns.cpp',
        'c++/FAST/minimize.cpp',
        'c++/FAST/convolution.cpp',
        'c++/FAST/fft.cpp',
        'c++/FAST/utils.cpp',
        'c++/FAST/llr_score.cpp',
        'c++/pvalues/parse.cpp',
        'c++/pvalues/bejerano.cpp',
        'c++/pvalues/fast.cpp',
        'c++/pvalues/shifted_hirji.cpp',
        'c++/pvalues/pval.cpp',
        'c++/pvalues/pvalue_test_defs.cpp',
        'c++/python/steme.cpp',
    ]
    module_stempy_srcs = [
        'c++/python/module_stempy.cpp',
        'c++/python/python_bs.cpp',
        'c++/python/python_llr_pvalues.cpp',
        'c++/python/python_utility.cpp',
    ]
    module_index_srcs = [
        'c++/python/module_index.cpp',
        'c++/python/python_descender.cpp',
        'c++/python/python_bg.cpp',
        'c++/python/python_data.cpp',
        'c++/python/python_em.cpp',
        'c++/python/python_find_best_w_mers.cpp',
        'c++/python/python_find_instances.cpp',
        'c++/python/python_markov.cpp',
        'c++/python/python_model.cpp',
        'c++/python/python_seqan.cpp',
        'c++/python/python_significance.cpp',
        'c++/python/python_start_finder.cpp',
    ]
    cStempy = NumpyExtension(
        'stempy._%s_build._stempy' % _build,
        lib_srcs + module_stempy_srcs,
        include_dirs         = INCLUDE_DIRS,
        library_dirs         = LIBRARY_DIRS,
        libraries            = LIBRARIES,
        define_macros        = EXTRA_DEFINES,
        extra_compile_args   = CXXFLAGS,
        extra_link_args      = LDFLAGS,
    )
    cIndex = NumpyExtension(
        'stempy._%s_build._index' % _build,
        module_index_srcs,
        include_dirs         = INCLUDE_DIRS,
        library_dirs         = LIBRARY_DIRS,
        libraries            = LIBRARIES,
        define_macros        = EXTRA_DEFINES + [('STEME_INDEX_MODULE_NAME', '_index')],
        extra_compile_args   = CXXFLAGS,
        extra_link_args      = LDFLAGS,
    )
    cIndexGenome = NumpyExtension(
        'stempy._%s_build._index_genome' % _build,
        module_index_srcs,
        include_dirs         = INCLUDE_DIRS,
        library_dirs         = LIBRARY_DIRS,
        libraries            = LIBRARIES,
        define_macros        = EXTRA_DEFINES + [('STEME_INDEX_MODULE_NAME', '_index_genome'), ('STEME_INDEX_MODULE_TYPE', 1)],
        extra_compile_args   = CXXFLAGS,
        extra_link_args      = LDFLAGS,
    )

    setup(
        name                  = 'STEME',
        zip_safe              = False,
        version               = read('python', 'stempy', 'VERSION').strip().split('-')[0],
        description           = 'STEME: an accurate efficient motif finder for large data sets.',
        long_description      = read('python', 'stempy', 'README'),
        author                ='John Reid',
        author_email          ='*****@*****.**',
        license               = 'BSD',
        url                   ='http://sysbio.mrc-bsu.cam.ac.uk/johns/STEME/',
        classifiers           = [
                                    'Development Status :: 5 - Production/Stable',
                                    'Environment :: Console',
                                    'Intended Audience :: Developers',
                                    'Intended Audience :: Science/Research',
                                    'License :: OSI Approved :: BSD License',
                                    'Operating System :: MacOS :: MacOS X',
                                    'Operating System :: POSIX',
                                    'Operating System :: Microsoft :: Windows',
                                    'Programming Language :: Python',
                                    'Programming Language :: C++',
                                    'Topic :: Scientific/Engineering',
                                    'Topic :: Scientific/Engineering :: Mathematics',
                                    'Topic :: Scientific/Engineering :: Bio-Informatics',
                                    'Topic :: Utilities',
                                ],

        packages              = find_packages(where='python'),
        package_dir           = { '' : 'python' },
        package_data          = {
                                    'stempy': [
                                        'README',
                                        'LICENSE',
                                        'VERSION',
                                        'static/style.css',
                                        'templates/job.html',
                                        'templates/layout.html',
                                        'templates/motif.html',
                                        'templates/motifs.html',
                                        'templates/options.html',
                                        'templates/scan-stats.html',
                                        'templates/spacing.html',
                                        'templates/wide-layout.html',
                                    ],
                                    'stemewebapp': [
                                        'STEME.wsgi',
                                        'INSTALL',
                                        'VERSION',
                                        'static/style.css',
                                        'static/logo.png',
                                        'static/logo.svg',
                                        'templates/_formhelpers.html',
                                        'templates/home.html',
                                        'templates/layout.html',
                                        'templates/listjobs.html',
                                        'templates/newjob.html',
                                    ],
                                },
        include_package_data  = True,
        install_requires      = ['cookbook', 'numpy', 'matplotlib', 'weblogo'],
        scripts               = [
                                    'python/scripts/steme',
                                    'python/scripts/steme-em',
                                    'python/scripts/steme-find-spacings',
                                    'python/scripts/steme-motif-logos',
                                    'python/scripts/steme-mutate-motifs',
                                    'python/scripts/steme-pwm-scan',
                                    'python/scripts/steme-scan-stats',
                                    'python/scripts/steme-seqs-2-motif',
                                    'python/scripts/steme-spacing-analysis',
                                    'python/scripts/stemewebapp-create-db',
                                    'python/scripts/stemewebapp-remove-job',
                                ],
        ext_modules           = [cStempy, cIndex, cIndexGenome],

        # 2to3 invocation
        cmdclass              = {'build_py': build_py},
    )
Example #26
0
def main():
    import glob
    from aksetup_helper import hack_distutils, get_config, setup, Extension

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = conf["TAGLIB_INC_DIR"] + conf["BOOST_INC_DIR"]
    LIBRARY_DIRS = conf["TAGLIB_LIB_DIR"] + conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["TAGLIB_LIBNAME"] + conf["BOOST_PYTHON_LIBNAME"]

    setup(name="tagpy",
          version="0.94.8",
          description="Python Bindings for TagLib",
          long_description="""
          TagPy is a set of Python bindings for Scott Wheeler's 
          `TagLib <http://developer.kde.org/~wheeler/taglib.html>`_. 
          It builds upon `Boost.Python <http://www.boost.org/libs/python/doc/>`_, 
          a wrapper generation library which is part of the renowned Boost 
          set of C++ libraries.

          Just like TagLib, TagPy can:

          * read and write ID3 tags of version 1 and 2, with many supported frame types
            for version 2 (in MPEG Layer 2 and MPEG Layer 3, FLAC and MPC),
          * access Xiph Comments in Ogg Vorbis Files and Ogg Flac Files,
          * access APE tags in Musepack and MP3 files.

          All these features have their own specific interfaces, but 
          TagLib's generic tag reading and writing mechanism is also 
          supported. It comes with a bunch of examples.
          """,
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          classifiers=[
              "Development Status :: 5 - Production/Stable",
              "Intended Audience :: Developers",
              "License :: OSI Approved :: MIT License",
              "Natural Language :: English",
              "Operating System :: OS Independent",
              "Operating System :: POSIX", "Operating System :: Unix",
              "Programming Language :: Python",
              "Topic :: Multimedia :: Sound/Audio",
              "Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping",
              "Topic :: Multimedia :: Sound/Audio :: Editors",
              "Topic :: Software Development :: Libraries :: Python Modules",
              "Topic :: Utilities"
          ],
          license="MIT",
          url="http://mathema.tician.de/software/tagpy",
          packages=["tagpy", "tagpy.ogg"],
          ext_modules=[
              Extension(
                  "_tagpy",
                  [
                      "src/wrapper/basics.cpp", "src/wrapper/id3.cpp",
                      "src/wrapper/rest.cpp"
                  ],
                  include_dirs=INCLUDE_DIRS,
                  library_dirs=LIBRARY_DIRS,
                  libraries=LIBRARIES,
                  extra_compile_args=conf["CXXFLAGS"],
              ),
          ])
Example #27
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup
    from setuptools import find_packages, Extension

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = (
        [
            "c++",
            os.path.join("c++", "include"),
            os.path.join("c++", "boost-indexing-suite"),
            os.path.join("c++", "myrrh"),
        ]
        + conf["BOOST_INC_DIR"]
        + [os.path.join(conf["SEQAN_DIR"], "include")]
    )
    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]
    EXTRA_DEFINES = {
        "SEQAN_ENABLE_TESTING": "0",
        "SEQAN_ENABLE_DEBUG": "0",
        "BOOST_DISABLE_ASSERTS": "0",
        "MYRRH_DISABLE_ASSERTS": "0",
    }

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    #
    # C++ extension
    #
    seqanext = Extension(
        "seqan._release_build._seqan",
        [
            "c++/src/expose_indexes.cpp",
            "c++/src/expose_simple_types.cpp",
            "c++/src/expose_strings.cpp",
            "c++/src/module_pyseqan.cpp",
        ],
        include_dirs=INCLUDE_DIRS,
        library_dirs=LIBRARY_DIRS,
        libraries=LIBRARIES + ["rt"],
        define_macros=list(EXTRA_DEFINES.items()),
        extra_compile_args=["-std=c++0x", "-Wno-deprecated-declarations"] + conf["CXXFLAGS"],
        extra_link_args=conf["LDFLAGS"],
    )

    #
    # Main setup
    #
    setup(
        name="pyseqan",
        version=read("python", "seqan", "VERSION").strip().split("-")[0],
        description="pyseqan: A package to expose SeqAn suffix array functionality.",
        long_description=read("python", "seqan", "README"),
        author="John Reid",
        author_email="*****@*****.**",
        license="BSD",
        url="http://sysbio.mrc-bsu.cam.ac.uk/johns/pyseqan/docs/build/html/index.html",
        classifiers=[
            "Development Status :: 5 - Production/Stable",
            "Environment :: Console",
            "Intended Audience :: Developers",
            "Intended Audience :: Science/Research",
            "License :: OSI Approved :: BSD License",
            "Operating System :: MacOS :: MacOS X",
            "Operating System :: POSIX",
            "Operating System :: Microsoft :: Windows",
            "Programming Language :: Python",
            "Programming Language :: C++",
            "Topic :: Scientific/Engineering",
            "Topic :: Scientific/Engineering :: Mathematics",
            "Topic :: Scientific/Engineering :: Bio-Informatics",
            "Topic :: Utilities",
        ],
        packages=find_packages(where="python"),
        package_dir={"": "python"},
        # py_modules           = ['pybool.examples.tutorial']
        package_data={"seqan": ["README", "LICENSE", "VERSION"]},
        install_requires=["cookbook"],
        # scripts              = ['python/scripts/pybool-find-consistent'],
        ext_modules=[seqanext],
        # 2to3 invocation
        cmdclass={"build_py": build_py},
        include_package_data=False,
    )
Example #28
0
def main():
    from setuptools import find_packages
    from aksetup_helper import hack_distutils, get_config, setup, \
            PyUblasExtension

    hack_distutils()
    conf = get_config(get_config_schema(),
            warn_about_no_config=False)

    INCLUDE_DIRS = conf["BOOST_INC_DIR"]  # noqa

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]  # noqa
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]  # noqa

    EXTRA_DEFINES = {}  # noqa
    EXTRA_INCLUDE_DIRS = []  # noqa
    EXTRA_LIBRARY_DIRS = []  # noqa
    EXTRA_LIBRARIES = []  # noqa

    ver_dic = {}
    ver_file_name = "pyvisfile/__init__.py"
    with open(ver_file_name, "r") as inf:
        exec(compile(inf.read(), ver_file_name, 'exec'), ver_dic)

    requirements = []
    ext_modules = []

    if conf["USE_SILO"]:
        EXTRA_DEFINES["USE_SILO"] = 1
        EXTRA_INCLUDE_DIRS.extend(conf["SILO_INC_DIR"])
        EXTRA_LIBRARY_DIRS.extend(conf["SILO_LIB_DIR"])
        EXTRA_LIBRARIES.extend(conf["SILO_LIBNAME"])

        ext_modules.append(PyUblasExtension("_internal",
            ["src/wrapper/wrap_silo.cpp"],
            include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
            library_dirs=LIBRARY_DIRS + EXTRA_LIBRARY_DIRS,
            libraries=LIBRARIES + EXTRA_LIBRARIES,
            extra_compile_args=conf["CXXFLAGS"],
            define_macros=list(EXTRA_DEFINES.items()),
            ))

    setup(name="pyvisfile",
            version=ver_dic["VERSION_TEXT"],
            description="Large-scale Visualization Data Storage",
            long_description=open("README.rst", "rt").read(),
            classifiers=[
                'Development Status :: 4 - Beta',
                'Intended Audience :: Developers',
                'Intended Audience :: Other Audience',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: MIT License',
                'Natural Language :: English',
                'Programming Language :: C++',
                'Programming Language :: Python',
                'Programming Language :: Python :: 3',
                'Topic :: Multimedia :: Graphics :: 3D Modeling',
                'Topic :: Scientific/Engineering',
                'Topic :: Scientific/Engineering :: Mathematics',
                'Topic :: Scientific/Engineering :: Physics',
                'Topic :: Scientific/Engineering :: Visualization',
                'Topic :: Software Development :: Libraries',
                ],

            author=u"Andreas Kloeckner",
            author_email="*****@*****.**",
            license="MIT",
            url="http://mathema.tician.de/software/pyvisfile",

            # dependencies
            setup_requires=requirements,
            python_requires="~=3.6",
            install_requires=[
                    "pytools>=2013.2",
                    "six",
                    ] + requirements,

            packages=find_packages(),
            ext_package="pyvisfile.silo",
            ext_modules=ext_modules,

            zip_safe=False)
Example #29
0
def main():
    from aksetup_helper import (hack_distutils, get_config, setup,
                                check_git_submodules)

    check_git_submodules()

    hack_distutils(what_opt=None)
    conf = get_config(get_config_schema(), warn_about_no_config=False)

    EXTRA_SOURCES = []  # noqa
    EXTRA_DEFINES = {}  # noqa
    INCLUDE_DIRS = []  # noqa
    LIBRARY_DIRS = []  # noqa
    LIBRARIES = []  # noqa
    CXXFLAGS = conf["CXXFLAGS"]

    if conf["USE_SHIPPED_ISL"]:
        from glob import glob
        isl_blacklist = [
            "_templ.c",
            "mp_get",
            "isl_multi_templ.c",
            "isl_multi_apply_set.c",
            "isl_multi_gist.c",
            "isl_multi_coalesce.c",
            "isl_multi_intersect.c",
            "isl_multi_floor.c",
            "isl_multi_apply_union_set.c",
            "isl_multi_cmp.c",
            "isl_multi_hash.c",
            "isl_union_templ.c",
            "isl_union_multi.c",
            "isl_union_eval.c",
            "isl_union_neg.c",
            "isl_union_single.c",
            "isl_pw_hash.c",
            "isl_pw_union_opt.c",
        ]

        for fn in glob("isl/*.c"):
            blacklisted = False
            for bl in isl_blacklist:
                if bl in fn:
                    blacklisted = True
                    break

            if "no_piplib" in fn:
                pass
            elif "piplib" in fn:
                blacklisted = True

            if "gmp" in fn:
                if conf["USE_SHIPPED_IMATH"]:
                    continue
            if "imath" in fn:
                if not conf["USE_SHIPPED_IMATH"]:
                    continue

                if "sioimath" in fn and not conf["USE_IMATH_SIO"]:
                    continue
                if "isl_val_imath" in fn and conf["USE_IMATH_SIO"]:
                    continue

            if "isl_ast_int.c" in fn and conf["USE_SHIPPED_IMATH"]:
                continue

            inf = open(fn, "r", encoding="utf-8")
            try:
                contents = inf.read()
            finally:
                inf.close()

            if "int main(" not in contents and not blacklisted:
                EXTRA_SOURCES.append(fn)

        conf["ISL_INC_DIR"] = ["isl-supplementary", "isl/include", "isl"]

        if conf["USE_SHIPPED_IMATH"]:
            EXTRA_SOURCES.extend([
                "isl/imath/imath.c",
                "isl/imath/imrat.c",
                "isl/imath/gmp_compat.c",
                "isl/imath_wrap/imath.c",
                "isl/imath_wrap/imrat.c",
                "isl/imath_wrap/gmp_compat.c",
            ])
            EXTRA_DEFINES["USE_IMATH_FOR_MP"] = 1
            if conf["USE_IMATH_SIO"]:
                EXTRA_DEFINES["USE_SMALL_INT_OPT"] = 1

                import sys
                if sys.platform in ['linux', 'linux2', 'darwin']:
                    CXXFLAGS.insert(0, "-std=gnu99")

            conf["ISL_INC_DIR"].append("isl/imath")
        else:
            EXTRA_DEFINES["USE_GMP_FOR_MP"] = 1

    else:
        LIBRARY_DIRS.extend(conf["ISL_LIB_DIR"])
        LIBRARIES.extend(conf["ISL_LIBNAME"])

    wrapper_dirs = conf["ISL_INC_DIR"][:]

    # {{{ configure barvinok

    if conf["USE_BARVINOK"]:
        if conf["USE_SHIPPED_ISL"]:
            raise RuntimeError("barvinok wrapper is not compatible with using "
                               "shipped isl")
        if conf["USE_SHIPPED_IMATH"]:
            raise RuntimeError("barvinok wrapper is not compatible with using "
                               "shipped imath")

        INCLUDE_DIRS.extend(conf["BARVINOK_INC_DIR"])
        LIBRARY_DIRS.extend(conf["BARVINOK_LIB_DIR"])
        LIBRARIES.extend(conf["BARVINOK_LIBNAME"])

        wrapper_dirs.extend(conf["BARVINOK_INC_DIR"])

        EXTRA_DEFINES["ISLPY_ISL_VERSION"] = 15

    # }}}

    INCLUDE_DIRS.extend(conf["ISL_INC_DIR"])

    if not (conf["USE_SHIPPED_ISL"] and conf["USE_SHIPPED_IMATH"]):
        INCLUDE_DIRS.extend(conf["GMP_INC_DIR"])
        LIBRARY_DIRS.extend(conf["GMP_LIB_DIR"])
        LIBRARIES.extend(conf["GMP_LIBNAME"])

    init_filename = "islpy/version.py"
    with open(init_filename, "r") as version_f:
        version_py = version_f.read()
    exec(compile(version_py, init_filename, "exec"), conf)

    from gen_wrap import gen_wrapper
    headers = gen_wrapper(wrapper_dirs,
                          include_barvinok=conf["USE_BARVINOK"],
                          isl_version=EXTRA_DEFINES.get("ISLPY_ISL_VERSION"))

    write_cffi_build_script(headers,
                            EXTRA_DEFINES=EXTRA_DEFINES,
                            EXTRA_SOURCES=EXTRA_SOURCES,
                            INCLUDE_DIRS=INCLUDE_DIRS,
                            LIBRARY_DIRS=LIBRARY_DIRS,
                            LIBRARIES=LIBRARIES,
                            CFLAGS=CXXFLAGS,
                            LDFLAGS=conf["LDFLAGS"])

    with open("README.rst", "rt") as readme_f:
        readme = readme_f.read()

    setup(
        name="islpy",
        version=conf["VERSION_TEXT"],
        description="Wrapper around isl, an integer set library",
        long_description=readme,
        author="Andreas Kloeckner",
        author_email="*****@*****.**",
        license="MIT",
        url="http://documen.tician.de/islpy",
        classifiers=[
            'Development Status :: 4 - Beta',
            'Intended Audience :: Developers',
            'Intended Audience :: Other Audience',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'Natural Language :: English',
            'Programming Language :: C++',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: Python :: 3.4',
            'Programming Language :: Python :: Implementation :: CPython',
            'Programming Language :: Python :: Implementation :: PyPy',
            'Topic :: Multimedia :: Graphics :: 3D Modeling',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Physics',
            'Topic :: Scientific/Engineering :: Visualization',
            'Topic :: Software Development :: Libraries',
        ],
        packages=["islpy"],
        setup_requires=["cffi>=1.1.0"],
        cffi_modules=["islpy_cffi_build.py:ffi"],
        install_requires=[
            "pytest>=2",
            "cffi>=1.1.0",
            # "Mako>=0.3.6",
            "six",
        ],
    )
Example #30
0
def main():
    from aksetup_helper import (hack_distutils,
            get_config, setup, Extension, set_up_shipped_boost_if_requested,
            check_git_submodules)

    check_git_submodules()

    hack_distutils(what_opt=1)
    conf = get_config(get_config_schema())

    TRI_EXTRA_OBJECTS, TRI_EXTRA_DEFINES = \
            set_up_shipped_boost_if_requested("meshpy", conf)
    TET_EXTRA_OBJECTS, TET_EXTRA_DEFINES = TRI_EXTRA_OBJECTS, TRI_EXTRA_DEFINES

    triangle_macros = [
            ("EXTERNAL_TEST", 1),
            ("ANSI_DECLARATORS", 1),
            ("TRILIBRARY", 1),
            ] + list(TRI_EXTRA_DEFINES.items())

    tetgen_macros = [
            ("TETLIBRARY", 1),
            ("SELF_CHECK", 1),
            ] + list(TET_EXTRA_DEFINES.items())

    # }}}

    include_dirs = conf["BOOST_INC_DIR"] + ["src/cpp"]
    library_dirs = conf["BOOST_LIB_DIR"]
    libraries = conf["BOOST_PYTHON_LIBNAME"]

    init_filename = "meshpy/__init__.py"
    exec(compile(open(init_filename, "r").read(), init_filename, "exec"), conf)

    import codecs
    setup(name="MeshPy",
          version=conf["version"],
          description="Triangular and Tetrahedral Mesh Generator",
          long_description=codecs.open("README.rst", "r", "utf-8").read(),
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          license=("MIT for the wrapper/non-commercial for "
              "the Triangle/GNU Affero Public License for TetGen"),
          url="http://mathema.tician.de/software/meshpy",
          classifiers=[
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: MIT License',
              'License :: Free for non-commercial use',
              'Natural Language :: English',
              'Programming Language :: C++',
              'Programming Language :: Python',
              'Programming Language :: Python :: 2.6',
              'Programming Language :: Python :: 2.7',
              'Programming Language :: Python :: 3',
              'Programming Language :: Python :: 3.2',
              'Programming Language :: Python :: 3.3',
              'Programming Language :: Python :: 3.4',
              'Topic :: Multimedia :: Graphics :: 3D Modeling',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Physics',
              'Topic :: Scientific/Engineering :: Visualization',
              'Topic :: Software Development :: Libraries',
              ],

          packages=["meshpy"],
          install_requires=[
                  "pytools>=2011.2",
                  "pytest>=2",
                  "numpy",
                  "six",
                  ],
          ext_modules=[
              Extension(
                  "meshpy._triangle",
                  ["src/cpp/wrap_triangle.cpp", "src/cpp/triangle.c"]
                  + TRI_EXTRA_OBJECTS,
                  include_dirs=include_dirs,
                  library_dirs=library_dirs,
                  libraries=libraries,
                  define_macros=triangle_macros,
                  extra_compile_args=conf["CXXFLAGS"],
                  extra_link_args=conf["LDFLAGS"],
                  ),
              Extension(
                  "meshpy._tetgen",
                  [
                      "src/cpp/tetgen.cpp",
                      "src/cpp/predicates.cpp",
                      "src/cpp/wrap_tetgen.cpp"]
                  + TET_EXTRA_OBJECTS,
                  include_dirs=include_dirs,
                  library_dirs=library_dirs,
                  libraries=libraries,
                  define_macros=tetgen_macros,
                  extra_compile_args=conf["CXXFLAGS"],
                  extra_link_args=conf["LDFLAGS"],
                  ),
              ])
Example #31
0
def main():
    from aksetup_helper import (hack_distutils,
            check_pybind11, get_config, setup, check_git_submodules,
            Extension,
            get_pybind_include, PybindBuildExtCommand)

    check_pybind11()
    check_git_submodules()

    hack_distutils(what_opt=1)
    conf = get_config(
            get_config_schema(),
            warn_about_no_config=False)

    triangle_macros = [
            ("EXTERNAL_TEST", 1),
            ("ANSI_DECLARATORS", 1),
            ("TRILIBRARY", 1),
            ]

    tetgen_macros = [
            ("TETLIBRARY", 1),
            ("SELF_CHECK", 1),
            ]

    # }}}

    include_dirs = [
            get_pybind_include(),
            get_pybind_include(user=True)
            ] + ["src/cpp"]

    init_filename = "meshpy/__init__.py"
    exec(compile(open(init_filename, "r").read(), init_filename, "exec"), conf)

    import codecs
    setup(name="MeshPy",
          version=conf["version"],
          description="Triangular and Tetrahedral Mesh Generator",
          long_description=codecs.open("README.rst", "r", "utf-8").read(),
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          license=("MIT for the wrapper/non-commercial for "
              "the Triangle/GNU Affero Public License for TetGen"),
          url="http://mathema.tician.de/software/meshpy",
          classifiers=[
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: MIT License',
              'License :: Free for non-commercial use',
              'Natural Language :: English',
              'Programming Language :: C++',
              'Programming Language :: Python',
              'Programming Language :: Python :: 2.7',
              'Programming Language :: Python :: 3',
              'Programming Language :: Python :: 3.2',
              'Programming Language :: Python :: 3.3',
              'Programming Language :: Python :: 3.4',
              'Topic :: Multimedia :: Graphics :: 3D Modeling',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Physics',
              'Topic :: Scientific/Engineering :: Visualization',
              'Topic :: Software Development :: Libraries',
              ],

          packages=["meshpy"],
          setup_requires=["pybind11"],
          install_requires=[
                  "pytools>=2011.2",
                  "pytest>=2",
                  "numpy",
                  "gmsh_interop",
                  "six",
                  ],
          ext_modules=[
              Extension(
                  "meshpy._internals",
                  [
                      "src/cpp/wrapper.cpp",

                      "src/cpp/wrap_triangle.cpp",
                      "src/cpp/triangle.cpp",

                      "src/cpp/wrap_tetgen.cpp",
                      "src/cpp/tetgen.cpp",
                      "src/cpp/predicates.cpp",
                      ],
                  include_dirs=include_dirs,
                  define_macros=triangle_macros + tetgen_macros,
                  extra_compile_args=conf["CXXFLAGS"],
                  extra_link_args=conf["LDFLAGS"],
                  ),
              ],
          cmdclass={'build_ext': PybindBuildExtCommand},
          zip_safe=False,
          )
Example #32
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup, \
            PyUblasExtension

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = conf["BOOST_INC_DIR"] \

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_DEFINES = {}
    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    ver_dic = {}
    exec(
        compile(
            open("pyvisfile/__init__.py").read(), "pyvisfile/__init__.py",
            'exec'), ver_dic)

    requirements = []
    ext_modules = []

    if conf["USE_SILO"]:
        EXTRA_DEFINES["USE_SILO"] = 1
        EXTRA_INCLUDE_DIRS.extend(conf["SILO_INC_DIR"])
        EXTRA_LIBRARY_DIRS.extend(conf["SILO_LIB_DIR"])
        EXTRA_LIBRARIES.extend(conf["SILO_LIBNAME"])

        ext_modules.append(
            PyUblasExtension(
                "_internal",
                ["src/wrapper/wrap_silo.cpp"],
                include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS + EXTRA_LIBRARY_DIRS,
                libraries=LIBRARIES + EXTRA_LIBRARIES,
                extra_compile_args=conf["CXXFLAGS"],
                define_macros=list(EXTRA_DEFINES.iteritems()),
            ))

        requirements.append("PyUblas>=0.92.1")

    setup(
        name="pyvisfile",
        version=ver_dic["VERSION_TEXT"],
        description="Large-scale Visualization Data Storage",
        long_description="""
            Pyvisfile allows you to write a variety of visualization file formats,
            including

            * `Kitware's <http://www.kitware.com>`_
              `XML-style <http://www.vtk.org/VTK/help/documentation.html>`_
              `Vtk <http://vtk.org>`_ data files.

            * Silo visualization files, as
              introduced by LLNL's
              `MeshTV <https://wci.llnl.gov/codes/meshtv/>`_ and
              more recently used by the
              `VisIt <https://wci.llnl.gov/codes/visit/>`_
              large-scale visualization program.

            pyvisfiles supports many mesh geometries, such such as unstructured
            and rectangular structured meshes, particle meshes, as well as
            scalar and vector variables on them. In addition, pyvisfile allows the
            semi-automatic writing of parallelization-segmented visualization files
            in both Silo and Vtk formats. For Silo files, pyvisfile also
            supports the writing of expressions as visualization variables.

            pyvisfile can write Vtk files without any extra software installed.

            To use pyvisfile to create Silo files, you need `libsilo
            <https://wci.llnl.gov/codes/silo/>`_ as well as `Boost.Python
            <http://www.boost.org>`_ and `PyUblas
            <http://mathema.tician.de/software/pyublas>`_.  To build
            pyvisfile's Silo support, please refer to the `PyUblas
            documentation <http://tiker.net/doc/pyublas>`_ for build
            instructions first. Check the
            `VisIt source page <https://wci.llnl.gov/codes/visit/source.html>`_
            for the latest Silo source code.
            """,
        classifiers=[
            'Development Status :: 4 - Beta',
            'Intended Audience :: Developers',
            'Intended Audience :: Other Audience',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'Natural Language :: English',
            'Programming Language :: C++',
            'Programming Language :: Python',
            'Topic :: Multimedia :: Graphics :: 3D Modeling',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Physics',
            'Topic :: Scientific/Engineering :: Visualization',
            'Topic :: Software Development :: Libraries',
        ],
        author=u"Andreas Kloeckner",
        author_email="*****@*****.**",
        license="MIT",
        url="http://mathema.tician.de/software/pyvisfile",

        # dependencies
        setup_requires=requirements,
        install_requires=["pytools>=2013.2"] + requirements,
        packages=["pyvisfile", "pyvisfile.silo", "pyvisfile.vtk"],
        ext_package="pyvisfile.silo",
        ext_modules=ext_modules,
        zip_safe=False)
Example #33
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup, \
            PyUblasExtension

    hack_distutils()
    conf = get_config(get_config_schema())

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_DEFINES = {"PYUBLAS_HAVE_BOOST_BINDINGS": 1}
    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    INCLUDE_DIRS = [
            "hedge/include",
            ] \
            + conf["BOOST_BINDINGS_INC_DIR"] \
            + conf["BOOST_INC_DIR"] \

    conf["BLAS_INC_DIR"] = []
    conf["USE_BLAS"] = conf["HAVE_BLAS"]

    def handle_component(comp):
        if conf["USE_"+comp]:
            EXTRA_DEFINES["USE_"+comp] = 1
            EXTRA_INCLUDE_DIRS.extend(conf[comp+"_INC_DIR"])
            EXTRA_LIBRARY_DIRS.extend(conf[comp+"_LIB_DIR"])
            EXTRA_LIBRARIES.extend(conf[comp+"_LIBNAME"])

    handle_component("BLAS")

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    setup(name="hedge",
            # metadata
            version="0.91",
            description="Hybrid Easy Discontinuous Galerkin Environment",
            long_description=open("README.rst", "rt").read(),
            author=u"Andreas Kloeckner",
            author_email="*****@*****.**",
            license="MIT",
            url="http://mathema.tician.de/software/hedge",
            classifiers=[
                'Environment :: Console',
                'Development Status :: 4 - Beta',
                'Intended Audience :: Developers',
                'Intended Audience :: Other Audience',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: MIT License',
                'Natural Language :: English',
                'Programming Language :: C++',
                'Programming Language :: Python',
                'Programming Language :: Python :: 2',
                'Programming Language :: Python :: 2.6',
                'Programming Language :: Python :: 2.7',
                'Programming Language :: Python :: 3',
                'Programming Language :: Python :: 3.2',
                'Programming Language :: Python :: 3.3',
                'Topic :: Scientific/Engineering',
                'Topic :: Scientific/Engineering :: Mathematics',
                'Topic :: Scientific/Engineering :: Physics',
                'Topic :: Scientific/Engineering :: Visualization',
                ],

            # build info
            packages=[
                    "hedge",
                    "hedge.flux",
                    "hedge.optemplate",
                    "hedge.optemplate.mappers",
                    "hedge.models",
                    "hedge.models.gas_dynamics",
                    "hedge.backends",
                    "hedge.backends.jit",
                    "hedge.backends.mpi",
                    "hedge.backends.cuda",
                    "hedge.timestep",
                    "hedge.timestep.multirate_ab",
                    "hedge.mesh",
                    "hedge.mesh.reader",
                    "hedge.discretization",
                    "hedge.tools",
                    ],

            ext_package="hedge",

            setup_requires=[
                "PyUblas>=2013.1",
                ],
            install_requires=[
                # This is *not* redundant. Distribute will delete PyUblas
                # after install if this is not here.
                "PyUblas>=2013.1",

                "pytools>=10",
                "cgen",
                "codepy>=2013.1",
                "pymbolic>=2013.3.3",
                "meshpy>=2013.1",
                "decorator>=3.2.0",
                "pytest>=2"
                ],
            extras_require={
                "silo": ["pyvisfile"],
                "parallel": ["PyMetis>=0.91"],
                },

            ext_modules=[
                PyUblasExtension("_internal",
                    [
                        "src/wrapper/wrap_main.cpp",
                        "src/wrapper/wrap_base.cpp",
                        "src/wrapper/wrap_mesh.cpp",
                        "src/wrapper/wrap_special_function.cpp",
                        "src/wrapper/wrap_flux.cpp",
                        "src/wrapper/wrap_volume_operators.cpp",
                        ],
                    include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                    library_dirs=LIBRARY_DIRS + EXTRA_LIBRARY_DIRS,
                    libraries=LIBRARIES + EXTRA_LIBRARIES,
                    define_macros=list(EXTRA_DEFINES.iteritems()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                ],

            zip_safe=False,

            include_package_data=True,
            package_data={
                    "hedge": [
                        "include/hedge/*.hpp",
                        ]
                    },

            # 2to3 invocation
            cmdclass={'build_py': build_py})
Example #34
0
def main():
    from setuptools import find_packages
    from aksetup_helper import (hack_distutils, get_config, setup,
            check_git_submodules)
    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema(),
            warn_about_no_config=False)

    extra_defines = {}

    extra_defines["PYGPU_PACKAGE"] = "pyopencl"
    extra_defines["PYGPU_PYOPENCL"] = "1"

    if conf["CL_TRACE"]:
        extra_defines["PYOPENCL_TRACE"] = 1

    if conf["CL_ENABLE_GL"]:
        extra_defines["HAVE_GL"] = 1

    if conf["CL_ENABLE_DEVICE_FISSION"]:
        extra_defines["PYOPENCL_USE_DEVICE_FISSION"] = 1
    if conf["CL_PRETEND_VERSION"]:
        try:
            major, minor = [int(x) for x in conf["CL_PRETEND_VERSION"].split(".")]
            extra_defines["PYOPENCL_PRETEND_CL_VERSION"] = \
                    0x1000*major + 0x10 * minor
        except:
            print("CL_PRETEND_VERSION must be of the form M.N, "
                    "with two integers M and N")
            raise

    conf["EXTRA_DEFINES"] = extra_defines

    ver_dic = {}
    version_file = open("pyopencl/version.py")
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()

    exec(compile(version_file_contents, "pyopencl/version.py", 'exec'), ver_dic)

    separator = "-"*75

    try:
        import mako  # noqa
    except ImportError:
        print(separator)
        print("Mako is not installed.")
        print(separator)
        print("That is not a problem, as most of PyOpenCL will be just fine ")
        print("without it.Some higher-level parts of pyopencl (such as ")
        print("pyopencl.reduction) will not function without the templating engine ")
        print("Mako [1] being installed. If you would like this functionality to ")
        print("work, you might want to install Mako after you finish ")
        print("installing PyOpenCL.")
        print("")
        print("[1] http://www.makotemplates.org/")
        print(separator)
        print("Hit Ctrl-C now if you'd like to think about the situation.")
        print(separator)

        from aksetup_helper import count_down_delay
        count_down_delay(delay=5)

    # {{{ write cffi build script

    with open("cffi_build.py.in", "rt") as f:
        build_script_template = f.read()

    format_args = {}
    for k, v in conf.items():
        format_args[k] = repr(v)

    build_script = build_script_template.format(**format_args)

    with open("cffi_build.py", "wt") as f:
        f.write(build_script)

    # }}}

    setup(name="pyopencl",
            # metadata
            version=ver_dic["VERSION_TEXT"],
            description="Python wrapper for OpenCL",
            long_description=open("README.rst", "rt").read(),
            author="Andreas Kloeckner",
            author_email="*****@*****.**",
            license="MIT",
            url="http://mathema.tician.de/software/pyopencl",
            classifiers=[
                'Environment :: Console',
                'Development Status :: 5 - Production/Stable',
                'Intended Audience :: Developers',
                'Intended Audience :: Other Audience',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: MIT License',
                'Natural Language :: English',
                'Programming Language :: C++',
                'Programming Language :: Python',
                'Programming Language :: Python :: 2',
                'Programming Language :: Python :: 2.6',
                'Programming Language :: Python :: 2.7',
                'Programming Language :: Python :: 3',
                'Programming Language :: Python :: 3.2',
                'Programming Language :: Python :: 3.3',
                'Topic :: Scientific/Engineering',
                'Topic :: Scientific/Engineering :: Mathematics',
                'Topic :: Scientific/Engineering :: Physics',
                ],

            # build info
            packages=find_packages(),

            setup_requires=[
                "numpy",
                "cffi>=1.1.0",
                ],

            install_requires=[
                "numpy",
                "pytools>=2015.1.2",
                "pytest>=2",
                "decorator>=3.2.0",
                "cffi>=1.1.0",
                "appdirs>=1.4.0",
                "six>=1.9.0",
                # "Mako>=0.3.6",
                ],

            cffi_modules=["cffi_build.py:ffi"],

            include_package_data=True,
            package_data={
                    "pyopencl": ["cl/*.cl", "cl/*.h"]
                    },

            zip_safe=False)
Example #35
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup, NumpyExtension
    from setuptools import find_packages

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = ['C++/myrrh'] + conf['BOOST_INC_DIR']
    LIBRARY_DIRS = conf['BOOST_LIB_DIR']
    LIBRARIES = conf['BOOST_PYTHON_LIBNAME']
    EXTRA_DEFINES = { }

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    #
    # C++ extension
    #
    cNetwork = NumpyExtension(
        'pybool.cNetwork',
        [
            'C++/module_network.cpp',
            'C++/myrrh/src/python/multi_array_to_numpy.cpp',
        ],
        include_dirs         = INCLUDE_DIRS,
        library_dirs         = LIBRARY_DIRS,
        libraries            = LIBRARIES,
        define_macros        = list(EXTRA_DEFINES.items()),
        extra_compile_args   = conf['CXXFLAGS'],
        extra_link_args      = conf['LDFLAGS'],
    )

    #
    # Main setup
    #
    setup(
        name                 = 'pybool',
        version              = read('python', 'pybool', 'VERSION').strip().split('-')[0],
        description          = 'pybool: A package to infer Boolean networks.',
        long_description     = read('python', 'pybool', 'README'),
        author               ='John Reid',
        author_email         ='*****@*****.**',
        license              = 'BSD',
        url                  ='http://sysbio.mrc-bsu.cam.ac.uk/johns/pybool/docs/build/html/index.html',
        classifiers          = [
            'Development Status :: 5 - Production/Stable',
            'Environment :: Console',
            'Intended Audience :: Developers',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: BSD License',
            'Operating System :: MacOS :: MacOS X',
            'Operating System :: POSIX',
            'Operating System :: Microsoft :: Windows',
            'Programming Language :: Python',
            'Programming Language :: C++',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Bio-Informatics',
            'Topic :: Utilities',
        ],

        packages             = find_packages(where='python'),
        package_dir          = { '' : 'python' },
        py_modules           = ['pybool.examples.tutorial'],
        package_data         = { 'pybool': ['README', 'LICENSE', 'VERSION'] },
        install_requires     = [
                                'cookbook>=2.2',
                                'numpy>=1.6.1',
                                'matplotlib>=1.1.1',
                                'networkx>=1.6',
                                'pygraphviz>=1.1',
                               ],
        scripts              = ['python/scripts/pybool-find-consistent'],
        ext_modules          = [cNetwork],

        # 2to3 invocation
        cmdclass             = {'build_py': build_py},

        include_package_data = False,
    )
Example #36
0
def main():
    import glob
    from aksetup_helper import (hack_distutils, get_config, setup,
            NumpyExtension, set_up_shipped_boost_if_requested)

    hack_distutils()
    conf = get_config(get_config_schema(),
            warn_about_no_config=False)
    EXTRA_OBJECTS, EXTRA_DEFINES = set_up_shipped_boost_if_requested(conf)

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    from os.path import dirname, join, normpath

    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    if conf["CL_TRACE"]:
        EXTRA_DEFINES["PYOPENCL_TRACE"] = 1

    INCLUDE_DIRS = ['src/cpp'] + conf["BOOST_INC_DIR"] + conf["CL_INC_DIR"]

    ext_kwargs = dict()

    if conf["CL_ENABLE_GL"]:
        EXTRA_DEFINES["HAVE_GL"] = 1

    ver_dic = {}
    execfile("pyopencl/version.py", ver_dic)

    setup(name="pyopencl",
            # metadata
            version=ver_dic["VERSION_TEXT"],
            description="Python wrapper for OpenCL",
            long_description="""
            PyOpenCL lets you access GPUs and other massively parallel compute
            devices from Python. It tries to offer computing goodness in the
            spirit of its sister project `PyCUDA <http://mathema.tician.de/software/pycuda>`_:

            * Object cleanup tied to lifetime of objects. This idiom, often
              called
              `RAII <http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>`_
              in C++, makes it much easier to write correct, leak- and
              crash-free code.

            * Completeness. PyOpenCL puts the full power of OpenCL's API at
              your disposal, if you wish.  Every obscure `get_info()` query and 
              all CL calls are accessible.

            * Automatic Error Checking. All CL errors are automatically
              translated into Python exceptions.

            * Speed. PyOpenCL's base layer is written in C++, so all the niceties
              above are virtually free.

            * Helpful and complete `Documentation <http://documen.tician.de/pyopencl>`_
              as well as a `Wiki <http://wiki.tiker.net/PyOpenCL>`_.

            * Liberal license. PyOpenCL is open-source under the 
              `MIT license <http://en.wikipedia.org/wiki/MIT_License>`_
              and free for commercial, academic, and private use.

            * Broad support. PyOpenCL was tested and works with Apple's, AMD's, and Nvidia's 
              CL implementations.
            """,
            author=u"Andreas Kloeckner",
            author_email="*****@*****.**",
            license = "MIT",
            url="http://mathema.tician.de/software/pyopencl",
            classifiers=[
              'Environment :: Console',
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: Apache Software License',
              'Natural Language :: English',
              'Programming Language :: C++',
              'Programming Language :: Python',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Physics',
              ],

            # build info
            packages=["pyopencl"],

            install_requires=[
                "pytools>=7",
                "py>=1.0.2",
                "decorator>=3.2.0",
                ],

            ext_package="pyopencl",
            ext_modules=[
                NumpyExtension("_cl", 
                    [
                        "src/wrapper/wrap_cl.cpp", 
                        "src/wrapper/wrap_cl_part_1.cpp", 
                        "src/wrapper/wrap_cl_part_2.cpp", 
                        "src/wrapper/wrap_constants.cpp", 
                        ]+EXTRA_OBJECTS, 
                    include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                    library_dirs=LIBRARY_DIRS + conf["CL_LIB_DIR"],
                    libraries=LIBRARIES + conf["CL_LIBNAME"],
                    define_macros=list(EXTRA_DEFINES.iteritems()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                ])
Example #37
0
def main():
    check_pybind11()
    check_git_submodules()

    conf = get_config(get_config_schema(), warn_about_no_config=False)

    CXXFLAGS = conf["CXXFLAGS"]  # noqa: N806

    EXTRA_OBJECTS = []  # noqa: N806
    EXTRA_DEFINES = {}  # noqa: N806

    INCLUDE_DIRS = ["src/wrapper"]  # noqa: N806
    LIBRARY_DIRS = []  # noqa: N806
    LIBRARIES = []  # noqa: N806

    if conf["USE_SHIPPED_ISL"]:
        from glob import glob
        isl_blacklist = [
            "_templ.c",
            "_templ_yaml.c",
            "mp_get",
            "extract_key.c",
            "isl_multi_templ.c",
            "isl_multi_apply_set.c",
            "isl_multi_gist.c",
            "isl_multi_coalesce.c",
            "isl_multi_intersect.c",
            "isl_multi_floor.c",
            "isl_multi_apply_union_set.c",
            "isl_multi_cmp.c",
            "isl_multi_pw_aff_explicit_domain.c",
            "isl_multi_hash.c",
            "isl_multi_dims.c",
            "isl_multi_explicit_domain.c",
            "isl_multi_no_explicit_domain.c",
            "isl_multi_align_set.c",
            "isl_multi_align_union_set.c",
            "isl_multi_union_pw_aff_explicit_domain.c",
            "isl_union_templ.c",
            "isl_union_multi.c",
            "isl_union_eval.c",
            "isl_union_neg.c",
            "isl_union_single.c",
            "isl_pw_hash.c",
            "isl_pw_eval.c",
            "isl_pw_union_opt.c",
            "isl_pw_union_opt.c",
        ]

        for fn in glob("isl/*.c"):
            blacklisted = False
            for bl in isl_blacklist:
                if bl in fn:
                    blacklisted = True
                    break

            if "no_piplib" in fn:
                pass
            elif "piplib" in fn:
                blacklisted = True

            if "gmp" in fn:
                if conf["USE_SHIPPED_IMATH"]:
                    continue
            if "imath" in fn:
                if not conf["USE_SHIPPED_IMATH"]:
                    continue

                if "sioimath" in fn and not conf["USE_IMATH_SIO"]:
                    continue
                if "isl_val_imath" in fn and conf["USE_IMATH_SIO"]:
                    continue

            if "isl_ast_int.c" in fn and conf["USE_SHIPPED_IMATH"]:
                continue

            inf = open(fn, "r", encoding="utf-8")
            try:
                contents = inf.read()
            finally:
                inf.close()

            if "int main(" not in contents and not blacklisted:
                EXTRA_OBJECTS.append(fn)

        conf["ISL_INC_DIR"] = ["isl-supplementary", "isl/include", "isl"]

        if conf["USE_SHIPPED_IMATH"]:
            EXTRA_OBJECTS.extend([
                "isl/imath/imath.c",
                "isl/imath/imrat.c",
                "isl/imath/gmp_compat.c",
                #"isl/imath_wrap/imath.c",
                #"isl/imath_wrap/imrat.c",
                #"isl/imath_wrap/gmp_compat.c",
            ])
            EXTRA_DEFINES["USE_IMATH_FOR_MP"] = 1
            if conf["USE_IMATH_SIO"]:
                EXTRA_DEFINES["USE_SMALL_INT_OPT"] = 1

            conf["ISL_INC_DIR"].append("isl/imath")
        else:
            EXTRA_DEFINES["USE_GMP_FOR_MP"] = 1

    else:
        LIBRARY_DIRS.extend(conf["ISL_LIB_DIR"])
        LIBRARIES.extend(conf["ISL_LIBNAME"])

    wrapper_dirs = conf["ISL_INC_DIR"][:]

    # {{{ configure barvinok

    if conf["USE_BARVINOK"]:
        if conf["USE_SHIPPED_ISL"]:
            raise RuntimeError("barvinok wrapper is not compatible with using "
                               "shipped isl")
        if conf["USE_SHIPPED_IMATH"]:
            raise RuntimeError("barvinok wrapper is not compatible with using "
                               "shipped imath")

        INCLUDE_DIRS.extend(conf["BARVINOK_INC_DIR"])
        LIBRARY_DIRS.extend(conf["BARVINOK_LIB_DIR"])
        LIBRARIES.extend(conf["BARVINOK_LIBNAME"])

        wrapper_dirs.extend(conf["BARVINOK_INC_DIR"])

        EXTRA_DEFINES["ISLPY_INCLUDE_BARVINOK"] = 1

    # }}}

    INCLUDE_DIRS.extend(conf["ISL_INC_DIR"])

    if not (conf["USE_SHIPPED_ISL"] and conf["USE_SHIPPED_IMATH"]) and \
            conf["USE_GMP"]:
        INCLUDE_DIRS.extend(conf["GMP_INC_DIR"])
        LIBRARY_DIRS.extend(conf["GMP_LIB_DIR"])
        LIBRARIES.extend(conf["GMP_LIBNAME"])

    init_filename = "islpy/version.py"
    with open(init_filename, "r") as version_f:
        version_py = version_f.read()
    exec(compile(version_py, init_filename, "exec"), conf)

    from gen_wrap import gen_wrapper
    gen_wrapper(wrapper_dirs, include_barvinok=conf["USE_BARVINOK"])

    with open("README.rst", "rt") as readme_f:
        readme = readme_f.read()

    setup(
        name="islpy",
        version=conf["VERSION_TEXT"],
        description="Wrapper around isl, an integer set library",
        long_description=readme,
        author="Andreas Kloeckner",
        author_email="*****@*****.**",
        license="MIT",
        url="http://documen.tician.de/islpy",
        classifiers=[
            "Development Status :: 4 - Beta",
            "Intended Audience :: Developers",
            "Intended Audience :: Other Audience",
            "Intended Audience :: Science/Research",
            "License :: OSI Approved :: MIT License",
            "Natural Language :: English",
            "Programming Language :: C++",
            "Programming Language :: Python",
            "Programming Language :: Python :: 3",
            "Topic :: Multimedia :: Graphics :: 3D Modeling",
            "Topic :: Scientific/Engineering",
            "Topic :: Scientific/Engineering :: Mathematics",
            "Topic :: Scientific/Engineering :: Physics",
            "Topic :: Scientific/Engineering :: Visualization",
            "Topic :: Software Development :: Libraries",
        ],
        packages=["islpy"],
        python_requires="~=3.6",
        setup_requires=[
            "pybind11",
        ],
        install_requires=[
            "pytest>=2",
            # "Mako>=0.3.6",
            "six",
        ],
        ext_modules=[
            Extension(
                "islpy._isl",
                [
                    "src/wrapper/wrap_isl.cpp",
                    "src/wrapper/wrap_isl_part1.cpp",
                    "src/wrapper/wrap_isl_part2.cpp",
                    "src/wrapper/wrap_isl_part3.cpp",
                ] + EXTRA_OBJECTS,
                include_dirs=INCLUDE_DIRS +
                [get_pybind_include(),
                 get_pybind_include(user=True)],
                library_dirs=LIBRARY_DIRS,
                libraries=LIBRARIES,
                define_macros=list(EXTRA_DEFINES.items()),
                extra_compile_args=CXXFLAGS,
                extra_link_args=conf["LDFLAGS"],
            ),
        ],
        cmdclass={"build_ext": IslPyBuildExtCommand},
    )
Example #38
0
def main():
    import glob
    from aksetup_helper import (hack_distutils, get_config, setup,
            NumpyExtension, set_up_shipped_boost_if_requested)

    hack_distutils()
    conf = get_config(get_config_schema(),
            warn_about_no_config=False)
    EXTRA_OBJECTS, EXTRA_DEFINES = set_up_shipped_boost_if_requested(conf)

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    from os.path import dirname, join, normpath

    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    if conf["CL_TRACE"]:
        EXTRA_DEFINES["PYOPENCL_TRACE"] = 1

    INCLUDE_DIRS = ['src/cpp'] + conf["BOOST_INC_DIR"] + conf["CL_INC_DIR"]

    ext_kwargs = dict()

    if conf["CL_ENABLE_GL"]:
        EXTRA_DEFINES["HAVE_GL"] = 1

    ver_dic = {}
    exec(compile(open("pyopencl/version.py").read(), "pyopencl/version.py", 'exec'), ver_dic)

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    setup(name="pyopencl",
            # metadata
            version=ver_dic["VERSION_TEXT"],
            description="Python wrapper for OpenCL",
            long_description="""
            PyOpenCL lets you access GPUs and other massively parallel compute
            devices from Python. It tries to offer computing goodness in the
            spirit of its sister project `PyCUDA <http://mathema.tician.de/software/pycuda>`_:

            * Object cleanup tied to lifetime of objects. This idiom, often
              called
              `RAII <http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>`_
              in C++, makes it much easier to write correct, leak- and
              crash-free code.

            * Completeness. PyOpenCL puts the full power of OpenCL's API at
              your disposal, if you wish.  Every obscure `get_info()` query and 
              all CL calls are accessible.

            * Automatic Error Checking. All CL errors are automatically
              translated into Python exceptions.

            * Speed. PyOpenCL's base layer is written in C++, so all the niceties
              above are virtually free.

            * Helpful and complete `Documentation <http://documen.tician.de/pyopencl>`_
              as well as a `Wiki <http://wiki.tiker.net/PyOpenCL>`_.

            * Liberal license. PyOpenCL is open-source under the 
              `MIT license <http://en.wikipedia.org/wiki/MIT_License>`_
              and free for commercial, academic, and private use.

            * Broad support. PyOpenCL was tested and works with Apple's, AMD's, and Nvidia's 
              CL implementations.
            """,
            author="Andreas Kloeckner",
            author_email="*****@*****.**",
            license = "MIT",
            url="http://mathema.tician.de/software/pyopencl",
            classifiers=[
              'Environment :: Console',
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: Apache Software License',
              'Natural Language :: English',
              'Programming Language :: C++',
              'Programming Language :: Python',
            'Programming Language :: Python :: 3',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Physics',
              ],

            # build info
            packages=["pyopencl"],

            install_requires=[
                "pytools>=7",
                "py>=1.0.2",
                "decorator>=3.2.0",
                ],

            ext_package="pyopencl",
            ext_modules=[
                NumpyExtension("_cl", 
                    [
                        "src/wrapper/wrap_cl.cpp", 
                        "src/wrapper/wrap_cl_part_1.cpp", 
                        "src/wrapper/wrap_cl_part_2.cpp", 
                        "src/wrapper/wrap_constants.cpp", 
                        ]+EXTRA_OBJECTS, 
                    include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                    library_dirs=LIBRARY_DIRS + conf["CL_LIB_DIR"],
                    libraries=LIBRARIES + conf["CL_LIBNAME"],
                    define_macros=list(EXTRA_DEFINES.items()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                ],

            # 2to3 invocation
            cmdclass={'build_py': build_py})
Example #39
0
def main():
    import glob
    from setuptools import find_packages
    from aksetup_helper import (check_pybind11, hack_distutils, get_config,
                                setup, Extension, get_pybind_include,
                                PybindBuildExtCommand)
    from setuptools.command.build_clib import build_clib

    check_pybind11()

    hack_distutils()
    conf = get_config(get_config_schema(), warn_about_no_config=False)

    extra_defines = {}

    extra_defines["HAVE_MREMAP"] = 0  # mremap() buggy on amd64?

    ver_filename = "pymetis/version.py"
    version_file = open(ver_filename)
    ver_dic = {}
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()
    exec(compile(version_file_contents, ver_filename, 'exec'), ver_dic)

    setup(name="PyMetis",
          version=ver_dic["version"],
          description="A Graph Partitioning Package",
          long_description=open("README.rst", "rt").read(),
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          license="wrapper: MIT/METIS: Apache 2",
          url="http://mathema.tician.de/software/pymetis",
          classifiers=[
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: MIT License',
              'License :: Free for non-commercial use',
              'Natural Language :: English',
              'Programming Language :: C',
              'Programming Language :: C++',
              'Programming Language :: Python',
              'Programming Language :: Python :: 3',
              'Topic :: Multimedia :: Graphics :: 3D Modeling',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Visualization',
              'Topic :: Software Development :: Libraries',
          ],
          packages=find_packages(),
          setup_requires=[
              "pybind11",
          ],
          install_requires=["six"],
          ext_modules=[
              Extension(
                  "pymetis._internal",
                  (["src/wrapper/wrapper.cpp"] +
                   glob.glob("src/metis/GKlib/*.c") +
                   glob.glob("src/metis/*.c") +
                   glob.glob("src/metis/libmetis/*.c")),
                  define_macros=list(extra_defines.items()),
                  include_dirs=[
                      "src/metis/include", "src/metis/GKlib",
                      "src/metis/include", "src/metis/libmetis",
                      get_pybind_include(),
                      get_pybind_include(user=True)
                  ],
                  extra_compile_args=conf["CXXFLAGS"],
              ),
          ],
          cmdclass={
              'build_clib': build_clib,
              'build_ext': PybindBuildExtCommand
          },
          zip_safe=False)
Example #40
0
def main():
    import glob
    from aksetup_helper import hack_distutils, get_config, setup, \
            NumpyExtension

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = ["src/cpp"] + conf["BOOST_INC_DIR"] 
    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_DEFINES = { }

    if conf["USE_ITERATORS"]:
        EXTRA_DEFINES["BOOST_UBLAS_USE_ITERATING"] = 1

    ext_src = [
            "src/wrapper/main.cpp",
            "src/wrapper/converters.cpp",
            ] 

    if conf["WITH_SPARSE_WRAPPERS"]:
        ext_src += [
                "src/wrapper/sparse_build.cpp",
                "src/wrapper/sparse_execute.cpp",
                ]
        EXTRA_DEFINES["HAVE_SPARSE_WRAPPERS"] = 1

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    setup(
            name="PyUblas",
            version="2011.1",
            description="Seamless Numpy-UBlas interoperability",
            long_description="""
            PyUblas provides a seamless glue layer between
            `Numpy <http://www.numpy.org>`_ and
            `Boost.Ublas <http://www.boost.org/doc/libs/1_35_0/libs/numeric/ublas/doc/index.htm>`_
            for use with
            `Boost.Python <http://www.boost.org/doc/libs/1_35_0/libs/python/doc/index.html>`_.

            What does that mean? When writing 
            `hybrid scientific code <http://mathema.tician.de/node/455>`_, 
            one of the main problems is that abstractions that
            exist in the high-level language go away or become unwieldy in the
            low-level language. Sometimes libraries exist in both languages for
            these abstractions, but they refuse to talk to each other. PyUblas is
            a bridge between two such libraries, for some of the main
            abstractions used in scientific codes, namely vectors and matrices.

            Documentation
            =============

            See the 
            `PyUblas Documentation <http://tiker.net/doc/pyublas>`_
            page.

            PyUblasExt
            ==========

            PyUblasExt is a companion to PyUblas and exposes a variety of useful
            additions to PyUblas, such as an "operator" class, matrix-free linear
            system solvers and eigensolvers. Interested? Head over to the
            `PyUblasExt <http://mathema.tician.de/software/pyublas/pyublasext>`_ 
            page.
            """,
            author="Andreas Kloeckner",
            author_email="*****@*****.**",
            license = "BSD",
            url="http://mathema.tician.de/software/pyublas",
            classifiers=[
              'Development Status :: 4 - Beta',
              'Environment :: Console',
              'Intended Audience :: Developers',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: BSD License',
              'Operating System :: MacOS :: MacOS X',
              'Operating System :: POSIX',
              'Programming Language :: Python',
              'Programming Language :: Python :: 3',
              'Programming Language :: C++',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Office/Business',
              'Topic :: Utilities',
              ],

            # numpy is often under the setuptools radar.
            #setup_requires=[
                    #"numpy>=1.0.4",
                    #],
            #install_requires=[
                    #"numpy>=1.0.4",
                    #],

            packages=["pyublas"],
            ext_package="pyublas",
            ext_modules=[ 
                    NumpyExtension("_internal", 
                        ext_src,
                        include_dirs=INCLUDE_DIRS,
                        library_dirs=LIBRARY_DIRS,
                        libraries=LIBRARIES,
                        define_macros=list(EXTRA_DEFINES.items()),
                        extra_compile_args=conf["CXXFLAGS"],
                        extra_link_args=conf["LDFLAGS"],
                        ),
                    NumpyExtension("testhelp_ext", 
                        ["src/test/testhelp_ext.cpp"],
                        include_dirs=INCLUDE_DIRS,
                        library_dirs=LIBRARY_DIRS,
                        libraries=LIBRARIES,
                        define_macros=list(EXTRA_DEFINES.items()),
                        extra_compile_args=conf["CXXFLAGS"],
                        extra_link_args=conf["LDFLAGS"],
                        )
                    ],
            data_files=[("include/pyublas", glob.glob("src/cpp/pyublas/*.hpp"))],

            # 2to3 invocation
            cmdclass={'build_py': build_py})
Example #41
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup
    from setuptools import find_packages, Extension

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = [
        'c++',
        os.path.join('c++', 'include'),
        os.path.join('c++', 'boost-indexing-suite'),
        os.path.join('c++', 'myrrh'),
    ] + conf['BOOST_INC_DIR'] + [os.path.join(conf['SEQAN_DIR'], 'include')]
    LIBRARY_DIRS = conf['BOOST_LIB_DIR']
    LIBRARIES = conf['BOOST_PYTHON_LIBNAME']
    EXTRA_DEFINES = {
        "SEQAN_ENABLE_TESTING": "0",
        "SEQAN_ENABLE_DEBUG": "0",
        "BOOST_DISABLE_ASSERTS": "0",
        "MYRRH_DISABLE_ASSERTS": "0",
    }

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    #
    # C++ extension
    #
    seqanext = Extension(
        'seqan._release_build._seqan',
        [
            'c++/src/expose_indexes.cpp',
            'c++/src/expose_simple_types.cpp',
            'c++/src/expose_strings.cpp',
            'c++/src/module_pyseqan.cpp',
        ],
        include_dirs=INCLUDE_DIRS,
        library_dirs=LIBRARY_DIRS,
        libraries=LIBRARIES + ['rt'],
        define_macros=list(EXTRA_DEFINES.items()),
        extra_compile_args=[
            '-std=c++0x',
            '-Wno-deprecated-declarations',
        ] + conf['CXXFLAGS'],
        extra_link_args=conf['LDFLAGS'],
    )

    #
    # Main setup
    #
    setup(
        name='pyseqan',
        version=read('python', 'seqan', 'VERSION').strip().split('-')[0],
        description=
        'pyseqan: A package to expose SeqAn suffix array functionality.',
        long_description=read('python', 'seqan', 'README'),
        author='John Reid',
        author_email='*****@*****.**',
        license='BSD',
        url=
        'http://sysbio.mrc-bsu.cam.ac.uk/johns/pyseqan/docs/build/html/index.html',
        classifiers=[
            'Development Status :: 5 - Production/Stable',
            'Environment :: Console',
            'Intended Audience :: Developers',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: BSD License',
            'Operating System :: MacOS :: MacOS X',
            'Operating System :: POSIX',
            'Operating System :: Microsoft :: Windows',
            'Programming Language :: Python',
            'Programming Language :: C++',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Bio-Informatics',
            'Topic :: Utilities',
        ],
        packages=find_packages(where='python'),
        package_dir={'': 'python'},
        #py_modules           = ['pybool.examples.tutorial']
        package_data={'seqan': ['README', 'LICENSE', 'VERSION']},
        install_requires=[
            'cookbook',
        ],
        #scripts              = ['python/scripts/pybool-find-consistent'],
        ext_modules=[seqanext],

        # 2to3 invocation
        cmdclass={'build_py': build_py},
        include_package_data=False,
    )
Example #42
0
def main():
    from aksetup_helper import (hack_distutils, get_config, setup,
                                NumpyExtension,
                                set_up_shipped_boost_if_requested,
                                check_git_submodules)

    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema(), warn_about_no_config=False)
    EXTRA_OBJECTS, EXTRA_DEFINES = \
            set_up_shipped_boost_if_requested("pyopencl", conf)

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_INCLUDE_DIRS = []

    EXTRA_DEFINES["PYGPU_PACKAGE"] = "pyopencl"
    EXTRA_DEFINES["PYGPU_PYOPENCL"] = "1"

    if conf["CL_TRACE"]:
        EXTRA_DEFINES["PYOPENCL_TRACE"] = 1

    INCLUDE_DIRS = conf["BOOST_INC_DIR"] + conf["CL_INC_DIR"]

    if conf["CL_ENABLE_GL"]:
        EXTRA_DEFINES["HAVE_GL"] = 1

    if conf["CL_ENABLE_DEVICE_FISSION"]:
        EXTRA_DEFINES["PYOPENCL_USE_DEVICE_FISSION"] = 1
    if conf["CL_PRETEND_VERSION"]:
        try:
            major, minor = [
                int(x) for x in conf["CL_PRETEND_VERSION"].split(".")
            ]
            EXTRA_DEFINES["PYOPENCL_PRETEND_CL_VERSION"] = \
                    0x1000*major + 0x10 * minor
        except:
            print("CL_PRETEND_VERSION must be of the form M.N, "
                  "with two integers M and N")
            raise

    ver_dic = {}
    version_file = open("pyopencl/version.py")
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()

    exec(compile(version_file_contents, "pyopencl/version.py", 'exec'),
         ver_dic)

    SEPARATOR = "-" * 75
    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    try:
        import mako  # noqa
    except ImportError:
        print(SEPARATOR)
        print("Mako is not installed.")
        print(SEPARATOR)
        print("That is not a problem, as most of PyOpenCL will be just fine ")
        print("without it.Some higher-level parts of pyopencl (such as ")
        print(
            "pyopencl.reduction) will not function without the templating engine "
        )
        print(
            "Mako [1] being installed. If you would like this functionality to "
        )
        print("work, you might want to install Mako after you finish ")
        print("installing PyOpenCL.")
        print("")
        print("[1] http://www.makotemplates.org/")
        print(SEPARATOR)
        print("Hit Ctrl-C now if you'd like to think about the situation.")
        print(SEPARATOR)

        from aksetup_helper import count_down_delay
        count_down_delay(delay=5)

    might_be_cuda = False
    for inc_dir in conf["CL_INC_DIR"]:
        inc_dir = inc_dir.lower()
        if "nv" in inc_dir or "cuda" in inc_dir:
            might_be_cuda = True

    if might_be_cuda and conf["CL_ENABLE_DEVICE_FISSION"]:
        print(SEPARATOR)
        print("You might be compiling against Nvidia CUDA with device "
              "fission enabled.")
        print(SEPARATOR)
        print("That is not a problem on CUDA 4.0 and newer. If you are "
              "using CUDA 3.2,")
        print(
            "your build will break, because Nvidia shipped a broken CL header in"
        )
        print(
            "in your version. The fix is to set CL_ENABLE_DEVICE_FISSION to False"
        )
        print("in your PyOpenCL configuration.")
        print(SEPARATOR)
        print("Hit Ctrl-C now if you'd like to think about the situation.")
        print(SEPARATOR)

        from aksetup_helper import count_down_delay
        count_down_delay(delay=5)

    import sys
    if sys.version_info >= (3, ):
        pvt_struct_source = "src/wrapper/_pvt_struct_v3.cpp"
    else:
        pvt_struct_source = "src/wrapper/_pvt_struct_v2.cpp"

    setup(
        name="pyopencl",
        # metadata
        version=ver_dic["VERSION_TEXT"],
        description="Python wrapper for OpenCL",
        long_description=open("README.rst", "rt").read(),
        author="Andreas Kloeckner",
        author_email="*****@*****.**",
        license="MIT",
        url="http://mathema.tician.de/software/pyopencl",
        classifiers=[
            'Environment :: Console',
            'Development Status :: 5 - Production/Stable',
            'Intended Audience :: Developers',
            'Intended Audience :: Other Audience',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'Natural Language :: English',
            'Programming Language :: C++',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.4',
            'Programming Language :: Python :: 2.5',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.2',
            'Programming Language :: Python :: 3.3',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Physics',
        ],

        # build info
        packages=["pyopencl", "pyopencl.characterize", "pyopencl.compyte"],
        install_requires=[
            "pytools>=2013.5.2",
            "pytest>=2",
            "decorator>=3.2.0",
            # "Mako>=0.3.6",
        ],
        ext_package="pyopencl",
        ext_modules=[
            NumpyExtension(
                "_cl",
                [
                    "src/wrapper/wrap_cl.cpp",
                    "src/wrapper/wrap_cl_part_1.cpp",
                    "src/wrapper/wrap_cl_part_2.cpp",
                    "src/wrapper/wrap_constants.cpp",
                    "src/wrapper/wrap_mempool.cpp",
                    "src/wrapper/bitlog.cpp",
                ] + EXTRA_OBJECTS,
                include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS + conf["CL_LIB_DIR"],
                libraries=LIBRARIES + conf["CL_LIBNAME"],
                define_macros=list(EXTRA_DEFINES.items()),
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
            NumpyExtension(
                "_pvt_struct",
                [pvt_struct_source],
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
        ],
        include_package_data=True,
        package_data={"pyopencl": [
            "cl/*.cl",
            "cl/*.h",
        ]},

        # 2to3 invocation
        cmdclass={'build_py': build_py},
        zip_safe=False)
Example #43
0
def main():
    from aksetup_helper import (hack_distutils, get_config, setup, Extension,
                                set_up_shipped_boost_if_requested,
                                check_git_submodules)

    check_git_submodules()

    hack_distutils(what_opt=1)
    conf = get_config(get_config_schema())

    TRI_EXTRA_OBJECTS, TRI_EXTRA_DEFINES = \
            set_up_shipped_boost_if_requested("meshpy", conf)
    TET_EXTRA_OBJECTS, TET_EXTRA_DEFINES = TRI_EXTRA_OBJECTS, TRI_EXTRA_DEFINES

    triangle_macros = [
        ("EXTERNAL_TEST", 1),
        ("ANSI_DECLARATORS", 1),
        ("TRILIBRARY", 1),
    ] + list(TRI_EXTRA_DEFINES.items())

    tetgen_macros = [
        ("TETLIBRARY", 1),
        ("SELF_CHECK", 1),
    ] + list(TET_EXTRA_DEFINES.items())

    INCLUDE_DIRS = conf["BOOST_INC_DIR"] + ["src/cpp"]
    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    ######## simple use CMAKE to find get the directories:

    boost_variables = ["VERSION", "INCLUDE_DIRS", "LIB_DIRS", "LIBRARIES"]
    boost_dict = {}
    if sys.version_info.major < 3:
        output = os.popen("cmake . -Dpy_version=2")
    else:
        output = os.popen("cmake .")

    for line in output:
        for var in boost_variables:
            if var in line:
                line = line.replace('-- ' + var,
                                    '').replace(': ', '').replace('\n', '')
                boost_dict[var] = line
    if not "VERSION" in boost_dict:
        print("CMake didn't find any boost library")
        print("default installation will be used instead.")
    else:
        print("use cmake to detect bost")
        lib_name = os.path.basename(boost_dict["LIBRARIES"])
        lib_name = lib_name.replace(".lib", "").replace("lib",
                                                        "").replace(".so", "")
        INCLUDE_DIRS = [boost_dict["INCLUDE_DIRS"]] + ["src/cpp"]
        LIBRARY_DIRS = [boost_dict["LIB_DIRS"]]
        LIBRARIES = [lib_name]
    ########## end of CMAKE configuration

    print("using the following configuration:")
    print("INCLUDE_DIRS: ", INCLUDE_DIRS)
    print("LIBRARY_DIRS: ", LIBRARY_DIRS)
    print("LIBRARIES: ", LIBRARIES)

    init_filename = "meshpy/__init__.py"
    exec(compile(open(init_filename, "r").read(), init_filename, "exec"), conf)

    import codecs
    setup(
        name="MeshPy",
        version=conf["version"],
        description="Triangular and Tetrahedral Mesh Generator",
        long_description=codecs.open("README.rst", "r", "utf-8").read(),
        author="Andreas Kloeckner",
        author_email="*****@*****.**",
        license=
        "MIT for the wrapper/non-commercial for the Triangle/GNU Affero Public License for TetGen",
        url="http://mathema.tician.de/software/meshpy",
        classifiers=[
            'Development Status :: 4 - Beta',
            'Intended Audience :: Developers',
            'Intended Audience :: Other Audience',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'License :: Free for non-commercial use',
            'Natural Language :: English',
            'Programming Language :: C++',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.2',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: Python :: 3.4',
            'Topic :: Multimedia :: Graphics :: 3D Modeling',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Physics',
            'Topic :: Scientific/Engineering :: Visualization',
            'Topic :: Software Development :: Libraries',
        ],
        packages=["meshpy"],
        install_requires=[
            "pytools>=2011.2",
            "pytest>=2",
            "numpy",
            "six",
        ],
        ext_modules=[
            Extension(
                "meshpy._triangle",
                ["src/cpp/wrap_triangle.cpp", "src/cpp/triangle.c"] +
                TRI_EXTRA_OBJECTS,
                include_dirs=INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS,
                libraries=LIBRARIES,
                define_macros=triangle_macros,
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
            Extension(
                "meshpy._tetgen",
                [
                    "src/cpp/tetgen.cpp", "src/cpp/predicates.cpp",
                    "src/cpp/wrap_tetgen.cpp"
                ] + TET_EXTRA_OBJECTS,
                include_dirs=INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS,
                libraries=LIBRARIES,
                define_macros=tetgen_macros,
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
        ])
Example #44
0
def main():
    import glob
    from aksetup_helper import (hack_distutils, get_config, setup, Extension,
                                set_up_shipped_boost_if_requested)

    hack_distutils()
    conf = get_config(get_config_schema(), warn_about_no_config=False)

    EXTRA_OBJECTS, EXTRA_DEFINES = \
            set_up_shipped_boost_if_requested("pymetis", conf)

    INCLUDE_DIRS = conf["BOOST_INC_DIR"]  # noqa
    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]  # noqa
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]  # noqa

    EXTRA_DEFINES["HAVE_MREMAP"] = 0  # mremap() buggy on amd64?

    ver_filename = "pymetis/version.py"
    version_file = open(ver_filename)
    ver_dic = {}
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()
    exec(compile(version_file_contents, ver_filename, 'exec'), ver_dic)

    setup(
        name="PyMetis",
        version=ver_dic["version"],
        description="A Graph Partitioning Package",
        long_description=open("README.rst", "rt").read(),
        author="Andreas Kloeckner",
        author_email="*****@*****.**",
        license="wrapper: MIT/METIS: Apache 2",
        url="http://mathema.tician.de/software/pymetis",
        classifiers=[
            'Development Status :: 4 - Beta',
            'Intended Audience :: Developers',
            'Intended Audience :: Other Audience',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'License :: Free for non-commercial use',
            'Natural Language :: English',
            'Programming Language :: C',
            'Programming Language :: C++',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: Python :: 3.4',
            'Topic :: Multimedia :: Graphics :: 3D Modeling',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Visualization',
            'Topic :: Software Development :: Libraries',
        ],
        packages=["pymetis"],
        install_requires=["six"],
        ext_modules=[
            Extension(
                "pymetis._internal",
                glob.glob("src/metis/GKlib/*.c") + glob.glob("src/metis/*.c") +
                glob.glob("src/metis/libmetis/*.c") +
                ["src/wrapper/wrapper.cpp"] + EXTRA_OBJECTS,
                define_macros=list(EXTRA_DEFINES.items()),
                include_dirs=["src/metis/GKlib"] + ["src/metis/include"] +
                ["src/metis/libmetis"] + INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS,
                libraries=LIBRARIES,
                extra_compile_args=conf["CXXFLAGS"],
            ),
        ])
Example #45
0
def main():
    from setuptools import find_packages
    from aksetup_helper import (hack_distutils, get_config, setup,
                                ExtensionUsingNumpy, check_pybind11,
                                PybindBuildExtCommand, get_pybind_include)

    hack_distutils()
    conf = get_config(get_config_schema(), warn_about_no_config=False)

    extra_defines = {}
    extra_include_dirs = []
    extra_library_dirs = []
    extra_libraries = []

    ver_dic = {}
    ver_file_name = "pyvisfile/__init__.py"
    with open(ver_file_name) as inf:
        exec(compile(inf.read(), ver_file_name, "exec"), ver_dic)

    requirements = []
    ext_modules = []

    if conf["USE_SILO"]:
        check_pybind11()

        extra_defines["USE_SILO"] = 1
        extra_include_dirs.extend(conf["SILO_INC_DIR"])
        extra_library_dirs.extend(conf["SILO_LIB_DIR"])
        extra_libraries.extend(conf["SILO_LIBNAME"])

        ext_modules.append(
            ExtensionUsingNumpy(
                "_internal",
                ["src/wrapper/wrap_silo.cpp"],
                include_dirs=[get_pybind_include()] + extra_include_dirs,
                library_dirs=extra_library_dirs,
                libraries=extra_libraries,
                extra_compile_args=conf["CXXFLAGS"],
                define_macros=list(extra_defines.items()),
                language="c++",
            ))
        requirements.append("pybind11>=2.5.0")

    setup(
        name="pyvisfile",
        version=ver_dic["VERSION_TEXT"],
        description="Large-scale Visualization Data Storage",
        long_description=open("README.rst").read(),
        classifiers=[
            "Development Status :: 4 - Beta",
            "Intended Audience :: Developers",
            "Intended Audience :: Other Audience",
            "Intended Audience :: Science/Research",
            "License :: OSI Approved :: MIT License",
            "Natural Language :: English",
            "Programming Language :: C++",
            "Programming Language :: Python",
            "Programming Language :: Python :: 3",
            "Topic :: Multimedia :: Graphics :: 3D Modeling",
            "Topic :: Scientific/Engineering",
            "Topic :: Scientific/Engineering :: Mathematics",
            "Topic :: Scientific/Engineering :: Physics",
            "Topic :: Scientific/Engineering :: Visualization",
            "Topic :: Software Development :: Libraries",
        ],
        author="Andreas Kloeckner",
        author_email="*****@*****.**",
        license="MIT",
        url="http://mathema.tician.de/software/pyvisfile",

        # dependencies
        setup_requires=requirements,
        python_requires="~=3.6",
        install_requires=[
            "pytools>=2013.2",
        ] + requirements,
        packages=find_packages(),
        ext_package="pyvisfile.silo",
        ext_modules=ext_modules,
        cmdclass={"build_ext": PybindBuildExtCommand},
        zip_safe=False)
Example #46
0
def main():
    import glob
    from aksetup_helper import hack_distutils, get_config, setup, \
            PyUblasExtension

    hack_distutils()
    conf = get_config(get_config_schema())

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_DEFINES = { "PYUBLAS_HAVE_BOOST_BINDINGS":1 }
    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    INCLUDE_DIRS = [
            "src/cpp",
            ] \
            + conf["BOOST_BINDINGS_INC_DIR"] \
            + conf["BOOST_INC_DIR"] \

    conf["BLAS_INC_DIR"] = []
    conf["USE_BLAS"] = conf["HAVE_BLAS"]

    def handle_component(comp):
        if conf["USE_"+comp]:
            EXTRA_DEFINES["USE_"+comp] = 1
            EXTRA_INCLUDE_DIRS.extend(conf[comp+"_INC_DIR"])
            EXTRA_LIBRARY_DIRS.extend(conf[comp+"_LIB_DIR"])
            EXTRA_LIBRARIES.extend(conf[comp+"_LIBNAME"])

    handle_component("BLAS")

    setup(name="hedge",
            # metadata
            version="0.91",
            description="Hybrid Easy Discontinuous Galerkin Environment",
            long_description="""
            hedge is an unstructured, high-order, parallel
            Discontinuous Galerkin solver for partial differential
            equations.

            Features:

            * Supports simplicial unstructured meshes in two and
              three dimensions (i.e. triangles and tetrahedra)
            * Approximates using orthogonal polynomials of any degree
              (and therefore to any order of accuracy) you specify at
              runtime
            * Solves PDEs in parallel using MPI
            * Easy to use
            * Powerful Parallel Visualization
            """,
            author=u"Andreas Kloeckner",
            author_email="*****@*****.**",
            license="MIT",
            url="http://mathema.tician.de/software/hedge",
            classifiers=[
              'Environment :: Console',
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: MIT License',
              'Natural Language :: English',
              'Programming Language :: C++',
              'Programming Language :: Python',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Physics',
              'Topic :: Scientific/Engineering :: Visualization',
              ],

            # build info
            packages=[
                    "hedge",
                    "hedge.flux",
                    "hedge.optemplate",
                    "hedge.optemplate.mappers",
                    "hedge.models",
                    "hedge.models.gas_dynamics",
                    "hedge.backends",
                    "hedge.backends.jit",
                    "hedge.backends.mpi",
                    "hedge.backends.cuda",
                    "hedge.timestep",
                    "hedge.timestep.multirate_ab",
                    "hedge.mesh",
                    "hedge.mesh.reader",
                    "hedge.discretization",
                    "hedge.tools",
                    ],

            ext_package="hedge",

            setup_requires=[
                "PyUblas>=0.93.1",
                ],
            install_requires=[
                "PyUblas>=0.93.1",
                "pytools>=10",
                "cgen",
                "codepy>=0.90",
                "pymbolic>=0.90",
                "meshpy>=0.91",
                "decorator>=3.2.0"
                ],
            extras_require = {
                "silo": ["pyvisfile"],
                "parallel": ["PyMetis>=0.91"],
                },

            ext_modules=[
                PyUblasExtension("_internal",
                    ["src/wrapper/wrap_main.cpp",
                        "src/wrapper/wrap_base.cpp",
                        "src/wrapper/wrap_mesh.cpp",
                        "src/wrapper/wrap_special_function.cpp",
                        "src/wrapper/wrap_flux.cpp",
                        "src/wrapper/wrap_volume_operators.cpp",
                        ],
                    include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                    library_dirs=LIBRARY_DIRS + EXTRA_LIBRARY_DIRS,
                    libraries=LIBRARIES + EXTRA_LIBRARIES,
                    define_macros=list(EXTRA_DEFINES.iteritems()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                ],
            data_files=[
            ("include/hedge", glob.glob("src/cpp/hedge/*.hpp")),
            ],
            )
Example #47
0
def main():
    from aksetup_helper import (hack_distutils,
            get_config, setup, Extension, set_up_shipped_boost_if_requested,
            check_git_submodules)

    check_git_submodules()

    hack_distutils(what_opt=1)
    conf = get_config(get_config_schema())

    TRI_EXTRA_OBJECTS, TRI_EXTRA_DEFINES = \
            set_up_shipped_boost_if_requested("meshpy", conf)
    TET_EXTRA_OBJECTS, TET_EXTRA_DEFINES = TRI_EXTRA_OBJECTS, TRI_EXTRA_DEFINES

    triangle_macros = [
            ("EXTERNAL_TEST", 1),
            ("ANSI_DECLARATORS", 1),
            ("TRILIBRARY", 1),
            ] + list(TRI_EXTRA_DEFINES.items())

    tetgen_macros = [
            ("TETLIBRARY", 1),
            ("SELF_CHECK", 1),
            ] + list(TET_EXTRA_DEFINES.items())

    INCLUDE_DIRS = conf["BOOST_INC_DIR"] + ["src/cpp"]
    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    init_filename = "meshpy/__init__.py"
    exec(compile(open(init_filename, "r").read(), init_filename, "exec"), conf)

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    import codecs
    setup(name="MeshPy",
          version=conf["version"],
          description="Triangular and Tetrahedral Mesh Generator",
          long_description=codecs.open("README.rst", "r", "utf-8").read(),
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          license="MIT for the wrapper/non-commercial MIT for the meshers",
          url="http://mathema.tician.de/software/meshpy",
          classifiers=[
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: MIT License',
              'License :: Free for non-commercial use',
              'Natural Language :: English',
              'Programming Language :: C++',
              'Programming Language :: Python',
              'Programming Language :: Python :: 3',
              'Topic :: Multimedia :: Graphics :: 3D Modeling',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Physics',
              'Topic :: Scientific/Engineering :: Visualization',
              'Topic :: Software Development :: Libraries',
              ],

          packages=["meshpy"],
          install_requires=[
                  "pytools>=2011.2",
                  "pytest>=2",
                  "numpy",
                  ],
          ext_modules=[
              Extension(
                  "meshpy._triangle",
                  ["src/cpp/wrap_triangle.cpp", "src/cpp/triangle.c"]
                  + TRI_EXTRA_OBJECTS,
                  include_dirs=INCLUDE_DIRS,
                  library_dirs=LIBRARY_DIRS,
                  libraries=LIBRARIES,
                  define_macros=triangle_macros,
                  extra_compile_args=conf["CXXFLAGS"],
                  extra_link_args=conf["LDFLAGS"],
                  ),
              Extension(
                  "meshpy._tetgen",
                  [
                      "src/cpp/tetgen.cpp",
                      "src/cpp/predicates.cpp",
                      "src/cpp/wrap_tetgen.cpp"]
                  + TET_EXTRA_OBJECTS,
                  include_dirs=INCLUDE_DIRS,
                  library_dirs=LIBRARY_DIRS,
                  libraries=LIBRARIES,
                  define_macros=tetgen_macros,
                  extra_compile_args=conf["CXXFLAGS"],
                  extra_link_args=conf["LDFLAGS"],
                  ),
              ],

          # 2to3 invocation
          cmdclass={'build_py': build_py},
          )
Example #48
0
def main():
    import os
    from aksetup_helper import (hack_distutils, get_config, setup,
            NumpyExtension, set_up_shipped_boost_if_requested,
            check_git_submodules)

    #check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema(),
            warn_about_no_config=False)

    EXTRA_OBJECTS, EXTRA_DEFINES = \
            set_up_shipped_boost_if_requested(
                    "pyviennacl", conf,
                    source_path="external/boost-python-ublas-subset/boost_subset",
                    boost_chrono="header_only")

    INCLUDE_DIRS = conf["BOOST_INC_DIR"] + [
            "external/boost_numpy/"
            ]
    if conf["USE_SHIPPED_VIENNACL"]:
        INCLUDE_DIRS += ["external/viennacl-dev/"]

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    # {{{ get version number

    ver_dic = {}
    version_file = open("pyviennacl/version.py")
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()

    exec(compile(version_file_contents, "pyviennacl/version.py", 'exec'), ver_dic)

    # }}}

    platform_cflags["msvc"] = ["/EHsc"]
    platform_cflags["mingw32"] = ["-Wno-unused-function"]
    platform_cflags["unix"] = ["-Wno-unused-function"]

    if conf["USE_OPENCL"]:
        EXTRA_DEFINES["VIENNACL_WITH_OPENCL"] = None

    if conf["USE_OPENMP"]:
        EXTRA_DEFINES["VIENNACL_WITH_OPENMP"] = None
        platform_cflags["unix"] += ["-fopenmp"]

    EXTRA_DEFINES["VIENNACL_WITH_UBLAS"] = None

    UNDEF_MACROS = []
    if conf["DEBUG"]:
         UNDEF_MACROS += ['NDEBUG']
         #EXTRA_DEFINES["VIENNACL_DEBUG_ALL"] = None
         EXTRA_DEFINES["VIENNACL_BUILD_INFO"] = None
         platform_cflags["unix"] += ["-O0","-ggdb"]

    if not sys.platform.startswith("darwin"):
        platform_libs['unix'] = ['rt']

    if EXTRA_OBJECTS:
        platform_cflags['mingw32'] += ["-Wno-unused-local-typedefs"]
        if not sys.platform.startswith("darwin"):
            platform_cflags['unix'] += ["-Wno-unused-local-typedefs"]

    source_files = [
        "core", "scalars",
        "vector_float", "vector_double", "vector_int", "vector_long",
        "vector_uint", "vector_ulong",

        "dense_matrix_float", "dense_matrix_double",
        "dense_matrix_int", "dense_matrix_long",
        "dense_matrix_uint", "dense_matrix_ulong",

        "structured_matrices",

        "cpu_compressed_matrix",
        "compressed_matrix", "compressed_compressed_matrix",
        "coordinate_matrix", "ell_matrix", "hyb_matrix",
        "preconditioners","direct_solvers", "iterative_solvers",

        "extra_functions", "eig", #"bandwidth_reduction",

        "scheduler", "platform_support", "opencl_support"]

    from glob import glob

    try:
        long_description = open("README.rst", "rt", encoding='utf8').read()
    except:
        long_description = open("README.rst", "rt").read()

    setup(
        name="pyviennacl",
        version=ver_dic["VERSION_TEXT"],
        description="Sparse/dense linear algebra on GPUs and CPUs using OpenCL",
        long_description=long_description,
        author='Toby St Clere Smithe',
        author_email='*****@*****.**',
        url="http://viennacl.sourceforge.net/pyviennacl.html",
        classifiers=[
            'Environment :: Console',
            'Development Status :: 5 - Production/Stable',
            'Intended Audience :: Developers',
            'Intended Audience :: Other Audience',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'Natural Language :: English',
            'Programming Language :: C++',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.2',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: Python :: 3.4',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Physics',
        ],
        setup_requires=['numpy>=1.7'],
        install_requires=['numpy>=1.7'],

        packages=["pyviennacl"],
        ext_package="pyviennacl",
        ext_modules=[NumpyExtension(
            "_viennacl",

            [os.path.join("src", "_viennacl", sf + ".cpp")
             for sf in source_files]
            + glob("external/boost_numpy/libs/numpy/src/*.cpp")
            + EXTRA_OBJECTS,
            depends=[os.path.join("src", "_viennacl", "viennacl.h")],

            extra_compile_args=conf["CXXFLAGS"],
            extra_link_args=conf["LDFLAGS"],

            define_macros=list(EXTRA_DEFINES.items()),
            undef_macros=UNDEF_MACROS,

            include_dirs=INCLUDE_DIRS,
            library_dirs=LIBRARY_DIRS + conf["CL_LIB_DIR"] + conf["OpenMP_LIB_DIR"],
            libraries=LIBRARIES + conf["CL_LIBNAME"] + conf["OpenMP_LIBNAME"],
        )],
        cmdclass={'build_ext': build_ext_subclass}
    )
Example #49
0
File: setup.py Project: gimac/hedge
def main():
    from aksetup_helper import hack_distutils, get_config, setup, \
            PyUblasExtension

    hack_distutils()
    conf = get_config(get_config_schema())

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_DEFINES = {"PYUBLAS_HAVE_BOOST_BINDINGS": 1}
    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    INCLUDE_DIRS = [
            "hedge/include",
            ] \
            + conf["BOOST_BINDINGS_INC_DIR"] \
            + conf["BOOST_INC_DIR"] \

    conf["BLAS_INC_DIR"] = []
    conf["USE_BLAS"] = conf["HAVE_BLAS"]

    def handle_component(comp):
        if conf["USE_"+comp]:
            EXTRA_DEFINES["USE_"+comp] = 1
            EXTRA_INCLUDE_DIRS.extend(conf[comp+"_INC_DIR"])
            EXTRA_LIBRARY_DIRS.extend(conf[comp+"_LIB_DIR"])
            EXTRA_LIBRARIES.extend(conf[comp+"_LIBNAME"])

    handle_component("BLAS")

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    setup(name="hedge",
            # metadata
            version="0.91",
            description="Hybrid Easy Discontinuous Galerkin Environment",
            long_description=open("README.rst", "rt").read(),
            author=u"Andreas Kloeckner",
            author_email="*****@*****.**",
            license="MIT",
            url="http://mathema.tician.de/software/hedge",
            classifiers=[
                'Environment :: Console',
                'Development Status :: 4 - Beta',
                'Intended Audience :: Developers',
                'Intended Audience :: Other Audience',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: MIT License',
                'Natural Language :: English',
                'Programming Language :: C++',
                'Programming Language :: Python',
                'Programming Language :: Python :: 2',
                'Programming Language :: Python :: 2.6',
                'Programming Language :: Python :: 2.7',
                'Programming Language :: Python :: 3',
                'Programming Language :: Python :: 3.2',
                'Programming Language :: Python :: 3.3',
                'Topic :: Scientific/Engineering',
                'Topic :: Scientific/Engineering :: Mathematics',
                'Topic :: Scientific/Engineering :: Physics',
                'Topic :: Scientific/Engineering :: Visualization',
                ],

            # build info
            packages=[
                    "hedge",
                    "hedge.flux",
                    "hedge.optemplate",
                    "hedge.optemplate.mappers",
                    "hedge.models",
                    "hedge.models.gas_dynamics",
                    "hedge.backends",
                    "hedge.backends.jit",
                    "hedge.backends.mpi",
                    "hedge.backends.cuda",
                    "hedge.timestep",
                    "hedge.timestep.multirate_ab",
                    "hedge.mesh",
                    "hedge.mesh.reader",
                    "hedge.discretization",
                    "hedge.tools",
                    ],

            ext_package="hedge",

            setup_requires=[
                "PyUblas>=2013.1",
                ],
            install_requires=[
                # This is *not* redundant. Distribute will delete PyUblas
                # after install if this is not here.
                "PyUblas>=2013.1",

                "pytools>=10",
                "cgen",
                "codepy>=2013.1",
                "pymbolic>=2013.3.3",
                "meshpy>=2013.1",
                "decorator>=3.2.0",
                "pytest>=2"
                ],
            extras_require={
                "silo": ["pyvisfile"],
                "parallel": ["PyMetis>=0.91"],
                },

            ext_modules=[
                PyUblasExtension("_internal",
                    [
                        "src/wrapper/wrap_main.cpp",
                        "src/wrapper/wrap_base.cpp",
                        "src/wrapper/wrap_mesh.cpp",
                        "src/wrapper/wrap_special_function.cpp",
                        "src/wrapper/wrap_flux.cpp",
                        "src/wrapper/wrap_volume_operators.cpp",
                        ],
                    include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                    library_dirs=LIBRARY_DIRS + EXTRA_LIBRARY_DIRS,
                    libraries=LIBRARIES + EXTRA_LIBRARIES,
                    define_macros=list(EXTRA_DEFINES.items()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    ),
                ],

            zip_safe=False,

            include_package_data=True,
            package_data={
                    "hedge": [
                        "include/hedge/*.hpp",
                        ]
                    },

            # 2to3 invocation
            cmdclass={'build_py': build_py})
Example #50
0
def main():
    import sys

    from aksetup_helper import (hack_distutils, get_config, setup,
                                NumpyExtension,
                                set_up_shipped_boost_if_requested,
                                check_git_submodules)

    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema())

    EXTRA_SOURCES, EXTRA_DEFINES = set_up_shipped_boost_if_requested(
        "pycuda", conf)

    EXTRA_DEFINES["PYGPU_PACKAGE"] = "pycuda"
    EXTRA_DEFINES["PYGPU_PYCUDA"] = "1"

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"] + conf["CUDADRV_LIB_DIR"]
    LIBRARIES = (conf["BOOST_PYTHON_LIBNAME"] + conf["BOOST_THREAD_LIBNAME"] +
                 conf["CUDADRV_LIBNAME"])

    if not conf["CUDA_INC_DIR"] and conf["CUDA_ROOT"]:
        conf["CUDA_INC_DIR"] = [join(conf["CUDA_ROOT"], "include")]

    if conf["CUDA_TRACE"]:
        EXTRA_DEFINES["CUDAPP_TRACE_CUDA"] = 1

    if conf["CUDA_PRETEND_VERSION"]:
        EXTRA_DEFINES["CUDAPP_PRETEND_CUDA_VERSION"] = conf[
            "CUDA_PRETEND_VERSION"]

    INCLUDE_DIRS = ['src/cpp'] + conf["BOOST_INC_DIR"]
    if conf["CUDA_INC_DIR"]:
        INCLUDE_DIRS += conf["CUDA_INC_DIR"]

    conf["USE_CUDA"] = True

    if 'darwin' in sys.platform and sys.maxsize == 2147483647:
        # The Python interpreter is running in 32 bit mode on OS X
        if "-arch" not in conf["CXXFLAGS"]:
            conf["CXXFLAGS"].extend(['-arch', 'i386', '-m32'])
        if "-arch" not in conf["LDFLAGS"]:
            conf["LDFLAGS"].extend(['-arch', 'i386', '-m32'])

    if 'darwin' in sys.platform:
        # set path to Cuda dynamic libraries,
        # as a safe substitute for DYLD_LIBRARY_PATH
        for lib_dir in conf["CUDADRV_LIB_DIR"]:
            conf["LDFLAGS"].extend(["-Xlinker", "-rpath", "-Xlinker", lib_dir])

    if conf["CUDA_ENABLE_GL"]:
        EXTRA_SOURCES.append("src/wrapper/wrap_cudagl.cpp")
        EXTRA_DEFINES["HAVE_GL"] = 1

    if conf["CUDA_ENABLE_CURAND"]:
        EXTRA_DEFINES["HAVE_CURAND"] = 1
        EXTRA_SOURCES.extend(["src/wrapper/wrap_curand.cpp"])
        LIBRARIES.extend(conf["CURAND_LIBNAME"])
        LIBRARY_DIRS.extend(conf["CURAND_LIB_DIR"])

    ver_dic = {}
    exec(
        compile(
            open("pycuda/__init__.py").read(), "pycuda/__init__.py", 'exec'),
        ver_dic)

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    import sys
    if sys.version_info >= (3, ):
        pvt_struct_source = "src/wrapper/_pvt_struct_v3.cpp"
    else:
        pvt_struct_source = "src/wrapper/_pvt_struct_v2.cpp"

    setup(
        name="pycuda",
        # metadata
        version=ver_dic["VERSION_TEXT"],
        description="Python wrapper for Nvidia CUDA",
        long_description=open("README.rst", "rt").read(),
        author="Andreas Kloeckner",
        author_email="*****@*****.**",
        license="MIT",
        url="http://mathema.tician.de/software/pycuda",
        classifiers=[
            'Environment :: Console',
            'Development Status :: 5 - Production/Stable',
            'Intended Audience :: Developers',
            'Intended Audience :: Other Audience',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'Natural Language :: English',
            'Programming Language :: C++',
            'Programming Language :: Python',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: Python :: 3.4',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Physics',
            'Topic :: Scientific/Engineering :: Visualization',
        ],

        # build info
        packages=["pycuda", "pycuda.gl", "pycuda.sparse", "pycuda.compyte"],
        install_requires=[
            "pytools>=2011.2", "pytest>=2", "decorator>=3.2.0",
            "appdirs>=1.4.0"
        ],
        ext_package="pycuda",
        ext_modules=[
            NumpyExtension(
                "_driver",
                [
                    "src/cpp/cuda.cpp",
                    "src/cpp/bitlog.cpp",
                    "src/wrapper/wrap_cudadrv.cpp",
                    "src/wrapper/mempool.cpp",
                ] + EXTRA_SOURCES,
                include_dirs=INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS,
                libraries=LIBRARIES,
                define_macros=list(EXTRA_DEFINES.items()),
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
            NumpyExtension(
                "_pvt_struct",
                [pvt_struct_source],
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
        ],
        include_package_data=True,
        package_data={"pycuda": [
            "cuda/*.hpp",
        ]},
        zip_safe=False,

        # 2to3 invocation
        cmdclass={'build_py': build_py})
Example #51
0
def main():
    from aksetup_helper import hack_distutils, get_config, setup, \
            HedgeExtension

    hack_distutils()
    conf = get_config(get_config_schema())

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_DEFINES = {
            "PYUBLAS_HAVE_BOOST_BINDINGS": 1,
            }
    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    INCLUDE_DIRS = ["src/cpp"] \
            + conf["BOOST_BINDINGS_INC_DIR"] \
            + conf["BOOST_INC_DIR"]

    conf["BLAS_INC_DIR"] = []
    conf["LAPACK_INC_DIR"] = []
    conf["USE_BLAS"] = True
    conf["USE_LAPACK"] = True

    def handle_component(comp):
        if conf["USE_"+comp]:
            EXTRA_DEFINES["USE_"+comp] = 1
            EXTRA_INCLUDE_DIRS.extend(conf[comp+"_INC_DIR"])
            EXTRA_LIBRARY_DIRS.extend(conf[comp+"_LIB_DIR"])
            EXTRA_LIBRARIES.extend(conf[comp+"_LIBNAME"])

    handle_component("LAPACK")
    handle_component("BLAS")

    setup(
            name="pyrticle",
            version="0.90",
            description="A high-order PIC code using Hedge",
            author=u"Andreas Kloeckner",
            author_email="*****@*****.**",
            license="GPLv3",
            url="http://mathema.tician.de/software/pyrticle",

            scripts=["bin/pyrticle"],

            packages=["pyrticle", "pyrticle.deposition"],
            ext_package="pyrticle",
            ext_modules=[
                HedgeExtension("_internal",
                    [
                        "src/cpp/tools.cpp",
                        "src/wrapper/wrap_tools.cpp",
                        "src/wrapper/wrap_grid.cpp",
                        "src/wrapper/wrap_meshdata.cpp",
                        "src/wrapper/wrap_pic.cpp",
                        "src/wrapper/wrap_pusher.cpp",
                        "src/wrapper/wrap_depositor.cpp",
                        "src/wrapper/wrap_main.cpp",
                        ],
                    include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                    library_dirs=LIBRARY_DIRS + EXTRA_LIBRARY_DIRS,
                    libraries=LIBRARIES + EXTRA_LIBRARIES,
                    extra_compile_args=conf["CXXFLAGS"],
                    define_macros=list(EXTRA_DEFINES.iteritems()),
                    )]
                )
Example #52
0
def main():
    import glob
    from aksetup_helper import (
            hack_distutils, get_config, setup, Extension,
            set_up_shipped_boost_if_requested)

    hack_distutils()
    conf = get_config(get_config_schema())

    INCLUDE_DIRS = conf["BOOST_INC_DIR"]
    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    EXTRA_OBJECTS, EXTRA_DEFINES = \
            set_up_shipped_boost_if_requested("pyopencl", conf)

    EXTRA_DEFINES["HAVE_MREMAP"] = 0  # mremap() buggy on amd64?

    version_file = open("pymetis/__init__.py")
    ver_dic = {}
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()
    exec(compile(version_file_contents, "pymetis/__init__.py", 'exec'), ver_dic)

    setup(name="PyMetis",
          version=ver_dic["version"],
          description="A Graph Partitioning Package",
          long_description=open("README.rst", "rt").read(),
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          license="wrapper: MIT/METIS: Apache 2",
          url="http://mathema.tician.de/software/pymetis",
          classifiers=[
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Intended Audience :: Other Audience',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: MIT License',
              'License :: Free for non-commercial use',
              'Natural Language :: English',
              'Programming Language :: C',
              'Programming Language :: C++',
              'Programming Language :: Python',
              'Programming Language :: Python :: 2',
              'Programming Language :: Python :: 2.6',
              'Programming Language :: Python :: 2.7',
              'Programming Language :: Python :: 3',
              'Programming Language :: Python :: 3.3',
              'Programming Language :: Python :: 3.4',
              'Topic :: Multimedia :: Graphics :: 3D Modeling',
              'Topic :: Scientific/Engineering',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Topic :: Scientific/Engineering :: Visualization',
              'Topic :: Software Development :: Libraries',
              ],

          packages=["pymetis"],
          ext_modules=[
              Extension(
                  "pymetis._internal",
                  glob.glob("src/metis/GKlib/*.c") +
                  glob.glob("src/metis/*.c") +
                  glob.glob("src/metis/libmetis/*.c") +
                  ["src/wrapper/wrapper.cpp"],
                  define_macros=list(EXTRA_DEFINES.items()),
                  include_dirs=["src/metis/GKlib"] +
                  ["src/metis/include"] +
                  ["src/metis/libmetis"] +
                  INCLUDE_DIRS,
                  library_dirs=LIBRARY_DIRS,
                  libraries=LIBRARIES,
                  extra_compile_args=conf["CXXFLAGS"],
                  ),
              ]
          )
Example #53
0
def main():
    from setuptools import find_packages
    from aksetup_helper import (hack_distutils, get_config, setup,
            check_pybind11, check_git_submodules, NumpyExtension)
    check_pybind11()
    check_git_submodules()

    hack_distutils()
    conf = get_config(get_config_schema(),
            warn_about_no_config=False)

    extra_defines = {}

    extra_defines["PYGPU_PACKAGE"] = "pyopencl"
    extra_defines["PYGPU_PYOPENCL"] = "1"

    if conf["CL_TRACE"]:
        extra_defines["PYOPENCL_TRACE"] = 1

    if conf["CL_ENABLE_GL"]:
        extra_defines["HAVE_GL"] = 1

    if conf["CL_USE_SHIPPED_EXT"]:
        extra_defines["PYOPENCL_USE_SHIPPED_EXT"] = 1

    if conf["CL_PRETEND_VERSION"]:
        try:
            major, minor = [int(x) for x in conf["CL_PRETEND_VERSION"].split(".")]
            extra_defines["PYOPENCL_PRETEND_CL_VERSION"] = \
                    0x1000*major + 0x10 * minor
        except Exception:
            print("CL_PRETEND_VERSION must be of the form M.N, "
                    "with two integers M and N")
            raise

    conf["EXTRA_DEFINES"] = extra_defines

    INCLUDE_DIRS = conf["CL_INC_DIR"] + ["pybind11/include"]  # noqa: N806

    ver_dic = {}
    version_file = open("pyopencl/version.py")
    try:
        version_file_contents = version_file.read()
    finally:
        version_file.close()

    exec(compile(version_file_contents, "pyopencl/version.py", 'exec'), ver_dic)

    try:
        import mako  # noqa
    except ImportError:
        print(SEPARATOR)
        print("Mako is not installed.")
        print(SEPARATOR)
        print("That is not a problem, as most of PyOpenCL will be just fine ")
        print("without it. Some higher-level parts of pyopencl (such as ")
        print("pyopencl.reduction) will not function without the templating engine ")
        print("Mako [1] being installed. If you would like this functionality to ")
        print("work, you might want to install Mako after you finish ")
        print("installing PyOpenCL.")
        print("")
        print("Simply type")
        print("python -m pip install mako")
        print("either now or after the installation completes to fix this.")
        print("")
        print("[1] http://www.makotemplates.org/")
        print(SEPARATOR)
        print("Hit Ctrl-C now if you'd like to think about the situation.")
        print(SEPARATOR)

        from aksetup_helper import count_down_delay
        count_down_delay(delay=5)

    if not exists("pyopencl/compyte/dtypes.py"):
        print(75 * "-")
        print("You are missing important files from the pyopencl distribution.")
        print(75 * "-")
        print("You may have downloaded a zip or tar file from Github.")
        print("Those do not work, and I am unable to prevent Github from showing")
        print("them. Delete that file, and get an actual release file from the")
        print("Python package index:")
        print()
        print("https://pypi.python.org/pypi/pyopencl")
        sys.exit(1)

    setup(name="pyopencl",
            # metadata
            version=ver_dic["VERSION_TEXT"],
            description="Python wrapper for OpenCL",
            long_description=open("README.rst", "rt").read(),
            author="Andreas Kloeckner",
            author_email="*****@*****.**",
            license="MIT",
            url="http://mathema.tician.de/software/pyopencl",
            classifiers=[
                'Environment :: Console',
                'Development Status :: 5 - Production/Stable',
                'Intended Audience :: Developers',
                'Intended Audience :: Other Audience',
                'Intended Audience :: Science/Research',
                'License :: OSI Approved :: MIT License',
                'Natural Language :: English',
                'Programming Language :: C++',
                'Programming Language :: Python',
                'Programming Language :: Python :: 2',
                'Programming Language :: Python :: 2.7',
                'Programming Language :: Python :: 3',
                'Programming Language :: Python :: 3.2',
                'Programming Language :: Python :: 3.3',
                'Topic :: Scientific/Engineering',
                'Topic :: Scientific/Engineering :: Mathematics',
                'Topic :: Scientific/Engineering :: Physics',
                ],

            # build info
            packages=find_packages(),

            ext_modules=[
                NumpyExtension("pyopencl._cl",
                    [
                        "src/wrap_constants.cpp",
                        "src/wrap_cl.cpp",
                        "src/wrap_cl_part_1.cpp",
                        "src/wrap_cl_part_2.cpp",
                        "src/wrap_mempool.cpp",
                        "src/bitlog.cpp",
                        ],
                    include_dirs=INCLUDE_DIRS + [
                        get_pybind_include(),
                        get_pybind_include(user=True)
                        ],
                    library_dirs=conf["CL_LIB_DIR"],
                    libraries=conf["CL_LIBNAME"],
                    define_macros=list(conf["EXTRA_DEFINES"].items()),
                    extra_compile_args=conf["CXXFLAGS"],
                    extra_link_args=conf["LDFLAGS"],
                    language='c++',
                    ),
                ],

            setup_requires=[
                "pybind11",
                "numpy",
                ],

            install_requires=[
                "numpy",
                "pytools>=2017.6",
                "decorator>=3.2.0",
                "appdirs>=1.4.0",
                "six>=1.9.0",
                # "Mako>=0.3.6",
                ],

            include_package_data=True,
            package_data={
                    "pyopencl": [
                        "cl/*.cl",
                        "cl/*.h",
                        "cl/pyopencl-random123/*.cl",
                        "cl/pyopencl-random123/*.h",
                        ]
                    },

            cmdclass={'build_ext': BuildExt},
            zip_safe=False)
Example #54
0
def main():
    import glob
    from aksetup_helper import (hack_distutils, get_config, setup, \
            NumpyExtension, Extension, set_up_shipped_boost_if_requested)

    hack_distutils()
    conf = get_config(get_config_schema())
    EXTRA_SOURCES, EXTRA_DEFINES = set_up_shipped_boost_if_requested(conf)

    EXTRA_DEFINES["PYGPU_PACKAGE"] = "pycuda"
    EXTRA_DEFINES["PYGPU_PYCUDA"] = "1"

    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"] + conf["BOOST_THREAD_LIBNAME"]

    from os.path import dirname, join, normpath

    if conf["CUDA_ROOT"] is None:
        nvcc_path = search_on_path(["nvcc", "nvcc.exe"])
        if nvcc_path is None:
            print("*** CUDA_ROOT not set, and nvcc not in path. Giving up.")
            import sys
            sys.exit(1)

        conf["CUDA_ROOT"] = normpath(join(dirname(nvcc_path), ".."))

    if conf["CUDA_INC_DIR"] is None:
        conf["CUDA_INC_DIR"] = [join(conf["CUDA_ROOT"], "include")]
    if not conf["CUDADRV_LIB_DIR"]:
        conf["CUDADRV_LIB_DIR"] = [join(conf["CUDA_ROOT"], "lib")]

    verify_siteconfig(conf)

    EXTRA_INCLUDE_DIRS = []
    EXTRA_LIBRARY_DIRS = []
    EXTRA_LIBRARIES = []

    if conf["CUDA_TRACE"]:
        EXTRA_DEFINES["CUDAPP_TRACE_CUDA"] = 1

    if conf["CUDA_PRETEND_VERSION"]:
        EXTRA_DEFINES["CUDAPP_PRETEND_CUDA_VERSION"] = conf[
            "CUDA_PRETEND_VERSION"]

    INCLUDE_DIRS = ['src/cpp'] + conf["BOOST_INC_DIR"] + conf["CUDA_INC_DIR"]
    conf["USE_CUDA"] = True

    import sys

    if 'darwin' in sys.platform and sys.maxsize == 2147483647:
        # The Python interpreter is running in 32 bit mode on OS X
        if "-arch" not in conf["CXXFLAGS"]:
            conf["CXXFLAGS"].extend(['-arch', 'i386', '-m32'])
        if "-arch" not in conf["LDFLAGS"]:
            conf["LDFLAGS"].extend(['-arch', 'i386', '-m32'])

    ext_kwargs = dict()

    if conf["CUDA_ENABLE_GL"]:
        EXTRA_SOURCES.append("src/wrapper/wrap_cudagl.cpp")
        EXTRA_DEFINES["HAVE_GL"] = 1

    ver_dic = {}
    exec(
        compile(
            open("pycuda/__init__.py").read(), "pycuda/__init__.py", 'exec'),
        ver_dic)

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    setup(
        name="pycuda",
        # metadata
        version=ver_dic["VERSION_TEXT"],
        description="Python wrapper for Nvidia CUDA",
        long_description="""
            PyCUDA lets you access `Nvidia <http://nvidia.com>`_'s `CUDA
            <http://nvidia.com/cuda/>`_ parallel computation API from Python.
            Several wrappers of the CUDA API already exist-so what's so special
            about PyCUDA?

            * Object cleanup tied to lifetime of objects. This idiom, often
              called
              `RAII <http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>`_
              in C++, makes it much easier to write correct, leak- and
              crash-free code. PyCUDA knows about dependencies, too, so (for
              example) it won't detach from a context before all memory
              allocated in it is also freed.

            * Convenience. Abstractions like pycuda.driver.SourceModule and
              pycuda.gpuarray.GPUArray make CUDA programming even more
              convenient than with Nvidia's C-based runtime.

            * Completeness. PyCUDA puts the full power of CUDA's driver API at
              your disposal, if you wish. It also includes code for
              interoperability with OpenGL.

            * Automatic Error Checking. All CUDA errors are automatically
              translated into Python exceptions.

            * Speed. PyCUDA's base layer is written in C++, so all the niceties
              above are virtually free.

            * Helpful `Documentation <http://documen.tician.de/pycuda>`_ and a
              `Wiki <http://wiki.tiker.net/PyCuda>`_.

            Relatedly, like-minded computing goodness for `OpenCL <http://khronos.org>`_
            is provided by PyCUDA's sister project `PyOpenCL <http://pypi.python.org/pypi/pyopencl>`_.
            """,
        author="Andreas Kloeckner",
        author_email="*****@*****.**",
        license="MIT",
        url="http://mathema.tician.de/software/pycuda",
        classifiers=[
            'Environment :: Console',
            'Development Status :: 5 - Production/Stable',
            'Intended Audience :: Developers',
            'Intended Audience :: Other Audience',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'Natural Language :: English',
            'Programming Language :: C++',
            'Programming Language :: Python',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Physics',
            'Topic :: Scientific/Engineering :: Visualization',
        ],

        # build info
        packages=["pycuda", "pycuda.gl", "pycuda.sparse"],
        install_requires=["pytools>=2011.2", "pytest>=2", "decorator>=3.2.0"],
        ext_package="pycuda",
        ext_modules=[
            NumpyExtension(
                "_driver",
                [
                    "src/cpp/cuda.cpp",
                    "src/cpp/bitlog.cpp",
                    "src/wrapper/wrap_cudadrv.cpp",
                    "src/wrapper/mempool.cpp",
                ] + EXTRA_SOURCES,
                include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
                library_dirs=LIBRARY_DIRS + conf["CUDADRV_LIB_DIR"],
                libraries=LIBRARIES + conf["CUDADRV_LIBNAME"],
                define_macros=list(EXTRA_DEFINES.items()),
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            ),
            Extension(
                "_pvt_struct",
                ["src/wrapper/_pycuda_struct.c"],
                extra_compile_args=conf["CXXFLAGS"],
                extra_link_args=conf["LDFLAGS"],
            )
        ],
        data_files=[("include/pycuda", glob.glob("src/cuda/*.hpp"))],

        # 2to3 invocation
        cmdclass={'build_py': build_py})
Example #55
0
def main():
    import glob
    from aksetup_helper import hack_distutils, \
            get_config, setup, Extension

    hack_distutils()
    conf = get_config(get_config_schema())

    triangle_macros = [
      ( "EXTERNAL_TEST", 1 ),
      ( "ANSI_DECLARATORS", 1 ),
      ( "TRILIBRARY", 1 ) ,
      ]

    tetgen_macros = [
      ("TETLIBRARY", 1),
      ("SELF_CHECK", 1) ,
      ]

    INCLUDE_DIRS = conf["BOOST_INC_DIR"] + ["src/cpp"]
    LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
    LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]

    init_filename = "meshpy/__init__.py"
    exec(compile(open(init_filename, "r").read(), init_filename, "exec"), conf)

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py

    setup(name="MeshPy",
          version=conf["version"],
          description="Triangular and Tetrahedral Mesh Generator",
          long_description="""
          MeshPy offers quality triangular and tetrahedral mesh
          generation for Python. Meshes of this type are chiefly used
          in finite-element simulation codes, but also have many
          other applications ranging from computer graphics to
          robotics.

          In order to generate 2D and 3D meshes, MeshPy provides
          Python interfaces to two well-regarded mesh generators,
          `Triangle <http://www.cs.cmu.edu/~quake/triangle.html>`_ by
          J.  Shewchuk and `TetGen <http://tetgen.berlios.de/>`_ by
          Hang Si. Both are included in the package in slightly
          modified versions.

          MeshPy uses `Boost.Python <http://www.boost.org>`_. 

          As of Version 0.91.2, MeshPy also works with Python 3.

          Documentation
          =============

          See the `MeshPy Documentation <http://tiker.net/doc/meshpy>`_ page.
          """,
          author="Andreas Kloeckner",
          author_email="*****@*****.**",
          license = "MIT for the wrapper/non-commercial MIT for the meshers",
          url="http://mathema.tician.de/software/meshpy",
          classifiers=[
            'Development Status :: 4 - Beta',
            'Intended Audience :: Developers',
            'Intended Audience :: Other Audience',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'License :: Free for non-commercial use',
            'Natural Language :: English',
            'Programming Language :: C++',
            'Programming Language :: Python',
            'Programming Language :: Python :: 3',
            'Topic :: Multimedia :: Graphics :: 3D Modeling',
            'Topic :: Scientific/Engineering',
            'Topic :: Scientific/Engineering :: Mathematics',
            'Topic :: Scientific/Engineering :: Physics',
            'Topic :: Scientific/Engineering :: Visualization',
            'Topic :: Software Development :: Libraries',
            ],

          packages = [ "meshpy" ],
          ext_modules = [
            Extension(
              "meshpy._triangle", 
              ["src/cpp/wrap_triangle.cpp","src/cpp/triangle.c"],
              include_dirs=INCLUDE_DIRS,
              library_dirs=LIBRARY_DIRS,
              libraries=LIBRARIES,
              define_macros=triangle_macros,
              extra_compile_args=conf["CXXFLAGS"],
              extra_link_args=conf["LDFLAGS"],
              ),
            Extension(
              "meshpy._tetgen", 
              ["src/cpp/tetgen.cpp", "src/cpp/predicates.cpp", "src/cpp/wrap_tetgen.cpp"],
              include_dirs=INCLUDE_DIRS,
              library_dirs=LIBRARY_DIRS,
              libraries=LIBRARIES,
              define_macros=tetgen_macros,
              extra_compile_args=conf["CXXFLAGS"],
              extra_link_args=conf["LDFLAGS"],
              ),
            ],

          # 2to3 invocation
          cmdclass={'build_py': build_py},
          )