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

Python fc_config.getoutput函数代码示例

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

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



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

示例1: get_pgfortran_version

def get_pgfortran_version(conf,fc):
		version_re = re.compile(r"The Portland Group", re.I).search
		cmd = fc + ['-V']
		out,err = fc_config.getoutput(conf, cmd, stdin=False)
		if out: match = version_re(out)
		else: match = version_re(err)
		if not match:
				conf.fatal('Could not verify PGI signature')
		cmd = fc + ['-help=variable']
		out,err = fc_config.getoutput(conf, cmd, stdin=False)
		if out.find('COMPVER')<0:
				conf.fatal('Could not determine the compiler type')
		k = {}
		prevk = ''
		out = out.split('\n')
		for line in out:
				lst = line.partition('=')
				if lst[1] == '=':
						key = lst[0].rstrip()
						if key == '': key = prevk
						val = lst[2].rstrip()
						k[key] = val
				else: prevk = line.partition(' ')[0]
		def isD(var):
				return var in k
		def isT(var):
				return var in k and k[var]!='0'
		conf.env['FC_VERSION'] = (k['COMPVER'].split('.'))
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:28,代码来源:fc_pgfortran.py


示例2: get_gfortran_version

def get_gfortran_version(conf,fc):
	version_re=re.compile(r"GNU\s*Fortran",re.I).search
	cmd=fc+['--version']
	out,err=fc_config.getoutput(conf,cmd,stdin=False)
	if out:match=version_re(out)
	else:match=version_re(err)
	if not match:
		conf.fatal('Could not determine the compiler type')
	cmd=fc+['-dM','-E','-']
	out,err=fc_config.getoutput(conf,cmd,stdin=True)
	if out.find('__GNUC__')<0:
		conf.fatal('Could not determine the compiler type')
	k={}
	out=out.split('\n')
	import shlex
	for line in out:
		lst=shlex.split(line)
		if len(lst)>2:
			key=lst[1]
			val=lst[2]
			k[key]=val
	def isD(var):
		return var in k
	def isT(var):
		return var in k and k[var]!='0'
	conf.env['FC_VERSION']=(k['__GNUC__'],k['__GNUC_MINOR__'],k['__GNUC_PATCHLEVEL__'])
开发者ID:FlavioFalcao,项目名称:osmbrowser,代码行数:26,代码来源:gfortran.py


示例3: check_cython_version

def check_cython_version(conf, minver):
    conf.start_msg("Checking cython version")
    minver = tuple(minver)
    import re
    version_re = re.compile(r'cython\s*version\s*(?P<major>\d*)\.(?P<minor>\d*)(?:\.(?P<micro>\d*))?', re.I).search
    cmd = conf.cmd_to_list(conf.env['CYTHON'])
    cmd = cmd + ['--version']
    from waflib.Tools import fc_config
    stdout, stderr = fc_config.getoutput(conf, cmd)
    if stdout:
        match = version_re(stdout)
    else:
        match = version_re(stderr)
    if not match:
        conf.fatal("cannot determine the Cython version")
    cy_ver = [match.group('major'), match.group('minor')]
    if match.group('micro'):
        cy_ver.append(match.group('micro'))
    else:
        cy_ver.append('0')
    cy_ver = tuple([int(x) for x in cy_ver])
    if cy_ver < minver:
        conf.end_msg(False)
        conf.fatal("cython version %s < %s" % (cy_ver, minver))
    conf.end_msg(str(cy_ver))
开发者ID:dagss,项目名称:distarray-old,代码行数:25,代码来源:cython.py


示例4: get_crayftn_version

def get_crayftn_version(conf, fc):
		version_re = re.compile(r"Cray Fortran\s*:\s*Version\s*(?P<major>\d*)\.(?P<minor>\d*)", re.I).search
		cmd = fc + ['-V']
		out,err = fc_config.getoutput(conf, cmd, stdin=False)
		if out: match = version_re(out)
		else: match = version_re(err)
		if not match:
				conf.fatal('Could not determine the Cray Fortran compiler version.')
		k = match.groupdict()
		conf.env['FC_VERSION'] = (k['major'], k['minor'])
开发者ID:BillTian,项目名称:waf,代码行数:10,代码来源:fc_cray.py


示例5: get_ifort_version

def get_ifort_version(conf,fc):
	version_re=re.compile(r"ifort\s*\(IFORT\)\s*(?P<major>\d*)\.(?P<minor>\d*)",re.I).search
	cmd=fc+['--version']
	out,err=fc_config.getoutput(conf,cmd,stdin=False)
	if out:
		match=version_re(out)
	else:
		match=version_re(err)
	if not match:
		conf.fatal('cannot determine ifort version.')
	k=match.groupdict()
	conf.env['FC_VERSION']=(k['major'],k['minor'])
