提交 b8e95e20 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

No warning if g++ does not support -march=native

上级 0e35cc21
...@@ -1545,6 +1545,9 @@ class GCC_compiler(object): ...@@ -1545,6 +1545,9 @@ class GCC_compiler(object):
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
shell=True) shell=True)
p.wait() p.wait()
if p.returncode != 0:
return None
stdout = p.stdout.readlines() stdout = p.stdout.readlines()
stderr = p.stderr.readlines() stderr = p.stderr.readlines()
lines = [] lines = []
...@@ -1564,7 +1567,15 @@ class GCC_compiler(object): ...@@ -1564,7 +1567,15 @@ class GCC_compiler(object):
# The '-' at the end is needed. Otherwise, g++ do not output # The '-' at the end is needed. Otherwise, g++ do not output
# enough information. # enough information.
native_lines = get_lines("g++ -march=native -E -v -") native_lines = get_lines("g++ -march=native -E -v -")
_logger.info("g++ -march=native selected lines: %s", native_lines) if native_lines is None:
_logger.info("Call to 'g++ -march=native' failed,"
"not setting -march flag")
detect_march = False
else:
_logger.info("g++ -march=native selected lines: %s",
native_lines)
if detect_march:
if len(native_lines) != 1: if len(native_lines) != 1:
_logger.warn( _logger.warn(
"OPTIMIZATION WARNING: Theano was not able to find the" "OPTIMIZATION WARNING: Theano was not able to find the"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论