本文整理汇总了Python中waflib.Configure.conf.fatal函数的典型用法代码示例。如果您正苦于以下问题:Python fatal函数的具体用法?Python fatal怎么用?Python fatal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fatal函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: get_emscripten_version
def get_emscripten_version(conf, cc):
"""
Emscripten doesn't support processing '-' like clang/gcc
"""
dummy = conf.cachedir.parent.make_node("waf-emscripten.c")
dummy.write("")
cmd = cc + ['-dM', '-E', '-x', 'c', dummy.abspath()]
env = conf.env.env or None
try:
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
out = p.communicate()[0]
except Exception as e:
conf.fatal('Could not determine emscripten version %r: %s' % (cmd, e))
if not isinstance(out, str):
out = out.decode(sys.stdout.encoding or 'iso8859-1')
k = {}
out = out.splitlines()
for line in out:
lst = shlex.split(line)
if len(lst)>2:
key = lst[1]
val = lst[2]
k[key] = val
if not ('__clang__' in k and 'EMSCRIPTEN' in k):
conf.fatal('Could not determine the emscripten compiler version.')
conf.env.DEST_OS = 'generic'
conf.env.DEST_BINFMT = 'elf'
conf.env.DEST_CPU = 'asm-js'
conf.env.CC_VERSION = (k['__clang_major__'], k['__clang_minor__'], k['__clang_patchlevel__'])
return k
开发者ID:michaelkilchenmann,项目名称:Quantitative_Economic_History,代码行数:35,代码来源:c_emscripten.py
示例2: check_fortran_clib
def check_fortran_clib(self, autoadd=True, *k, **kw):
"""
Obtain the flags for linking with the C library
if this check works, add uselib='CLIB' to your task generators
"""
if not self.env.FC_VERBOSE_FLAG:
self.fatal("env.FC_VERBOSE_FLAG is not set: execute check_fortran_verbose_flag?")
self.start_msg("Getting fortran runtime link flags")
try:
self.check_cc(
fragment=FC_FRAGMENT2,
compile_filename="test.f",
features="fc fcprogram_test",
linkflags=[self.env.FC_VERBOSE_FLAG],
)
except Exception:
self.end_msg(False)
if kw.get("mandatory", True):
conf.fatal("Could not find the c library flags")
else:
out = self.test_bld.err
flags = parse_fortran_link(out.splitlines())
self.end_msg("ok (%s)" % " ".join(flags))
self.env.LINKFLAGS_CLIB = flags
return flags
return []
开发者ID:yotann,项目名称:waf,代码行数:27,代码来源:fc_config.py
示例3: check_libdynamixel
def check_libdynamixel(conf, **kw):
required = 'required' in kw and kw.get('required', False)
includes_check = ['/usr/include', '/usr/local/include']
resibots_dir = conf.options.resibots if hasattr(conf.options, 'resibots') and conf.options.resibots else None
if resibots_dir:
includes_check = [resibots_dir + '/include'] + includes_check
if conf.options.libdynamixel:
includes_check = [conf.options.libdynamixel + '/include'] + includes_check
conf.start_msg('Checking for libdynamixel includes')
try:
res = conf.find_file('dynamixel/dynamixel.hpp', includes_check)
except:
res = False
if res:
conf.env.INCLUDES_LIBDYNAMIXEL = [os.path.expanduser(include) for include in includes_check]
conf.env.DEFINES_LIBDYNAMIXEL = ['USE_LIBDYNAMIXEL']
conf.end_msg('ok')
else:
if conf.options.libdynamixel and resibots_dir:
msg = 'not found in %s nor in %s' % (conf.options.libdynamixel, resibots_dir)
elif conf.options.libdynamixel or resibots_dir:
msg = 'not found in %s' % (conf.options.libdynamixel if conf.options.libdynamixel else resibots_dir)
else:
msg = 'not found, use --libdynamixel=/path/to/libdynamixel or --resibots=/path/to/resibots'
if required:
conf.fatal(msg)
else:
conf.end_msg(msg, 'YELLOW')
开发者ID:resibots,项目名称:libdynamixel,代码行数:33,代码来源:libdynamixel.py
示例4: expand_bundle
def expand_bundle(conf,arg):
if not arg:
return[]
arg=arg.split(',')
if'NONE'in arg and'ALL'in arg:
conf.fatal('Cannot specify both ALL and NONE as dependencies')
candidate_score=dict([(name,0)for name in dependencies])
def check_candidate(c):
if c not in candidate_score:
conf.fatal('Cannot bundle %s, since it is not specified as a'' dependency'%c)
for a in arg:
if a=='ALL':
for candidate in candidate_score:
candidate_score[candidate]+=1
continue
if a=='NONE':
continue
if a.startswith('-'):
a=a[1:]
check_candidate(a)
candidate_score[a]-=1
else:
check_candidate(a)
candidate_score[a]+=1
candidates=[name for name in candidate_score if candidate_score[name]>0]
return candidates
开发者ID:peymanphl,项目名称:correlation,代码行数:26,代码来源:wurf_dependency_bundle.py
示例5: find_dmd
def find_dmd(conf):
conf.find_program(['dmd','dmd2','ldc'],var='D')
out=conf.cmd_and_log([conf.env.D,'--help'])
if out.find("D Compiler v")==-1:
out=conf.cmd_and_log([conf.env.D,'-version'])
if out.find("based on DMD v1.")==-1:
conf.fatal("detected compiler is not dmd/ldc")
开发者ID:AkiraShirase,项目名称:audacity,代码行数:7,代码来源:dmd.py
示例6: ecpp_setuptoolchain
def ecpp_setuptoolchain(conf, arch):
global tool_prefixes
arch = arch.lower()
envname = 'toolchain_%s' % arch
if envname not in conf.all_envs:
conf.setenv(envname, conf.env)
for prefix in tool_prefixes[arch]:
try:
conf.env.stash()
conf.env['TOOL_PREFIX'] = prefix
conf.load('gcc')
conf.load('gxx')
conf.load('gas')
conf.find_program(['strip'], var='STRIP')
conf.find_program(['objcopy'], var='OBJCOPY')
conf.find_program(['objdump'], var='OBJDUMP')
conf.find_program(['nm'], var='NM')
conf.env.append_value('ASFLAGS', ['-g'])
conf.env.append_value('CFLAGS', ['-g', '-Wall'])
conf.env.append_value('CXXFLAGS', ['-g', '-std=c++11','-Wall', '-ftemplate-depth=10000'])
except conf.errors.ConfigurationError:
conf.env.revert()
else:
break
else:
conf.fatal('Could not find a valid toolchain for "%s".' % arch)
else:
conf.setenv(envname)
开发者ID:amesser,项目名称:ecpp,代码行数:34,代码来源:ecpp_toolchain.py
示例7: getoutput
def getoutput(conf,cmd,stdin=False):
input=stdin and'\n'or None
try:
out,err=conf.cmd_and_log(cmd,env=conf.env.env or None,output=0,input=input)
except Exception:
conf.fatal('could not determine the compiler version %r'%cmd)
return(out,err)
开发者ID:hakiri,项目名称:sdn-ns-3,代码行数:7,代码来源:fc_config.py
示例8: find_msvc
def find_msvc(conf):
if sys.platform=='cygwin':
conf.fatal('MSVC module does not work under cygwin Python!')
v=conf.env
path=v.PATH
compiler=v.MSVC_COMPILER
version=v.MSVC_VERSION
compiler_name,linker_name,lib_name=_get_prog_names(conf,compiler)
v.MSVC_MANIFEST=(compiler=='msvc'and version>=8)or(compiler=='wsdk'and version>=6)or(compiler=='intel'and version>=11)
cxx=conf.find_program(compiler_name,var='CXX',path_list=path)
env=dict(conf.environ)
if path:env.update(PATH=';'.join(path))
if not conf.cmd_and_log(cxx+['/nologo','/help'],env=env):
conf.fatal('the msvc compiler could not be identified')
v.CC=v.CXX=cxx
v.CC_NAME=v.CXX_NAME='msvc'
if not v.LINK_CXX:
v.LINK_CXX=conf.find_program(linker_name,path_list=path,errmsg='%s was not found (linker)'%linker_name)
if not v.LINK_CC:
v.LINK_CC=v.LINK_CXX
if not v.AR:
stliblink=conf.find_program(lib_name,path_list=path,var='AR')
if not stliblink:
return
v.ARFLAGS=['/nologo']
if v.MSVC_MANIFEST:
conf.find_program('MT',path_list=path,var='MT')
v.MTFLAGS=['/nologo']
try:
conf.load('winres')
except Errors.ConfigurationError:
Logs.warn('Resource compiler not found. Compiling resource file is disabled')
开发者ID:allencubie,项目名称:lib,代码行数:32,代码来源:msvc.py
示例9: check_omni_vrep
def check_omni_vrep(conf, **kw):
required = 'required' in kw and kw.get('required', False)
includes_check = ['/usr/include', '/usr/local/include']
resibots_dir = conf.options.resibots if hasattr(conf.options, 'resibots') and conf.options.resibots else None
if resibots_dir:
includes_check = [resibots_dir + '/include'] + includes_check
if conf.options.omni_vrep:
includes_check = [conf.options.omni_vrep + '/include'] + includes_check
conf.start_msg('Checking for omni_vrep includes')
try:
res = conf.find_file('omni_vrep/omnipointer.hpp', includes_check)
except:
res = False
if res:
conf.env.INCLUDES_OMNI_VREP = [os.path.expanduser(include) for include in includes_check]
conf.env.DEFINES_OMNI_VREP = ['USE_OMNI_VREP']
conf.end_msg('ok')
else:
if conf.options.omni_vrep and resibots_dir:
msg = 'not found in %s nor in %s' % (conf.options.omni_vrep, resibots_dir)
elif conf.options.omni_vrep or resibots_dir:
msg = 'not found in %s' % (conf.options.omni_vrep if conf.options.omni_vrep else resibots_dir)
else:
msg = 'not found, use --omni_vrep=/path/to/omni_vrep or --resibots=/path/to/resibots'
if required:
conf.fatal(msg)
else:
conf.end_msg(msg, 'YELLOW')
开发者ID:dtbinh,项目名称:omni_simu,代码行数:33,代码来源:omni_vrep.py
示例10: setup_ifort
def setup_ifort(conf, versiondict):
"""
Checks installed compilers and targets and returns the first combination from the user's
options, env, or the global supported lists that checks.
:param versiondict: dict(platform -> dict(architecture -> configuration))
:type versiondict: dict(string -> dict(string -> target_compiler)
:return: the compiler, revision, path, include dirs, library paths and target architecture
:rtype: tuple of strings
"""
platforms = Utils.to_list(conf.env.MSVC_TARGETS) or [i for i,j in all_ifort_platforms]
desired_versions = conf.env.MSVC_VERSIONS or list(reversed(list(versiondict.keys())))
for version in desired_versions:
try:
targets = versiondict[version]
except KeyError:
continue
for arch in platforms:
try:
cfg = targets[arch]
except KeyError:
continue
cfg.evaluate()
if cfg.is_valid:
compiler,revision = version.rsplit(' ', 1)
return compiler,revision,cfg.bindirs,cfg.incdirs,cfg.libdirs,cfg.cpu
conf.fatal('ifort: Impossible to find a valid architecture for building %r - %r' % (desired_versions, list(versiondict.keys())))
开发者ID:afeldman,项目名称:waf,代码行数:27,代码来源:ifort.py
示例11: 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
示例12: 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
示例13: get_suncc_version
def get_suncc_version(conf, cc):
"""
Returns the Sun compiler version
:raise: :py:class:`waflib.Errors.ConfigurationError`
"""
cmd = cc + ['-V']
try:
out, err = conf.cmd_and_log(cmd, output=0)
except Errors.WafError as e:
# Older versions of the compiler exit with non-zero status when reporting their version
if not (hasattr(e, 'returncode') and hasattr(e, 'stdout') and hasattr(e, 'stderr')):
conf.fatal('Could not find suncc %r' % cmd)
out = e.stdout
err = e.stderr
version = (out or err)
version = version.splitlines()[0]
# cc: Sun C 5.10 SunOS_i386 2009/06/03
# cc: Studio 12.5 Sun C++ 5.14 SunOS_sparc Beta 2015/11/17
# cc: WorkShop Compilers 5.0 98/12/15 C 5.0
version_re = re.compile(r'cc: (studio.*?|\s+)?(sun\s+(c\+\+|c)|(WorkShop\s+Compilers))?\s+(?P<major>\d*)\.(?P<minor>\d*)', re.I).search
match = version_re(version)
if match:
k = match.groupdict()
conf.env.CC_VERSION = (k['major'], k['minor'])
else:
conf.fatal('Could not determine the suncc version.')
开发者ID:blablack,项目名称:ams-lv2,代码行数:29,代码来源:c_config.py
示例14: getoutput
def getoutput(conf, cmd, stdin=False):
"""
Obtains Fortran command outputs
"""
from waflib import Errors
if conf.env.env:
env = conf.env.env
else:
env = dict(os.environ)
env['LANG'] = 'C'
input = stdin and '\n'.encode() or None
try:
out, err = conf.cmd_and_log(cmd, env=env, output=0, input=input)
except Errors.WafError as e:
# An WafError might indicate an error code during the command
# execution, in this case we still obtain the stderr and stdout,
# which we can use to find the version string.
if not (hasattr(e, 'stderr') and hasattr(e, 'stdout')):
raise e
else:
# Ignore the return code and return the original
# stdout and stderr.
out = e.stdout
err = e.stderr
except Exception:
conf.fatal('could not determine the compiler version %r' % cmd)
return (out, err)
开发者ID:afeldman,项目名称:waf,代码行数:27,代码来源:fc_config.py
示例15: check_fortran_clib
def check_fortran_clib(self, autoadd=True, *k, **kw):
"""
Obtain flags for linking with the c library
if this check works, add uselib='CLIB' to your task generators
"""
if not self.env.FC_VERBOSE_FLAG:
self.fatal('env.FC_VERBOSE_FLAG is not set: execute check_fortran_verbose_flag?')
self.start_msg('Getting fortran runtime link flags')
try:
self.check_cc(
fragment = FC_FRAGMENT2,
compile_filename = 'test.f',
features = 'fc fcprogram_test',
linkflags = [self.env.FC_VERBOSE_FLAG]
)
except:
self.end_msg(False)
if kw.get('mandatory', True):
conf.fatal('Could not find the c library flags')
else:
out = self.test_bld.err
flags = parse_fortran_link(out.splitlines())
self.end_msg('ok (%s)' % ' '.join(flags))
self.env.CLIB_LINKFLAGS = flags
return flags
return []
开发者ID:zsx,项目名称:waf,代码行数:27,代码来源:fc_config.py
示例16: configure
def configure(conf):
# Which mkspec should we use, by default, use the cxx_default
# that simply fallbacks to use waf auto detect of compiler etc.
mkspec = "cxx_default"
if conf.has_tool_option('cxx_mkspec'):
mkspec = conf.get_tool_option('cxx_mkspec')
conf.msg('Using the mkspec:', mkspec)
# Find and call the mkspec function on the conf object
if hasattr(conf, mkspec):
getattr(conf, mkspec)()
else:
conf.fatal("The mkspec is not available: {0}".format(mkspec))
# Additional flags for C/C++ compiler and linker
if conf.has_tool_option('cflags'):
conf.env['CFLAGS'] += conf.get_tool_option('cflags').split(';')
if conf.has_tool_option('cxxflags'):
conf.env['CXXFLAGS'] += conf.get_tool_option('cxxflags').split(';')
if conf.has_tool_option('linkflags'):
conf.env['LINKFLAGS'] += conf.get_tool_option('linkflags').split(';')
# Common flags to be set for C/C++ compiler and linker
if conf.has_tool_option('commonflags'):
conf.env['CFLAGS'] += conf.get_tool_option('commonflags').split(';')
conf.env['CXXFLAGS'] += conf.get_tool_option('commonflags').split(';')
conf.env['LINKFLAGS'] += conf.get_tool_option('commonflags').split(';')
开发者ID:steinwurf,项目名称:waf-tools,代码行数:30,代码来源:wurf_cxx_mkspec.py
示例17: setup_msvc
def setup_msvc(conf,versions,arch=False):
platforms=getattr(Options.options,'msvc_targets','').split(',')
if platforms==['']:
platforms=Utils.to_list(conf.env['MSVC_TARGETS'])or[i for i,j in all_msvc_platforms+all_icl_platforms+all_wince_platforms]
desired_versions=getattr(Options.options,'msvc_version','').split(',')
if desired_versions==['']:
desired_versions=conf.env['MSVC_VERSIONS']or[v for v,_ in versions][::-1]
versiondict=dict(versions)
for version in desired_versions:
try:
targets=dict(versiondict[version])
for target in platforms:
try:
try:
realtarget,(p1,p2,p3)=targets[target]
except conf.errors.ConfigurationError:
del(targets[target])
else:
compiler,revision=version.rsplit(' ',1)
if arch:
return compiler,revision,p1,p2,p3,realtarget
else:
return compiler,revision,p1,p2,p3
except KeyError:continue
except KeyError:continue
conf.fatal('msvc: Impossible to find a valid architecture for building (in setup_msvc)')
开发者ID:guysherman,项目名称:basic-cpp-template,代码行数:26,代码来源:msvc.py
示例18: get_python_variables
def get_python_variables(conf,variables,imports=['import sys']):
program=list(imports)
program.append('')
for v in variables:
program.append("print(repr(%s))"%v)
os_env=dict(os.environ)
try:
del os_env['MACOSX_DEPLOYMENT_TARGET']
except KeyError:
pass
try:
out=conf.cmd_and_log(conf.env.PYTHON+['-c','\n'.join(program)],env=os_env)
except Errors.WafError:
conf.fatal('The distutils module is unusable: install "python-devel"?')
return_values=[]
for s in out.split('\n'):
s=s.strip()
if not s:
continue
if s=='None':
return_values.append(None)
elif s[0]=="'"and s[-1]=="'":
return_values.append(s[1:-1])
elif s[0].isdigit():
return_values.append(int(s))
else:break
return return_values
开发者ID:FlavioFalcao,项目名称:osmbrowser,代码行数:27,代码来源:python.py
示例19: find_ifort_win32
def find_ifort_win32(conf):
v=conf.env
path=v.PATH
compiler=v.MSVC_COMPILER
version=v.MSVC_VERSION
compiler_name,linker_name,lib_name=_get_prog_names(conf,compiler)
v.IFORT_MANIFEST=(compiler=='intel'and version>=11)
fc=conf.find_program(compiler_name,var='FC',path_list=path)
env=dict(conf.environ)
if path:env.update(PATH=';'.join(path))
if not conf.cmd_and_log(fc+['/nologo','/help'],env=env):
conf.fatal('not intel fortran compiler could not be identified')
v.FC_NAME='IFORT'
if not v.LINK_FC:
conf.find_program(linker_name,var='LINK_FC',path_list=path,mandatory=True)
if not v.AR:
conf.find_program(lib_name,path_list=path,var='AR',mandatory=True)
v.ARFLAGS=['/nologo']
if v.IFORT_MANIFEST:
conf.find_program('MT',path_list=path,var='MT')
v.MTFLAGS=['/nologo']
try:
conf.load('winres')
except Errors.WafError:
Logs.warn('Resource compiler not found. Compiling resource file is disabled')
开发者ID:Gnurou,项目名称:glmark2,代码行数:25,代码来源:ifort.py
示例20: 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
注:本文中的waflib.Configure.conf.fatal函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论