提交 53f07781 authored 作者: Frederic's avatar Frederic

New try to update env variable with os.putenv.

上级 bad57596
...@@ -332,11 +332,18 @@ def default_blas_ldflags(): ...@@ -332,11 +332,18 @@ def default_blas_ldflags():
elif sys.platform == 'darwin': elif sys.platform == 'darwin':
# This is needed to link with # This is needed to link with
new_path = os.path.join(sys.prefix, "lib") new_path = os.path.join(sys.prefix, "lib")
if False: v = os.getenv("DYLD_FALLBACK_LIBRARY_PATH", None)
assert os.getenv("DYLD_FALLBACK_LIBRARY_PATH", None) is None if v is None:
os.environ["DYLD_FALLBACK_LIBRARY_PATH"] = new_path os.putenv("DYLD_FALLBACK_LIBRARY_PATH", new_path)
else: elif new_path not in v.split(":"):
extra = ['-Xlinker -rpath,' + new_path] raise Exception(
"The environment variable "
"'DYLD_FALLBACK_LIBRARY_PATH' is set, but do "
"not contain the '%s' path. This will make "
"Theano use a slow version of BLAS. Update "
"'DYLD_FALLBACK_LIBRARY_PATH' to contain the "
"said value or delete this environment "
"variable.")
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']])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论