开发者ID:ETLin,项目名称:ns3-h264-svc,代码行数:12,代码来源:ifort.py


示例6: get_ifort_version

def get_ifort_version(conf,fc):
	version_re=re.compile(r"\bIntel\b.*\bVersion\s*(?P<major>\d*)\.(?P<minor>\d*)",re.I).search
	if Utils.is_win32:
		cmd=fc
	else:
		cmd=fc+['-logo']
	out,err=fc_config.getoutput(conf,cmd,stdin=False)
	match=version_re(out)or version_re(err)
	if not match:
		conf.fatal('cannot determine ifort version.')
	k=match.groupdict()
	conf.env.FC_VERSION=(k['major'],k['minor'])
开发者ID:Gnurou,项目名称:glmark2,代码行数:12,代码来源:ifort.py


示例7: get_ifort_version

def get_ifort_version(conf, fc):
    version_re = re.compile(r"Intel[\sa-zA-Z()0-9,-]*Version\s*(?P<major>\d*)\.(?P<minor>\d*)", re.I).search
    if Utils.is_win32:
        cmd = fc
    else:
        cmd = fc + ["-logo"]
    out, err = fc_config.getoutput(conf, cmd, stdin=False)
    match = version_re(out) or version_re(err)
    if not match:
        conf.fatal("cannot determine ifort version.")
    k = match.groupdict()
    conf.env["FC_VERSION"] = (k["major"], k["minor"])
开发者ID:hlyes,项目名称:ns-3-dev,代码行数:12,代码来源:ifort.py


示例8: get_g95_version

def get_g95_version(conf,fc):
	version_re=re.compile(r"g95\s*(?P<major>\d*)\.(?P<minor>\d*)").search
	cmd=fc+['--version']
	out,err=fc_config.getoutput(conf,cmd,stdin=False)
	if out:
		match=version_re(out)
	else:
		match=version_re(err)
	if not match:
		conf.fatal('cannot determine g95 version')
	k=match.groupdict()
	conf.env.FC_VERSION=(k['major'],k['minor'])
开发者ID:Gnurou,项目名称:glmark2,代码行数:12,代码来源:g95.py


示例9: get_gfortran_version

def get_gfortran_version(conf, fc):
    """Get the compiler version"""

    # ensure this is actually gfortran, not an imposter.
    version_re = re.compile(r"GNU\s*Fortran", re.I).search
    cmd = fc + ["--version"]
    out, err = fc_config.getoutput(conf, cmd, stdin=False)
    if out:
        match = version_re(out)
    else:
        match = version_re(err)
    if not match:
        conf.fatal("Could not determine the compiler type")

        # --- now get more detailed info -- see c_config.get_cc_version
    cmd = fc + ["-dM", "-E", "-"]
    out, err = fc_config.getoutput(conf, cmd, stdin=True)

    if out.find("__GNUC__") < 0:
        conf.fatal("Could not determine the compiler type")

    k = {}
    out = out.split("\n")
    import shlex

    for line in out:
        lst = shlex.split(line)
        if len(lst) > 2:
            key = lst[1]
            val = lst[2]
            k[key] = val

    def isD(var):
        return var in k

    def isT(var):
        return var in k and k[var] != "0"

    conf.env["FC_VERSION"] = (k["__GNUC__"], k["__GNUC_MINOR__"], k["__GNUC_PATCHLEVEL__"])
开发者ID:RedHatter,项目名称:diodon-plugins,代码行数:39,代码来源:gfortran.py


示例10: get_solstudio_version

def get_solstudio_version(conf, fc):
	"""Get the compiler version"""

	version_re = re.compile(r"Sun Fortran 95 *(?P<major>\d*)\.(?P<minor>\d*)", re.I).search
	cmd = fc + ['-V']

	out, err = fc_config.getoutput(conf,cmd,stdin=False)
	if out: match = version_re(out)
	else: match = version_re(err)
	if not match:
		conf.fatal('Could not determine the Sun Studio Fortran version.')
	k = match.groupdict()
	conf.env['FC_VERSION'] = (k['major'], k['minor'])
开发者ID:Anastasia1302,项目名称:code-pile,代码行数:13,代码来源:fc_solstudio.py


示例11: get_open64_version

