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


Python misc_util.get_build_architecture方法代码示例

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


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

示例1: find_dll

# 需要导入模块: from numpy.distutils import misc_util [as 别名]
# 或者: from numpy.distutils.misc_util import get_build_architecture [as 别名]
def find_dll(dll_name):

    arch = {'AMD64' : 'amd64',
            'Intel' : 'x86'}[get_build_architecture()]

    def _find_dll_in_winsxs(dll_name):
        # Walk through the WinSxS directory to find the dll.
        winsxs_path = os.path.join(os.environ['WINDIR'], 'winsxs')
        if not os.path.exists(winsxs_path):
            return None
        for root, dirs, files in os.walk(winsxs_path):
            if dll_name in files and arch in root:
                return os.path.join(root, dll_name)
        return None

    def _find_dll_in_path(dll_name):
        # First, look in the Python directory, then scan PATH for
        # the given dll name.
        for path in [sys.prefix] + os.environ['PATH'].split(';'):
            filepath = os.path.join(path, dll_name)
            if os.path.exists(filepath):
                return os.path.abspath(filepath)

    return _find_dll_in_winsxs(dll_name) or _find_dll_in_path(dll_name) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:26,代码来源:mingw32ccompiler.py

示例2: win32_checks

# 需要导入模块: from numpy.distutils import misc_util [as 别名]
# 或者: from numpy.distutils.misc_util import get_build_architecture [as 别名]
def win32_checks(deflist):
    from numpy.distutils.misc_util import get_build_architecture
    a = get_build_architecture()

    # Distutils hack on AMD64 on windows
    print('BUILD_ARCHITECTURE: %r, os.name=%r, sys.platform=%r' %
          (a, os.name, sys.platform))
    if a == 'AMD64':
        deflist.append('DISTUTILS_USE_SDK')

    # On win32, force long double format string to be 'g', not
    # 'Lg', since the MS runtime does not support long double whose
    # size is > sizeof(double)
    if a == "Intel" or a == "AMD64":
        deflist.append('FORCE_NO_LONG_DOUBLE_FORMATTING') 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:17,代码来源:setup.py

示例3: build_import_library

# 需要导入模块: from numpy.distutils import misc_util [as 别名]
# 或者: from numpy.distutils.misc_util import get_build_architecture [as 别名]
def build_import_library():
    if os.name != 'nt':
        return

    arch = get_build_architecture()
    if arch == 'AMD64':
        return _build_import_library_amd64()
    elif arch == 'Intel':
        return _build_import_library_x86()
    else:
        raise ValueError("Unhandled arch %s" % arch) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:13,代码来源:mingw32ccompiler.py


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