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


Python IntelBase.install_step方法代码示例

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


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

示例1: install_step

# 需要导入模块: from easybuild.easyblocks.generic.intelbase import IntelBase [as 别名]
# 或者: from easybuild.easyblocks.generic.intelbase.IntelBase import install_step [as 别名]
    def install_step(self):
        """Custom install step, to add extra symlinks"""
        if self.toolchain.name == DUMMY_TOOLCHAIN_NAME:
            silent_cfg_names_map = None
            silent_cfg_extras = None

            if LooseVersion(self.version) < LooseVersion('4.2'):
                silent_cfg_names_map = {
                    'activation_name': ACTIVATION_NAME_2012,
                    'license_file_name': LICENSE_FILE_NAME_2012,
                }

            elif LooseVersion(self.version) < LooseVersion('4.4'):
                silent_cfg_names_map = {
                    'install_mode_name': INSTALL_MODE_NAME_2015,
                    'install_mode': INSTALL_MODE_2015,
                }

            # In case of TBB 4.4.x and newer we have to specify ARCH_SELECTED in silent.cfg
            if LooseVersion(self.version) >= LooseVersion('4.4'):
                silent_cfg_extras = {
                    'ARCH_SELECTED': self.arch.upper()
                }

            IntelBase.install_step(self, silent_cfg_names_map=silent_cfg_names_map, silent_cfg_extras=silent_cfg_extras)

            # determine libdir
            os.chdir(self.installdir)
            if LooseVersion(self.version) < LooseVersion('4.1.0'):
                libglob = 'tbb/lib/intel64/cc*libc*_kernel*'
                libs = sorted(glob.glob(libglob), key=LooseVersion)
                if len(libs):
                    # take the last one, should be ordered by cc version
                    # we're only interested in the last bit
                    libdir = libs[-1].split('/')[-1]
                else:
                    raise EasyBuildError("No libs found using %s in %s", libglob, self.installdir)
            else:
                libdir = get_tbb_gccprefix()

            self.libpath = os.path.join('tbb', 'libs', 'intel64', libdir)
            self.log.debug("self.libpath: %s" % self.libpath)
            # applications go looking into tbb/lib so we move what's in there to libs
            # and symlink the right lib from /tbb/libs/intel64/... to lib
            install_libpath = os.path.join(self.installdir, 'tbb', 'lib')
            shutil.move(install_libpath, os.path.join(self.installdir, 'tbb', 'libs'))
            os.symlink(os.path.join(self.installdir, self.libpath), install_libpath)
        else:
            # no custom install step when building from source (building is done in install directory)
            cand_lib_paths = glob.glob(os.path.join(self.installdir, 'build', '*_release'))
            if len(cand_lib_paths) == 1:
                self.libpath = os.path.join('build', os.path.basename(cand_lib_paths[0]))
            else:
                raise EasyBuildError("Failed to isolate location of libraries: %s", cand_lib_paths)
开发者ID:hpcugent,项目名称:easybuild-easyblocks,代码行数:56,代码来源:tbb.py


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