• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python misc_util.get_cmd函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: build_npy_pkg_config

    def build_npy_pkg_config(self):
        log.info("build_src: building npy-pkg config files")

        # XXX: another ugly workaround to circumvent distutils brain damage. We
        # need the install prefix here, but finalizing the options of the
        # install command when only building sources cause error. Instead, we
        # copy the install command instance, and finalize the copy so that it
        # does not disrupt how distutils want to do things when with the
        # original install command instance.
        install_cmd = copy.copy(get_cmd("install"))
        if not install_cmd.finalized == 1:
            install_cmd.finalize_options()
        build_npkg = False
        gd = {}
        if self.inplace == 1:
            top_prefix = "."
            build_npkg = True
        elif hasattr(install_cmd, "install_libbase"):
            top_prefix = install_cmd.install_libbase
            build_npkg = True

        if build_npkg:
            for pkg, infos in self.distribution.installed_pkg_config.items():
                pkg_path = os.path.join(*pkg.split("."))
                prefix = os.path.join(os.path.abspath(top_prefix), pkg_path)
                d = {"prefix": prefix}
                for info in infos:
                    install_dir, generated = self._build_npy_pkg_config(info, d, prefix)
                    self.distribution.data_files.append((install_dir, [generated]))
开发者ID:themiwi,项目名称:numpy,代码行数:29,代码来源:build_src.py


示例2: get_distutils_install_prefix

def get_distutils_install_prefix(pkg, inplace):
    """Returns the installation path for the current package."""
    from numscons.core.utils import pkg_to_path
    if inplace == 1:
        return pkg_to_path(pkg)
    else:
        install_cmd = get_cmd('install').get_finalized_command('install')
        return pjoin(install_cmd.install_libbase, pkg_to_path(pkg))
开发者ID:DDRBoxman,项目名称:Spherebot-Host-GUI,代码行数:8,代码来源:scons.py


示例3: generate_umath_templated_sources

    def generate_umath_templated_sources(ext, build_dir):
        from numpy.distutils.misc_util import get_cmd

        subpath = join("src", "umath")
        # NOTE: For manual template conversion of loops.h.src, read the note
        #       in that file.
        sources = [join(local_dir, subpath, "loops.c.src"), join(local_dir, subpath, "simd.inc.src")]

        # numpy.distutils generate .c from .c.src in weird directories, we have
        # to add them there as they depend on the build_dir
        config.add_include_dirs(join(build_dir, subpath))
        cmd = get_cmd("build_src")
        cmd.ensure_finalized()
        cmd.template_sources(sources, ext)
开发者ID:noclew,项目名称:numpy,代码行数:14,代码来源:setup.py


示例4: generate_multiarray_templated_sources

    def generate_multiarray_templated_sources(ext, build_dir):
        from numpy.distutils.misc_util import get_cmd

        subpath = join('src', 'multiarray')
        sources = [join(local_dir, subpath, 'scalartypes.c.src'),
                   join(local_dir, subpath, 'arraytypes.c.src')]

        # numpy.distutils generate .c from .c.src in weird directories, we have
        # to add them there as they depend on the build_dir
        config.add_include_dirs(join(build_dir, subpath))

        cmd = get_cmd('build_src')
        cmd.ensure_finalized()

        cmd.template_sources(sources, ext)
开发者ID:Apkawa,项目名称:numpy-refactor,代码行数:15,代码来源:setup.py


示例5: finalize_options

    def finalize_options(self):
        old_build_ext.finalize_options(self)

        self.sconscripts = []
        self.pre_hooks = []
        self.post_hooks = []
        self.pkg_names = []
        self.pkg_paths = []

        if self.distribution.has_scons_scripts():
            for i in self.distribution.scons_data:
                self.sconscripts.append(i.scons_path)
                self.pre_hooks.append(i.pre_hook)
                self.post_hooks.append(i.post_hook)
                self.pkg_names.append(i.parent_name)
                self.pkg_paths.append(i.pkg_path)
            # This crap is needed to get the build_clib
            # directory
            build_clib_cmd = get_cmd("build_clib").get_finalized_command("build_clib")
            self.build_clib = build_clib_cmd.build_clib

        if not self.cxxcompiler:
            self.cxxcompiler = self.compiler

        # To avoid trouble, just don't do anything if no sconscripts are used.
        # This is  useful when for example f2py uses numpy.distutils, because
        # f2py does not pass compiler information to scons command, and the
        # compilation setup below can crash in some situation.
        if len(self.sconscripts) > 0:
            if self.bypass:
                self.scons_compiler = self.compiler
                self.scons_fcompiler = self.fcompiler
                self.scons_cxxcompiler = self.cxxcompiler
            else:
                # Try to get the same compiler than the ones used by distutils: this is
                # non trivial because distutils and scons have totally different
                # conventions on this one (distutils uses PATH from user's environment,
                # whereas scons uses standard locations). The way we do it is once we
                # got the c compiler used, we use numpy.distutils function to get the
                # full path, and add the path to the env['PATH'] variable in env
                # instance (this is done in numpy.distutils.scons module).

                self._init_ccompiler(self.compiler)
                self._init_fcompiler(self.fcompiler)
                self._init_cxxcompiler(self.cxxcompiler)

        if self.package_list:
            self.package_list = parse_package_list(self.package_list)
开发者ID:DDRBoxman,项目名称:Spherebot-Host-GUI,代码行数:48,代码来源:scons.py


示例6: run

    def run (self):
        build_clib_cmd = get_cmd("build_clib")
        build_dir = build_clib_cmd.build_clib

        # We need the compiler to get the library name -> filename association
        if not build_clib_cmd.compiler:
            compiler = new_compiler(compiler=None)
            compiler.customize(self.distribution)
        else:
            compiler = build_clib_cmd.compiler

        for l in self.distribution.installed_libraries:
            target_dir = os.path.join(self.install_dir, l.target_dir)
            name = compiler.library_filename(l.name)
            source = os.path.join(build_dir, name)
            self.mkpath(target_dir)
            self.outfiles.append(self.copy_file(source, target_dir)[0])
开发者ID:arthornsby,项目名称:numpy,代码行数:17,代码来源:install_clib.py


示例7: generate_multiarray_templated_sources

    def generate_multiarray_templated_sources(ext, build_dir):
        from numpy.distutils.misc_util import get_cmd

        subpath = join("src", "multiarray")
        sources = [
            join(local_dir, subpath, "scalartypes.c.src"),
            join(local_dir, subpath, "arraytypes.c.src"),
            join(local_dir, subpath, "nditer_templ.c.src"),
            join(local_dir, subpath, "lowlevel_strided_loops.c.src"),
            join(local_dir, subpath, "einsum.c.src"),
        ]

        # numpy.distutils generate .c from .c.src in weird directories, we have
        # to add them there as they depend on the build_dir
        config.add_include_dirs(join(build_dir, subpath))
        cmd = get_cmd("build_src")
        cmd.ensure_finalized()
        cmd.template_sources(sources, ext)
开发者ID:noclew,项目名称:numpy,代码行数:18,代码来源:setup.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python misc_util.get_info函数代码示例发布时间:2022-05-27
下一篇:
Python misc_util.get_build_architecture函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap