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'])
评论列表
文章目录