Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
9a0b5d36
提交
9a0b5d36
authored
7月 22, 2016
作者:
ruslanagit
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support paths with spaces on Windows
上级
c24b9572
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
26 行增加
和
13 行删除
+26
-13
configdefaults.py
theano/configdefaults.py
+12
-5
cmodule.py
theano/gof/cmodule.py
+4
-2
__init__.py
theano/sandbox/cuda/__init__.py
+5
-3
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+5
-3
没有找到文件。
theano/configdefaults.py
浏览文件 @
9a0b5d36
...
@@ -430,12 +430,15 @@ if param != "":
...
@@ -430,12 +430,15 @@ if param != "":
del
newp
del
newp
del
distutils
del
distutils
# to support path that includes spaces, we need to wrap it with double quotes on Windows
if
param
and
os
.
name
==
'nt'
:
param
=
'"
%
s"'
%
param
AddConfigVar
(
'cxx'
,
AddConfigVar
(
'cxx'
,
"The C++ compiler to use. Currently only g++ is"
"The C++ compiler to use. Currently only g++ is"
" supported, but supporting additional compilers should not be "
" supported, but supporting additional compilers should not be "
"too difficult. "
"too difficult. "
"If it is empty, no C++ code is compiled."
,
"If it is empty, no C++ code is compiled."
,
StrParam
(
'"
%
s"'
%
param
),
StrParam
(
param
),
in_c_key
=
False
)
in_c_key
=
False
)
del
param
del
param
...
@@ -1201,7 +1204,7 @@ def default_blas_ldflags():
...
@@ -1201,7 +1204,7 @@ def default_blas_ldflags():
use_unix_epd
=
False
use_unix_epd
=
False
if
use_unix_epd
:
if
use_unix_epd
:
return
' '
.
join
(
return
' '
.
join
(
[
'-L
"
%
s"'
%
os
.
path
.
join
(
sys
.
prefix
,
"lib"
)]
+
[
'-L
%
s'
%
os
.
path
.
join
(
sys
.
prefix
,
"lib"
)]
+
[
'-l
%
s'
%
l
for
l
in
blas_info
[
'libraries'
]])
[
'-l
%
s'
%
l
for
l
in
blas_info
[
'libraries'
]])
# Canopy
# Canopy
...
@@ -1234,7 +1237,7 @@ def default_blas_ldflags():
...
@@ -1234,7 +1237,7 @@ def default_blas_ldflags():
if
sys
.
platform
==
"linux2"
or
sys
.
platform
==
"darwin"
:
if
sys
.
platform
==
"linux2"
or
sys
.
platform
==
"darwin"
:
return
' '
.
join
(
return
' '
.
join
(
[
'-L
"
%
s"
'
%
lib_path
]
+
[
'-L
%
s
'
%
lib_path
]
+
[
'-l
%
s'
%
l
for
l
in
blas_info
[
'libraries'
]])
[
'-l
%
s'
%
l
for
l
in
blas_info
[
'libraries'
]])
elif
sys
.
platform
==
'win32'
:
elif
sys
.
platform
==
'win32'
:
return
' '
.
join
(
return
' '
.
join
(
...
@@ -1267,13 +1270,15 @@ def default_blas_ldflags():
...
@@ -1267,13 +1270,15 @@ def default_blas_ldflags():
if
res
:
if
res
:
return
res
return
res
# to support path that includes spaces, we need to wrap it with double quotes on Windows
path_wrapper
=
"
\"
"
if
os
.
name
==
'nt'
else
""
ret
=
(
ret
=
(
# TODO: the Gemm op below should separate the
# TODO: the Gemm op below should separate the
# -L and -l arguments into the two callbacks
# -L and -l arguments into the two callbacks
# that CLinker uses for that stuff. for now,
# that CLinker uses for that stuff. for now,
# we just pass the whole ldflags as the -l
# we just pass the whole ldflags as the -l
# options part.
# options part.
[
'-L
%
s
'
%
l
for
l
in
blas_info
.
get
(
'library_dirs'
,
[])]
+
[
'-L
%
s
%
s
%
s'
%
(
path_wrapper
,
l
,
path_wrapper
)
for
l
in
blas_info
.
get
(
'library_dirs'
,
[])]
+
[
'-l
%
s'
%
l
for
l
in
blas_info
.
get
(
'libraries'
,
[])]
+
[
'-l
%
s'
%
l
for
l
in
blas_info
.
get
(
'libraries'
,
[])]
+
blas_info
.
get
(
'extra_link_args'
,
[]))
blas_info
.
get
(
'extra_link_args'
,
[]))
# For some very strange reason, we need to specify -lm twice
# For some very strange reason, we need to specify -lm twice
...
@@ -1335,7 +1340,9 @@ def try_blas_flag(flags):
...
@@ -1335,7 +1340,9 @@ def try_blas_flag(flags):
}
}
"""
)
"""
)
cflags
=
flags
cflags
=
flags
cflags
.
extend
([
'-L"
%
s"'
%
d
for
d
in
theano
.
gof
.
cmodule
.
std_lib_dirs
()])
# to support path that includes spaces, we need to wrap it with double quotes on Windows
path_wrapper
=
"
\"
"
if
os
.
name
==
'nt'
else
""
cflags
.
extend
([
'-L
%
s
%
s
%
s'
%
(
path_wrapper
,
d
,
path_wrapper
)
for
d
in
theano
.
gof
.
cmodule
.
std_lib_dirs
()])
res
=
GCC_compiler
.
try_compile_tmp
(
res
=
GCC_compiler
.
try_compile_tmp
(
test_code
,
tmp_prefix
=
'try_blas_'
,
test_code
,
tmp_prefix
=
'try_blas_'
,
...
...
theano/gof/cmodule.py
浏览文件 @
9a0b5d36
...
@@ -2251,7 +2251,10 @@ class GCC_compiler(Compiler):
...
@@ -2251,7 +2251,10 @@ class GCC_compiler(Compiler):
cmd
.
extend
(
p
for
p
in
preargs
if
not
p
.
startswith
(
'-O'
))
cmd
.
extend
(
p
for
p
in
preargs
if
not
p
.
startswith
(
'-O'
))
else
:
else
:
cmd
.
extend
(
preargs
)
cmd
.
extend
(
preargs
)
cmd
.
extend
(
'-I"
%
s"'
%
idir
for
idir
in
include_dirs
)
# to support path that includes spaces, we need to wrap it with double quotes on Windows
path_wrapper
=
"
\"
"
if
os
.
name
==
'nt'
else
""
cmd
.
extend
([
'-I
%
s
%
s
%
s'
%
(
path_wrapper
,
idir
,
path_wrapper
)
for
idir
in
include_dirs
])
cmd
.
extend
([
'-L
%
s
%
s
%
s'
%
(
path_wrapper
,
ldir
,
path_wrapper
)
for
ldir
in
lib_dirs
])
if
hide_symbols
and
sys
.
platform
!=
'win32'
:
if
hide_symbols
and
sys
.
platform
!=
'win32'
:
# This has been available since gcc 4.0 so we suppose it
# This has been available since gcc 4.0 so we suppose it
# is always available. We pass it here since it
# is always available. We pass it here since it
...
@@ -2262,7 +2265,6 @@ class GCC_compiler(Compiler):
...
@@ -2262,7 +2265,6 @@ class GCC_compiler(Compiler):
cmd
.
append
(
'-fvisibility=hidden'
)
cmd
.
append
(
'-fvisibility=hidden'
)
cmd
.
extend
([
'-o'
,
lib_filename
])
cmd
.
extend
([
'-o'
,
lib_filename
])
cmd
.
append
(
cppfilename
)
cmd
.
append
(
cppfilename
)
cmd
.
extend
([
'-L"
%
s"'
%
ldir
for
ldir
in
lib_dirs
])
cmd
.
extend
([
'-l
%
s'
%
l
for
l
in
libs
])
cmd
.
extend
([
'-l
%
s'
%
l
for
l
in
libs
])
# print >> sys.stderr, 'COMPILING W CMD', cmd
# print >> sys.stderr, 'COMPILING W CMD', cmd
_logger
.
debug
(
'Running cmd:
%
s'
,
' '
.
join
(
cmd
))
_logger
.
debug
(
'Running cmd:
%
s'
,
' '
.
join
(
cmd
))
...
...
theano/sandbox/cuda/__init__.py
浏览文件 @
9a0b5d36
...
@@ -296,12 +296,14 @@ if ((err = cudnnCreate(&_handle)) != CUDNN_STATUS_SUCCESS) {
...
@@ -296,12 +296,14 @@ if ((err = cudnnCreate(&_handle)) != CUDNN_STATUS_SUCCESS) {
return 1;
return 1;
}
}
"""
"""
# to support path that includes spaces, we need to wrap it with double quotes on Windows
path_wrapper
=
"
\"
"
if
os
.
name
==
'nt'
else
""
params
=
[
"-l"
,
"cudnn"
]
params
=
[
"-l"
,
"cudnn"
]
params
.
extend
([
'-I
"
%
s"'
%
os
.
path
.
dirname
(
__file__
)])
params
.
extend
([
'-I
%
s
%
s
%
s'
%
(
path_wrapper
,
os
.
path
.
dirname
(
__file__
),
path_wrapper
)])
if
config
.
dnn
.
include_path
:
if
config
.
dnn
.
include_path
:
params
.
extend
([
'-I
"
%
s"'
%
config
.
dnn
.
include_path
])
params
.
extend
([
'-I
%
s
%
s
%
s'
%
(
path_wrapper
,
config
.
dnn
.
include_path
,
path_wrapper
)
])
if
config
.
dnn
.
library_path
:
if
config
.
dnn
.
library_path
:
params
.
extend
([
'-L
"
%
s"'
%
config
.
dnn
.
library_path
])
params
.
extend
([
'-L
%
s
%
s
%
s'
%
(
path_wrapper
,
config
.
dnn
.
library_path
,
path_wrapper
)
])
if
config
.
nvcc
.
compiler_bindir
:
if
config
.
nvcc
.
compiler_bindir
:
params
.
extend
([
'--compiler-bindir'
,
params
.
extend
([
'--compiler-bindir'
,
config
.
nvcc
.
compiler_bindir
])
config
.
nvcc
.
compiler_bindir
])
...
...
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
9a0b5d36
...
@@ -321,11 +321,13 @@ class NVCC_compiler(Compiler):
...
@@ -321,11 +321,13 @@ class NVCC_compiler(Compiler):
# the -rpath option is not understood by the Microsoft linker
# the -rpath option is not understood by the Microsoft linker
for
rpath
in
rpaths
:
for
rpath
in
rpaths
:
cmd
.
extend
([
'-Xlinker'
,
','
.
join
([
'-rpath'
,
rpath
])])
cmd
.
extend
([
'-Xlinker'
,
','
.
join
([
'-rpath'
,
rpath
])])
cmd
.
extend
(
'-I
%
s'
%
idir
for
idir
in
include_dirs
)
# to support path that includes spaces, we need to wrap it with double quotes on Windows
path_wrapper
=
"
\"
"
if
os
.
name
==
'nt'
else
""
cmd
.
extend
([
'-I
%
s
%
s
%
s'
%
(
path_wrapper
,
idir
,
path_wrapper
)
for
idir
in
include_dirs
])
cmd
.
extend
([
'-L
%
s
%
s
%
s'
%
(
path_wrapper
,
ldir
,
path_wrapper
)
for
ldir
in
lib_dirs
])
cmd
.
extend
([
'-o'
,
lib_filename
])
cmd
.
extend
([
'-o'
,
lib_filename
])
cmd
.
append
(
os
.
path
.
split
(
cppfilename
)[
-
1
])
cmd
.
append
(
os
.
path
.
split
(
cppfilename
)[
-
1
])
cmd
.
extend
([
'-L"
%
s"'
%
ldir
for
ldir
in
lib_dirs
])
cmd
.
extend
([
'-l
%
s'
%
l
for
l
in
libs
])
cmd
.
extend
([
'-l"
%
s"'
%
l
for
l
in
libs
])
if
sys
.
platform
==
'darwin'
:
if
sys
.
platform
==
'darwin'
:
# This tells the compiler to use the already-loaded python
# This tells the compiler to use the already-loaded python
# symbols (which should always be the right ones).
# symbols (which should always be the right ones).
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论