当前位置: 首页>>代码示例>>Python>>正文


Python Extension.extra_link_args方法代码示例

本文整理汇总了Python中distutils.core.Extension.extra_link_args方法的典型用法代码示例。如果您正苦于以下问题:Python Extension.extra_link_args方法的具体用法?Python Extension.extra_link_args怎么用?Python Extension.extra_link_args使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在distutils.core.Extension的用法示例。


在下文中一共展示了Extension.extra_link_args方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: BuildExtension

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import extra_link_args [as 别名]
def BuildExtension(sources, output_dir, extension_name):
  from distutils import log
  from distutils.core import Distribution, Extension
  import os
  import tempfile

  build_dir = tempfile.mkdtemp()
  # Source file paths must be relative to current path.
  cwd = os.getcwd()
  src_files = [os.path.relpath(filename, cwd) for filename in sources]

  ext = Extension(extension_name, src_files)

  if os.name == 'nt':
    _FixDistutilsMsvcCompiler()
    # VS 2010 does not generate manifest, see http://bugs.python.org/issue4431
    ext.extra_link_args = ['/MANIFEST']

  dist = Distribution({
    'ext_modules': [ext]
  })
  dist.script_args = ['build_ext', '--build-temp', build_dir,
                      '--build-lib', output_dir]
  dist.parse_command_line()
  log.set_threshold(log.DEBUG)
  dist.run_commands()
  dist.script_args = ['clean', '--build-temp', build_dir, '--all']
  dist.parse_command_line()
  log.set_threshold(log.DEBUG)
  dist.run_commands()
开发者ID:,项目名称:,代码行数:32,代码来源:

示例2: get_extensions

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import extra_link_args [as 别名]
def get_extensions():

    med_sources = [str(os.path.join(UTIL_DIR, "median_utils.pyx")),
                   str(os.path.join(UTIL_DIR, "quick_select.c"))]

    include_dirs = ['numpy', UTIL_DIR]

    libraries = []

    ext_med = Extension(name=str('banzai.utils.median_utils'),
                        sources=med_sources,
                        include_dirs=include_dirs,
                        libraries=libraries,
                        language="c",
                        extra_compile_args=['-g', '-O3', '-funroll-loops', '-ffast-math'])

    has_openmp, outputs = check_openmp()
    if has_openmp:
        if setup_helpers.get_compiler_option() == 'msvc':
            ext_med.extra_compile_args.append('-openmp')
        else:
            ext_med.extra_compile_args.append('-fopenmp')
            ext_med.extra_link_args = ['-g', '-fopenmp']
    else:
        log.warn('OpenMP was not found. '
                 'banzai will be compiled without OpenMP. '
                 '(Use the "-v" option of setup.py for more details.)')
        log.debug(('(Start of OpenMP info)\n'
                   'compiler stdout:\n{0}\n'
                   'compiler stderr:\n{1}\n'
                   '(End of OpenMP info)').format(*outputs))

    return [ext_med]
开发者ID:Fingel,项目名称:banzai,代码行数:35,代码来源:setup_package.py

示例3: get_extensions

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import extra_link_args [as 别名]
def get_extensions():

    sources = ["lacosmicx/_lacosmicx.pyx", "lacosmicx/laxutils.c"]

    include_dirs = [numpy.get_include(), '.']

    libraries = []

    ext = Extension(name="_lacosmicx",
                    sources=sources,
                    include_dirs=include_dirs,
                    libraries=libraries,
                    language="c",
                    extra_compile_args=['-g', '-O3',
                                        '-funroll-loops', '-ffast-math'])

    has_openmp, outputs = check_openmp()
    if has_openmp:
        ext.extra_compile_args.append('-fopenmp')
        ext.extra_link_args = ['-g', '-fopenmp']
    else:
        log.warn('OpenMP was not found. '
                 'lacosmicx will be compiled without OpenMP. '
                 '(Use the "-v" option of setup.py for more details.)')
        log.debug(('(Start of OpenMP info)\n'
                   'compiler stdout:\n{0}\n'
                   'compiler stderr:\n{1}\n'
                   '(End of OpenMP info)').format(*outputs))

    return [ext]
开发者ID:cmccully,项目名称:lacosmicx,代码行数:32,代码来源:setup.py

