提交 3420f416 authored 作者: lamblin's avatar lamblin

Merge pull request #1176 from abalkin/issue-1175

Fixed a race condition.
......@@ -100,9 +100,16 @@ enum = EnumStr("g++", "")
# in an unusual Python 2.4.4 Windows environment with the default stdin=None.
dummy_stdin = open(os.devnull)
try:
call_subprocess_Popen('g++', stdout=subprocess.PIPE,
try:
rc = call_subprocess_Popen(['g++', '-v'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=dummy_stdin.fileno())
stdin=dummy_stdin).wait()
except OSError:
rc = 1
finally:
dummy_stdin.close()
del dummy_stdin
if rc == 0:
# Keep the default linker the same as the one for the mode FAST_RUN
AddConfigVar('linker',
("Default linker used if the theano flags mode is Mode "
......@@ -110,7 +117,7 @@ try:
EnumStr('cvm', 'c|py', 'py', 'c', 'c|py_nogc', 'c&py',
'vm', 'vm_nogc', 'cvm_nogc'),
in_c_key=False)
except OSError:
else:
# g++ is not present, linker should default to python only
AddConfigVar('linker',
("Default linker used if the theano flags mode is Mode "
......@@ -123,7 +130,6 @@ except OSError:
'degraded.')
enum = EnumStr("")
del dummy_stdin
AddConfigVar('cxx',
"The c++ compiler to use. Currently only g++ is"
" supported. But supporting more is easy if someone want this."
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论