Beispiel #1
0
            libraries = ['gomp']
    sources_files = ['trottersuzuki/src/common.cpp',
                     'trottersuzuki/src/cpublock.cpp',
                     'trottersuzuki/src/model.cpp',
                     'trottersuzuki/src/solver.cpp',
                     'trottersuzuki/trottersuzuki_wrap.cxx']

    ts_module = Extension('_trottersuzuki', sources=sources_files,
                          include_dirs=[numpy_include, 'src'],
                          extra_compile_args=extra_compile_args,
                          libraries=libraries,
                          )
    if CUDA is not None:
        ts_module.sources += ['trottersuzuki/src/cc2kernel.cu',
                              'trottersuzuki/src/hybrid.cu']
        ts_module.define_macros = [('CUDA', None)]
        ts_module.include_dirs.append(CUDA['include'])
        ts_module.library_dirs = [CUDA['lib']]
        ts_module.libraries += ['cudart', 'cublas']
        ts_module.runtime_library_dirs = [CUDA['lib']]
        if len(ts_module.extra_compile_args['cc']) > 0:
            extra_args = ts_module.extra_compile_args['cc'][0]
        else:
            extra_args = ""
        ts_module.extra_compile_args['nvcc'] = ['-use_fast_math',
                                                '--ptxas-options=-v', '-c',
                                                '--compiler-options',
                                                '-fPIC ' + extra_args]
    cmdclass = {'build_ext': custom_build_ext}

Beispiel #2
0
    else:
        extra_compile_args = ['-fopenmp']
        if 'CC' in os.environ and 'clang-omp' in os.environ['CC']:
            openmp = 'iomp5'
        else:
            openmp = 'gomp'
        cmdclass = {'build_ext': custom_build_ext}
        somoclu_module = Extension('_somoclu_wrap',
                                   sources=sources_files,
                                   include_dirs=[numpy_include, 'src'],
                                   extra_compile_args={'cc': extra_compile_args},
                                   libraries=[openmp],
                                   )
    if CUDA is not None:
        somoclu_module.sources.append('somoclu/src/denseGpuKernels.cu')
        somoclu_module.define_macros = [('CUDA', None)]
        somoclu_module.include_dirs.append(CUDA['include'])
        somoclu_module.library_dirs = [CUDA['lib']]
        somoclu_module.libraries += ['cudart', 'cublas']
        somoclu_module.runtime_library_dirs = [CUDA['lib']]
        somoclu_module.extra_compile_args['nvcc']=['-use_fast_math',
                                                   '--ptxas-options=-v', '-c',
                                                   '--compiler-options','-fPIC ' +
                                                   extra_compile_args[0]]



try:
    setup(name='somoclu',
          version='1.6.1',
          license='GPL3',
        'trottersuzuki/src/model.cpp', 'trottersuzuki/src/solver.cpp',
        'trottersuzuki/trottersuzuki_wrap.cxx'
    ]

    ts_module = Extension(
        '_trottersuzuki',
        sources=sources_files,
        include_dirs=[numpy_include, 'src'],
        extra_compile_args=extra_compile_args,
        libraries=libraries,
    )
    if CUDA is not None:
        ts_module.sources += [
            'trottersuzuki/src/cc2kernel.cu', 'trottersuzuki/src/hybrid.cu'
        ]
        ts_module.define_macros = [('CUDA', None)]
        ts_module.include_dirs.append(CUDA['include'])
        ts_module.library_dirs = [CUDA['lib']]
        ts_module.libraries += ['cudart', 'cublas']
        ts_module.runtime_library_dirs = [CUDA['lib']]
        if len(ts_module.extra_compile_args['cc']) > 0:
            extra_args = ts_module.extra_compile_args['cc'][0]
        else:
            extra_args = ""
        ts_module.extra_compile_args['nvcc'] = [
            '-use_fast_math', '--ptxas-options=-v', '-c', '--compiler-options',
            '-fPIC ' + extra_args
        ]
    cmdclass = {'build_ext': custom_build_ext}

setup(name='trottersuzuki',
Beispiel #4
0
    else:
        extra_compile_args = ['-fopenmp']
        if 'CC' in os.environ and 'clang-omp' in os.environ['CC']:
            openmp = 'iomp5'
        else:
            openmp = 'gomp'
        cmdclass = {'build_ext': custom_build_ext}
        somoclu_module = Extension('_somoclu_wrap',
                                   sources=sources_files,
                                   include_dirs=[numpy_include, 'src'],
                                   extra_compile_args={'cc': extra_compile_args},
                                   libraries=[openmp],
                                   )
    if CUDA is not None:
        somoclu_module.sources.append('somoclu/src/denseGpuKernels.cu')
        somoclu_module.define_macros = [('CUDA', None)]
        somoclu_module.include_dirs.append(CUDA['include'])
        somoclu_module.library_dirs = [CUDA['lib']]
        somoclu_module.libraries += ['cudart', 'cublas']
        somoclu_module.runtime_library_dirs = [CUDA['lib']]
        somoclu_module.extra_compile_args['nvcc']=['-use_fast_math',
                                                   '--ptxas-options=-v', '-c',
                                                   '--compiler-options','-fPIC ' +
                                                   extra_compile_args[0]]



try:
    setup(name='somoclu',
          version='1.7.3',
          license='GPL3',
Beispiel #5
0
        extra_compile_args = ["-fopenmp"]
        if "CC" in os.environ and "clang-omp" in os.environ["CC"]:
            openmp = "iomp5"
        else:
            openmp = "gomp"
        cmdclass = {"build_ext": custom_build_ext}
        somoclu_module = Extension(
            "somoclu._somoclu_wrap",
            sources=sources_files,
            include_dirs=[numpy_include, "src"],
            extra_compile_args={"cc": extra_compile_args},
            libraries=[openmp],
        )
    if CUDA is not None:
        somoclu_module.sources.append("somoclu/src/denseGpuKernels.cu")
        somoclu_module.define_macros = [("CUDA", None)]
        somoclu_module.include_dirs.append(CUDA["include"])
        somoclu_module.library_dirs = [CUDA["lib"]]
        somoclu_module.libraries += ["cudart", "cublas"]
        somoclu_module.runtime_library_dirs = [CUDA["lib"]]
        somoclu_module.extra_compile_args["nvcc"] = [
            "-use_fast_math",
            "--ptxas-options=-v",
            "-c",
            "--compiler-options",
            "-fPIC " + extra_compile_args[0],
        ]

try:
    setup(
        name="somoclu",
Beispiel #6
0
    else:
        boost_python_lib = "boost_python"

    long_desc = long_description

    if (len(sys.argv) > 1):
        if (sys.argv[1].startswith("build_ext")):
            includes, macros = setup_compiler()

            print("Compiling aiengine extension for %s" % sys.platform)
            print("\tOS name %s" % (os.name))
            print("\tArchitecture %s" % os.uname()[4])
            print("\tBoost python lib %s" % boost_python_lib)

            aiengine_module.include_dirs = includes
            aiengine_module.define_macros = macros
            aiengine_module.libraries.append(boost_python_lib)

    setup(
        name="aiengine",
        version="1.9",
        author="Luis Campo Giralte",
        author_email="*****@*****.**",
        url="https://ryadpasha.com",
        license="GPLv2",
        package_dir={'': '.'},
        description=
        "A next generation interactive/programmable Python network intrusion detection system",
        long_description=long_desc,
        ext_modules=[aiengine_module],
        py_modules=["pyaiengine"],