示例4: get_extensions

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import extra_link_args [as 别名]
def get_extensions():

    med_sources = [str(os.path.join(UTIL_DIR, "median_utils.pyx")), str(os.path.join(UTIL_DIR, "medutils.c"))]

    im_sources = [str(os.path.join(UTIL_DIR, "image_utils.pyx")), str(os.path.join(UTIL_DIR, "imutils.c"))]

    include_dirs = ["numpy", UTIL_DIR]

    libraries = []

    ext_med = Extension(
        name=str("astroscrappy.utils.median_utils"),
        sources=med_sources,
        include_dirs=include_dirs,
        libraries=libraries,
        language="c",
        extra_compile_args=["-g", "-O3", "-funroll-loops", "-ffast-math"],
    )
    ext_im = Extension(
        name=str("astroscrappy.utils.image_utils"),
        sources=im_sources,
        include_dirs=include_dirs,
        libraries=libraries,
        language="c",
        extra_compile_args=["-g", "-O3", "-funroll-loops", "-ffast-math"],
    )

    has_openmp, outputs = check_openmp()
    if has_openmp:
        ext_med.extra_compile_args.append("-fopenmp")
        ext_im.extra_compile_args.append("-fopenmp")
        ext_med.extra_link_args = ["-g", "-fopenmp"]
        ext_im.extra_link_args = ["-g", "-fopenmp"]
    else:
        log.warn(
            "OpenMP was not found. "
            "astroscrappy will be compiled without OpenMP. "
            '(Use the "-v" option of setup.py for more details.)'
        )
        log.debug(
            (
                "(Start of OpenMP info)\n" "compiler stdout:\n{0}\n" "compiler stderr:\n{1}\n" "(End of OpenMP info)"
            ).format(*outputs)
        )

    return [ext_med, ext_im]
开发者ID:mwcraig,项目名称:astroscrappy,代码行数:48,代码来源:setup_package.py

示例5: get_extensions

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import extra_link_args [as 别名]
def get_extensions():

    sources = [os.path.join(LACOSMICX_ROOT, "lacosmicx.pyx"),
               os.path.join(LACOSMICX_ROOT, "laxutils.c")]

    include_dirs = ['numpy', LACOSMICX_ROOT]

    libraries = []

    ext = Extension(name="imageutils.lacosmicx.lacosmicx",
                    sources=sources,
                    include_dirs=include_dirs,
                    libraries=libraries,
                    language="c",
                    extra_compile_args=['-g', '-O3',
                                        '-funroll-loops', '-ffast-math'])

    if USE_OPENMP:
        ext.extra_compile_args.append('-fopenmp')
        ext.extra_link_args = ['-g', '-fopenmp']

    return [ext]
开发者ID:crawfordsm,项目名称:imageutils,代码行数:24,代码来源:setup_package.py

示例6: itself

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import extra_link_args [as 别名]
                include_dirs  = include_dirs,
                define_macros = define_macros,
                sources       = sources )

# OSX needs to hide all the normal AST symbols to prevent
# name clashes when loaded alongside libast itself (eg from pyndf)
symbol_list = "public_symbols.txt"
if sys.platform.startswith("darwin"):
   symfile = open( symbol_list, "w" )
   if sys.version_info[0] > 2:
      symname = "_PyInit_Ast"
   else:
      symname = "_initAst"
   print(symname,file=symfile)
   symfile.close()
   Ast.extra_link_args = [ "-exported_symbols_list", symbol_list]


