提交 a99482bb authored 作者: Frederic's avatar Frederic

Disable g++ not present warning if the user set cxx=

fix gh-2138
上级 5abeca00
import os import os
import logging import logging
import theano
from theano.configparser import (AddConfigVar, BoolParam, ConfigParam, EnumStr, from theano.configparser import (AddConfigVar, BoolParam, ConfigParam, EnumStr,
IntParam, StrParam, TheanoConfigParser) IntParam, StrParam, TheanoConfigParser)
from theano.misc.cpucount import cpuCount from theano.misc.cpucount import cpuCount
...@@ -155,13 +156,19 @@ if rc == 0 and config.cxx != "": ...@@ -155,13 +156,19 @@ if rc == 0 and config.cxx != "":
'vm', 'vm_nogc', 'cvm_nogc'), 'vm', 'vm_nogc', 'cvm_nogc'),
in_c_key=False) in_c_key=False)
else: else:
# g++ is not present, linker should default to python only # g++ is not present or the user disabled it,
# linker should default to python only.
AddConfigVar('linker', AddConfigVar('linker',
("Default linker used if the theano flags mode is Mode " ("Default linker used if the theano flags mode is Mode "
"or ProfileMode(deprecated)"), "or ProfileMode(deprecated)"),
EnumStr('vm', 'py', 'vm_nogc'), EnumStr('vm', 'py', 'vm_nogc'),
in_c_key=False) in_c_key=False)
_logger.warning('g++ not detected ! Theano will be unable to execute ' try:
# If the user provided an empty value for cxx, do not warn.
theano.configparser.fetch_val_for_key('cxx')
except KeyError:
_logger.warning(
'g++ not detected ! Theano will be unable to execute '
'optimized C-implementations (for both CPU and GPU) and will ' 'optimized C-implementations (for both CPU and GPU) and will '
'default to Python implementations. Performance will be severely ' 'default to Python implementations. Performance will be severely '
'degraded. To remove this warning, set Theano flags cxx to an ' 'degraded. To remove this warning, set Theano flags cxx to an '
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论