コード例 #1
0
ファイル: gfortran.py プロジェクト: FlavioFalcao/osmbrowser
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__'])
コード例 #2
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(".")
コード例 #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
ファイル: gfortran.py プロジェクト: blunderbuss1/shell
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
ファイル: cython.py プロジェクト: dagss/distarray-old
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
ファイル: fc_cray.py プロジェクト: sillsdevarchive/wsiwaf
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
ファイル: fc_open64.py プロジェクト: xsleonard/Gnomescroll
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
ファイル: gfortran.py プロジェクト: RedHatter/diodon-plugins
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
ファイル: ifort.py プロジェクト: RedHatter/diodon-plugins
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'])