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


Python core.Extension方法代码示例

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


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

示例1: add_library

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import Extension [as 别名]
def add_library(self,name,sources,**build_info):
        """
        Add library to configuration.

        Parameters
        ----------
        name : str
            Name of the extension.
        sources : sequence
            List of the sources. The list of sources may contain functions
            (called source generators) which must take an extension instance
            and a build directory as inputs and return a source file or list of
            source files or None. If None is returned then no sources are
            generated. If the Extension instance has no sources after
            processing all source generators, then no extension module is
            built.
        build_info : dict, optional
            The following keys are allowed:

                * depends
                * macros
                * include_dirs
                * extra_compiler_args
                * extra_f77_compile_args
                * extra_f90_compile_args
                * f2py_options
                * language

        """
        self._add_library(name, sources, None, build_info)

        dist = self.get_distribution()
        if dist is not None:
            self.warn('distutils distribution has been initialized,'\
                      ' it may be too late to add a library '+ name) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:37,代码来源:misc_util.py

示例2: append_to

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import Extension [as 别名]
def append_to(self, extlib):
        """Append libraries, include_dirs to extension or library item.
        """
        if is_sequence(extlib):
            lib_name, build_info = extlib
            dict_append(build_info,
                        libraries=self.libraries,
                        include_dirs=self.include_dirs)
        else:
            from numpy.distutils.core import Extension
            assert isinstance(extlib, Extension), repr(extlib)
            extlib.libraries.extend(self.libraries)
            extlib.include_dirs.extend(self.include_dirs) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:15,代码来源:misc_util.py

示例3: add_library

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import Extension [as 别名]
def add_library(self,name,sources,**build_info):
        """
        Add library to configuration.

        Parameters
        ----------
        name : str
            Name of the extension.
        sources : sequence
            List of the sources. The list of sources may contain functions
            (called source generators) which must take an extension instance
            and a build directory as inputs and return a source file or list of
            source files or None. If None is returned then no sources are
            generated. If the Extension instance has no sources after
            processing all source generators, then no extension module is
            built.
        build_info : dict, optional
            The following keys are allowed:

                * depends
                * macros
                * include_dirs
                * extra_compiler_args
                * extra_f77_compiler_args
                * extra_f90_compiler_args
                * f2py_options
                * language

        """
        self._add_library(name, sources, None, build_info)

        dist = self.get_distribution()
        if dist is not None:
            self.warn('distutils distribution has been initialized,'\
                      ' it may be too late to add a library '+ name) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:37,代码来源:misc_util.py

示例4: configuration

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import Extension [as 别名]
def configuration(parent_package='', top_path=None):
    from numpy.distutils.misc_util import Configuration

    config = Configuration('randomkit', parent_package, top_path)
    libs = []
    if sys.platform == 'win32':
        libs.append('Advapi32')

    extensions = [Extension('modl.utils.randomkit.random_fast',
                            sources=['modl/utils/randomkit/random_fast.pyx',
                                     'modl/utils/randomkit/randomkit.c',
                                     'modl/utils/randomkit/distributions.c',
                                     ],
                            language="c++",
                            include_dirs=[numpy.get_include(),
                                          'modl/utils/randomkit'],
                            ),
                  Extension('modl.utils.randomkit.sampler',
                            sources=['modl/utils/randomkit/sampler.pyx'],
                            language="c++",
                            include_dirs=[numpy.get_include()]
                            )]
    config.ext_modules += extensions

    config.add_subpackage('tests')

    return config 
开发者ID:arthurmensch,项目名称:modl,代码行数:29,代码来源:setup.py


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