def get_open64_version(conf, fc):
	"""Get the Open64 compiler version"""

	version_re = re.compile(r"Open64 Compiler Suite: *Version *(?P<major>\d*)\.(?P<minor>\d*)", re.I).search
	cmd = fc + ['-version']

	out, err = fc_config.getoutput(conf,cmd,stdin=False)
	if out: match = version_re(out)
	else: match = version_re(err)
	if not match:
		conf.fatal('Could not determine the Open64 version.')
	k = match.groupdict()
	conf.env['FC_VERSION'] = (k['major'], k['minor'])
开发者ID:AleemDev,项目名称:waf,代码行数:13,代码来源:fc_open64.py


示例12: get_sxfc_version

def get_sxfc_version(conf, fc):
	version_re = re.compile(r"FORTRAN90/SX\s*Version\s*(?P<major>\d*)\.(?P<minor>\d*)", re.I).search
	cmd = fc + ['-V']
	out,err = fc_config.getoutput(conf, cmd, stdin=False)
	if out: match = version_re(out)
	else: match = version_re(err)
	if not match:
		version_re=re.compile(r"NEC Fortran 2003 Compiler for\s*(?P<major>\S*)\s*\(c\)\s*(?P<minor>\d*)",re.I).search
		if out: match = version_re(out)
		else: match = version_re(err)
		if not match:
			conf.fatal('Could not determine the NEC Fortran compiler version.')
	k = match.groupdict()
	conf.env['FC_VERSION'] = (k['major'], k['minor'])
开发者ID:AleemDev,项目名称:waf,代码行数:14,代码来源:fc_nec.py


示例13: get_ifort_version

def get_ifort_version(conf, fc):
    """get the compiler version"""

    version_re = re.compile(r"ifort\s*\(IFORT\)\s*(?P<major>\d*)\.(?P<minor>\d*)", re.I).search
    cmd = fc + ["--version"]
    out, err = fc_config.getoutput(conf, cmd, stdin=False)
    if out:
        match = version_re(out)
    else:
        match = version_re(err)
    if not match:
        conf.fatal("cannot determine ifort version.")
    k = match.groupdict()
    conf.env["FC_VERSION"] = (k["major"], k["minor"])
开发者ID:RedHatter,项目名称:diodon-plugins,代码行数:14,代码来源:ifort.py


示例14: get_nfort_version

def get_nfort_version(conf,fc):
	version_re=re.compile(r"nfort\s*\(NFORT\)\s*(?P<major>\d+)\.(?P<minor>\d+)\.",re.I).search
	cmd=fc+['--version']
	out,err=fc_config.getoutput(conf,cmd,stdin=False)
	if out:
		match=version_re(out)
	else:
		match=version_re(err)
	if not match:
		return(False)
		conf.fatal('Could not determine the NEC NFORT Fortran compiler version.')
	else:
		k=match.groupdict()
		conf.env['FC_VERSION']=(k['major'],k['minor'])
开发者ID:afeldman,项目名称:waf,代码行数:14,代码来源:fc_nfort.py


示例15: get_nag_version

def get_nag_version(conf, fc):
	"""Get the NAG compiler version"""

	version_re = re.compile(r"^NAG Fortran Compiler *Release *(?P<major>\d*)\.(?P<minor>\d*)", re.M).search
	cmd = fc + ['-V']

	out, err = fc_config.getoutput(conf,cmd,stdin=False)
	if out:
		match = version_re(out)
		if not match:
			match = version_re(err)
	else: match = version_re(err)
	if not match:
		conf.fatal('Could not determine the NAG version.')
	k = match.groupdict()
	conf.env['FC_VERSION'] = (k['major'], k['minor'])
开发者ID:JodyGoldberg,项目名称:waf,代码行数:16,代码来源:fc_nag.py


示例16: get_ifort_version

def get_ifort_version(conf, fc):
	"""get the compiler version"""

	version_re = re.compile(r"Intel[\sa-zA-Z()0-9,-]*Version\s*(?P<major>\d*)\.(?P<minor>\d*)",re.I).search
	if Utils.is_win32:
		cmd = fc
	else:
		cmd = fc + ['-logo']

	out, err = fc_config.getoutput(conf, cmd, stdin=False)
	if out:
		match = version_re(out)
	else:
		match = version_re(err)
	if not match:
		conf.fatal('cannot determine ifort version.')
	k = match.groupdict()
	conf.env['FC_VERSION'] = (k['major'], k['minor'])
开发者ID:edudev,项目名称:waf,代码行数:18,代码来源:ifort.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python edit_handlers.ObjectList类代码示例发布时间:2022-05-26
下一篇:
Python TaskGen.feature函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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