Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
cbf89c32
提交
cbf89c32
authored
11月 06, 2014
作者:
cocu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix to use user specified compiler
上级
bd482a68
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
9 行删除
+9
-9
cmodule.py
theano/gof/cmodule.py
+8
-8
compiledir.py
theano/gof/compiledir.py
+1
-1
没有找到文件。
theano/gof/cmodule.py
浏览文件 @
cbf89c32
...
@@ -1522,7 +1522,7 @@ def gcc_llvm():
...
@@ -1522,7 +1522,7 @@ def gcc_llvm():
"""
"""
if
gcc_llvm
.
is_llvm
is
None
:
if
gcc_llvm
.
is_llvm
is
None
:
try
:
try
:
p_out
=
output_subprocess_Popen
([
'g++'
,
'--version'
])
p_out
=
output_subprocess_Popen
([
theano
.
config
.
cxx
,
'--version'
])
output
=
p_out
[
0
]
+
p_out
[
1
]
output
=
p_out
[
0
]
+
p_out
[
1
]
except
OSError
:
except
OSError
:
# Typically means g++ cannot be found.
# Typically means g++ cannot be found.
...
@@ -1544,7 +1544,7 @@ class GCC_compiler(object):
...
@@ -1544,7 +1544,7 @@ class GCC_compiler(object):
@staticmethod
@staticmethod
def
version_str
():
def
version_str
():
return
"g++
"
+
gcc_version_str
return
theano
.
config
.
cxx
+
"
"
+
gcc_version_str
@staticmethod
@staticmethod
def
compile_args
():
def
compile_args
():
...
@@ -1611,7 +1611,7 @@ class GCC_compiler(object):
...
@@ -1611,7 +1611,7 @@ 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
(
"
%
s -march=native -E -v -"
%
theano
.
config
.
cxx
)
if
native_lines
is
None
:
if
native_lines
is
None
:
_logger
.
info
(
"Call to 'g++ -march=native' failed,"
_logger
.
info
(
"Call to 'g++ -march=native' failed,"
"not setting -march flag"
)
"not setting -march flag"
)
...
@@ -1625,7 +1625,7 @@ class GCC_compiler(object):
...
@@ -1625,7 +1625,7 @@ class GCC_compiler(object):
if
len
(
native_lines
)
==
0
:
if
len
(
native_lines
)
==
0
:
# That means we did not select the right lines, so
# That means we did not select the right lines, so
# we have to report all the lines instead
# we have to report all the lines instead
reported_lines
=
get_lines
(
"
g++ -march=native -E -v -"
,
reported_lines
=
get_lines
(
"
%
s -march=native -E -v -"
%
theano
.
config
.
cxx
,
parse
=
False
)
parse
=
False
)
else
:
else
:
reported_lines
=
native_lines
reported_lines
=
native_lines
...
@@ -1638,7 +1638,7 @@ class GCC_compiler(object):
...
@@ -1638,7 +1638,7 @@ class GCC_compiler(object):
" problem:
\n
%
s"
,
" problem:
\n
%
s"
,
reported_lines
)
reported_lines
)
else
:
else
:
default_lines
=
get_lines
(
"
g++ -E -v -"
)
default_lines
=
get_lines
(
"
%
s -E -v -"
%
theano
.
config
.
cxx
)
_logger
.
info
(
"g++ default lines:
%
s"
,
default_lines
)
_logger
.
info
(
"g++ default lines:
%
s"
,
default_lines
)
if
len
(
default_lines
)
<
1
:
if
len
(
default_lines
)
<
1
:
_logger
.
warn
(
_logger
.
warn
(
...
@@ -1649,7 +1649,7 @@ class GCC_compiler(object):
...
@@ -1649,7 +1649,7 @@ class GCC_compiler(object):
" 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"
,
" problem:
\n
%
s"
,
get_lines
(
"
g++ -E -v -"
,
parse
=
False
))
get_lines
(
"
%
s -E -v -"
%
theano
.
config
.
cxx
,
parse
=
False
))
else
:
else
:
# Some options are actually given as "-option value",
# Some options are actually given as "-option value",
# we want to treat them as only one token when comparing
# we want to treat them as only one token when comparing
...
@@ -1819,7 +1819,7 @@ class GCC_compiler(object):
...
@@ -1819,7 +1819,7 @@ class GCC_compiler(object):
os
.
close
(
fd
)
os
.
close
(
fd
)
fd
=
None
fd
=
None
p_ret
=
call_subprocess_Popen
(
p_ret
=
call_subprocess_Popen
(
[
'g++'
,
path
,
'-o'
,
exe_path
]
+
flags
)
[
theano
.
config
.
cxx
,
path
,
'-o'
,
exe_path
]
+
flags
)
if
p_ret
!=
0
:
if
p_ret
!=
0
:
compilation_ok
=
False
compilation_ok
=
False
elif
try_run
:
elif
try_run
:
...
@@ -1937,7 +1937,7 @@ class GCC_compiler(object):
...
@@ -1937,7 +1937,7 @@ class GCC_compiler(object):
(
module_name
,
get_lib_extension
()))
(
module_name
,
get_lib_extension
()))
_logger
.
debug
(
'Generating shared lib
%
s'
,
lib_filename
)
_logger
.
debug
(
'Generating shared lib
%
s'
,
lib_filename
)
cmd
=
[
'g++'
,
get_gcc_shared_library_arg
(),
'-g'
]
cmd
=
[
theano
.
config
.
cxx
,
get_gcc_shared_library_arg
(),
'-g'
]
if
config
.
cmodule
.
remove_gxx_opt
:
if
config
.
cmodule
.
remove_gxx_opt
:
cmd
.
extend
(
p
for
p
in
preargs
if
not
p
.
startswith
(
'-O'
))
cmd
.
extend
(
p
for
p
in
preargs
if
not
p
.
startswith
(
'-O'
))
...
...
theano/gof/compiledir.py
浏览文件 @
cbf89c32
...
@@ -22,7 +22,7 @@ from theano.misc.windows import output_subprocess_Popen
...
@@ -22,7 +22,7 @@ from theano.misc.windows import output_subprocess_Popen
_logger
=
logging
.
getLogger
(
"theano.gof.compiledir"
)
_logger
=
logging
.
getLogger
(
"theano.gof.compiledir"
)
try
:
try
:
p_out
=
output_subprocess_Popen
([
'g++'
,
'-dumpversion'
])
p_out
=
output_subprocess_Popen
([
theano
.
config
.
cxx
,
'-dumpversion'
])
gcc_version_str
=
p_out
[
0
]
.
strip
()
.
decode
()
gcc_version_str
=
p_out
[
0
]
.
strip
()
.
decode
()
except
OSError
:
except
OSError
:
# Typically means gcc cannot be found.
# Typically means gcc cannot be found.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论