setup (name = 'starlink-pyast',
       version = '2.5',
       description = 'A Python wrapper for the Starlink AST library',
       url = 'http://starlink.jach.hawaii.edu/starlink/AST',
       author = 'David Berry',
       author_email = '[email protected]',
       packages =['starlink'],
       package_data = { 'starlink': [os.path.join('include','star','pyast.h')] },
       ext_modules=[Ast],
       py_modules=['starlink.Grf','starlink.Atl'],
       classifiers=[
          'Intended Audience :: Developers',
          'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
开发者ID:,项目名称:,代码行数:33,代码来源:

示例7: download_library

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import extra_link_args [as 别名]
            download_library()

    # check again (the user might have downloaded the library)
    if os.path.isdir(SQLPARSER_DIR):
        parsebridge = Extension('sqlparser', 
            sources = ['Parser.c', 'Statement.c', 'Node.c', 'ENodeType.c', 'parsebridgemodule.c', 
        				SQLPARSER_DIR + 'ext/node_visitor/node_visitor.c',
        				SQLPARSER_DIR + 'ext/expr_traverse/expr_traverse.c',
        				SQLPARSER_DIR + 'ext/modifysql/modifysql.c' ],
            include_dirs = [ SQLPARSER_DIR + 'core/', 
        			SQLPARSER_DIR + 'ext/collection/includes/',
        			SQLPARSER_DIR + 'ext/expr_traverse/',
        			SQLPARSER_DIR + 'ext/modifysql/',
        			SQLPARSER_DIR + 'ext/node_visitor/' ],
            library_dirs = [ SQLPARSER_DIR + '/lib/' ],
            libraries = [ 'gspcollection' + ARCH, 'gspcore' + ARCH ],
            define_macros = [ ('_CRT_SECURE_NO_WARNINGS', None), ('DONT_FIX_FRAGMENTS', None), ]
        )

        if sys.platform == 'win32' or sys.platform == 'win64':
            parsebridge.extra_link_args = [ '/MANIFEST', '/DEBUG' ]
            parsebridge.extra_compile_args = [ '/Zi' ]

        setup (name = 'sqlparser',
            version = '1.0',
            description = 'A package for parsing SQL queries',
            author = 'Timo Djürken',
            url = 'https://github.com/TwoLaid/python-sqlparser',
            license = 'GPL',
            ext_modules = [ parsebridge ])
开发者ID:KenMacD,项目名称:python-sqlparser,代码行数:32,代码来源:setup.py

示例8:

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import extra_link_args [as 别名]
from distutils.core import setup, Extension
import subprocess
module=Extension('pywlc', ['wlc_python.c'])
module.libraries = ['wlc']
module.extra_compile_args=[subprocess.check_output(["wlc-config", "--cflags"])]
module.extra_link_args=[subprocess.check_output(["wlc-config", "--libs"])]
setup(name='pywlc', version='0.0', ext_modules=[module])
开发者ID:rcortini,项目名称:wlc,代码行数:9,代码来源:setup.py

示例9: Extension

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import extra_link_args [as 别名]
#!/usr/bin/env python

from distutils.core import setup, Extension
from os import getenv

ext = Extension("bnirc", [])
ext.extra_objects = ["python.o"]
ext.extra_link_args = ["-L../../src", "-L../../src/.libs", "-L../../src/libs", "-lbnirc"]
ver = getenv("VERSION")

setup(name="bnirc", version=ver,  ext_modules=[ext])
开发者ID:bniemczyk,项目名称:bnirc,代码行数:13,代码来源:setup.py

示例10: Extension

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import extra_link_args [as 别名]
# the cross platfrom stub
ext_stub = Extension( "_tosdb",
                      sources=[ "_tosdb.cpp" ], 
                      include_dirs=[ "../include" ],
                      optional=True )

ext_win = Extension( **ext_stub.__dict__ )

# add/override for Win
ext_win.library_dirs       =  [ "../bin/Release/"+ _SYS_ARCHD ]
ext_win.libraries          =  [ "_tos-databridge-shared-"+ _SYS_ARCH,
                                "_tos-databridge-static-"+ _SYS_ARCH ]
ext_win.define_macros      =  [ ("THIS_IMPORTS_IMPLEMENTATION",None),
                                ("THIS_DOESNT_IMPORT_INTERFACE",None) ]
ext_win.extra_compile_args =  ["/EHsc"]
ext_win.extra_link_args    =  ["/LTCG"]  
        
try: # capture setup errors but allow setup to complete (optional=True)   
    sio = StringIO()
    se = sys.stderr
    sys.stderr = sio  
    setup( ext_modules=[ ext_win if _SYS_IS_WIN else ext_stub], **setup_dict )  
    sys.stderr = se    
    if sio.getvalue(): 
        print( '\n', "+ Operation 'completed' with errors:\n")
        print( sio.getvalue() )
        print( "+ Checking on the status of the build...")
        t = None
        try:
            import _tosdb as t
            print( "+ _tosdb.pyd exists (possibly an older version?) ")
开发者ID:cmoski,项目名称:TOSDataBridge,代码行数:33,代码来源:setup.py


注:本文中的distutils.core.Extension.extra_link_args方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。