예제 #1
0
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__'])
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.splitlines()
    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(".")
예제 #3
0
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.splitlines()
    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('.'))
예제 #4
0
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.splitlines()
    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__'])
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('.'))
예제 #6
0
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))
예제 #7
0
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))
예제 #8
0
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'])
예제 #9
0
파일: fc_cray.py 프로젝트: BillTian/waf
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'])
예제 #10
0
파일: ifort.py 프로젝트: hlyes/ns-3-dev
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"])
예제 #11
0
파일: g95.py 프로젝트: Gnurou/glmark2
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'])
예제 #12
0
파일: ifort.py 프로젝트: Gnurou/glmark2
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'])
예제 #13
0
파일: ifort.py 프로젝트: ETLin/ns3-h264-svc
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'])
예제 #14
0
파일: g95.py 프로젝트: sky4D/mavsim
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'])
예제 #15
0
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'])
예제 #16
0
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.splitlines()
    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__"])
예제 #17
0
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'])
예제 #18
0
파일: fc_open64.py 프로젝트: AleemDev/waf
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'])
예제 #19
0
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'])
예제 #20
0
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__"])
예제 #21
0
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'])
예제 #22
0
파일: fc_nfort.py 프로젝트: afeldman/waf
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'])
예제 #23
0
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'])
예제 #24
0
def get_g95_version(conf, fc):
    """get the compiler version"""

    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"])
예제 #25
0
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"])
예제 #26
0
파일: fc_nfort.py 프로젝트: pablolbap/jlv2
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'])
예제 #27
0
파일: fc_nec.py 프로젝트: AleemDev/waf
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'])
예제 #28
0
파일: g77.py 프로젝트: stscicrawford/hstcal
def get_g77_version(conf, fc):
    """Get the compiler version"""

    # ensure this is actually g77, 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__'])
예제 #29
0
파일: fc_nag.py 프로젝트: JodyGoldberg/waf
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'])
예제 #30
0
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'])
예제 #31
0
def get_ifort_version(conf, fc):
    """
    Detects the compiler version and sets ``conf.env.FC_VERSION``
    """
    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"])
예제 #32
0
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'])
예제 #33
0
파일: ifort.py 프로젝트: edudev/waf
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'])
예제 #34
0
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'])