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


Python Extension.libraries方法代码示例

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


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

示例1: Extension

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import libraries [as 别名]
from distutils.core import setup, Extension
import numpy
module = Extension("multivec", ["wrapper.cpp", "../multivec/monolingual.cpp", "../multivec/bilingual.cpp", "../multivec/distance.cpp"],
    undef_macros=['NDEBUG'])
module.extra_compile_args = ['--std=c++0x', '-w', '-I../multivec', '-O3']
module.libraries = ['m']
setup(name="multivec", version="1.0", ext_modules=[module], include_dirs=[numpy.get_include()])
开发者ID:Turbo-wang,项目名称:multivec,代码行数:9,代码来源:setup.py

示例2: Extension

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import libraries [as 别名]
from distutils.core import setup
from distutils.core import Extension
import os
import subprocess
import sys

module = Extension("simplepinyin", ["simplepinyin.cpp"])
module.language = 'c++'

if os.system("pkg-config --exists libpinyin") != 0:
    print("Please install libpinyin.", file=sys.stderr)
    sys.exit(1)

libpinyin_args = subprocess.check_output(["pkg-config", "--cflags", "--libs", "libpinyin"], universal_newlines=True).strip().split(" ")
libpinyin_data = subprocess.check_output(["pkg-config", "--variable=pkgdatadir", "libpinyin"], universal_newlines=True).strip()+"/data"
#print(libpinyin_data)
module.include_dirs = [arg.lstrip("-I") for arg in libpinyin_args if arg.startswith("-I")]
module.library_dirs = [arg.lstrip("-L") for arg in libpinyin_args if arg.startswith("-L")]
module.libraries = [arg.lstrip("-l") for arg in libpinyin_args if arg.startswith("-l")]
module.define_macros = [("LIBPINYIN_DATA", "\""+libpinyin_data+"\"")]

setup(name="simplepinyin", version="1.0",
      ext_modules=[module])
开发者ID:nappingbird,项目名称:simplepinyin,代码行数:25,代码来源:setup.py

示例3: Extension

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

# Author: Thomas Liu <[email protected]>
import os
from distutils.core import setup, Extension
LIBS=["apol", "qpol"]

try:
    inc=os.getenv("INCLUDES").split(" ")    
    INCLUDES=map(lambda x: x[2:], inc)
    LIBDIRS=map(lambda x: "/".join(x.split("/")[:-1]), os.getenv("LIBS").split())
except:
    INCLUDES=""
    LIBDIRS=""

extension_sesearch = Extension("setools._sesearch", [ "sesearch.c"])
extension_sesearch.include_dirs=INCLUDES
extension_sesearch.libraries=LIBS
extension_sesearch.library_dirs=LIBDIRS
extension_seinfo = Extension("setools._seinfo", [ "seinfo.c"])
extension_seinfo.include_dirs=INCLUDES
extension_seinfo.libraries=LIBS
extension_seinfo.library_dirs=LIBDIRS

setup(name = "setools", version="1.0", description="Python setools bindings", author="Thomas Liu", author_email="[email protected]", ext_modules=[extension_sesearch, extension_seinfo], packages=["setools"])
开发者ID:0xroot,项目名称:setools3,代码行数:27,代码来源:setup.py

示例4:

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import libraries [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

示例5: Extension

# 需要导入模块: from distutils.core import Extension [as 别名]
# 或者: from distutils.core.Extension import libraries [as 别名]
  "author":"Jonathon Ogden",
  "author_email":"[email protected]",
  "packages": ['tosdb','tosdb/cli_scripts'] 
}      
         
# 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...")
开发者ID:cmoski,项目名称:TOSDataBridge,代码行数:34,代码来源:setup.py


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