提交 09f6d3e7 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Report all lines if we fail to recognize the right one

上级 c01626c8
...@@ -12,7 +12,6 @@ import subprocess ...@@ -12,7 +12,6 @@ import subprocess
import sys import sys
import tempfile import tempfile
import time import time
import itertools
import distutils.sysconfig import distutils.sysconfig
...@@ -1601,13 +1600,21 @@ class GCC_compiler(object): ...@@ -1601,13 +1600,21 @@ class GCC_compiler(object):
if detect_march: if detect_march:
if len(native_lines) != 1: if len(native_lines) != 1:
if len(native_lines) == 0:
# That means we did not select the right lines, so
# we have to report all the lines instead
reported_lines = get_lines("g++ -march=native -E -v -",
parse=False)
else:
reported_lines = native_lines
_logger.warn( _logger.warn(
"OPTIMIZATION WARNING: Theano was not able to find the" "OPTIMIZATION WARNING: Theano was not able to find the"
" g++ parameters that tune the compilation to your " " g++ parameters that tune the compilation to your "
" specific CPU. This can slow down the execution of Theano" " specific CPU. This can slow down the execution of Theano"
" functions. Please submit the following lines to" " functions. Please submit the following lines to"
" Theano's mailing list so that we can fix this" " Theano's mailing list so that we can fix this"
" problem:\n %s", native_lines) " problem:\n %s",
reported_lines)
else: else:
default_lines = get_lines("g++ -E -v -") default_lines = get_lines("g++ -E -v -")
_logger.info("g++ default lines: %s", default_lines) _logger.info("g++ default lines: %s", default_lines)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论