提交 05e72586 authored 作者: nouiz's avatar nouiz

Merge pull request #1042 from jlowin/cutils_ext-import-fix

cutils_ext import fix -- allow theano to run on picloud servers (not CVM)
......@@ -34,3 +34,4 @@ theano/generated_version.py.out
distribute-*.egg
distribute-*.tar.gz
Theano.suo
*.DS_Store
......@@ -57,9 +57,18 @@ def compile_cutils():
preargs=args)
try:
# Must be at the beginning to ensure no conflict with other project
# that would use the same module name.
# See gh issue #728 for why these lines are here. Summary: compiledir
# must be at the beginning of the path to avoid conflicts with any other
# cutils_ext modules that might exist. An __init__.py file must be created
# for the same reason. Note that these 5 lines may seem redundant (they are
# repeated in compile_str()) but if another cutils_ext does exist then it
# will be imported and compile_str won't get called at all.
sys.path.insert(0, config.compiledir)
location = os.path.join(config.compiledir, 'cutils_ext')
if not os.path.exists(location):
os.mkdir(location)
file(os.path.join(location, "__init__.py"), 'w').close()
try:
from cutils_ext.cutils_ext import *
except ImportError:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论