提交 305402ba authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #1805 from abergeron/fix_sdot_fix

Hacky fix to the MKL problem with canopy and possibly other.
...@@ -6,6 +6,7 @@ ourselves into the C code ...@@ -6,6 +6,7 @@ ourselves into the C code
import logging import logging
import textwrap import textwrap
import sys import sys
import os
from theano import config from theano import config
from theano.gof.cmodule import GCC_compiler from theano.gof.cmodule import GCC_compiler
...@@ -49,8 +50,17 @@ def detect_macos_sdot_bug(): ...@@ -49,8 +50,17 @@ def detect_macos_sdot_bug():
# Library directories should also be added as rpath, # Library directories should also be added as rpath,
# so that they can be loaded even if the environment # so that they can be loaded even if the environment
# variable LD_LIBRARY_PATH does not contain them # variable LD_LIBRARY_PATH does not contain them
lib_path = os.environ.get('DYLD_FALLBACK_LIBRARY_PATH', '').split(':')
if f.startswith('-L'): if f.startswith('-L'):
flags.append('-Wl,-rpath,' + f[2:]) flags.append('-Wl,-rpath,' + f[2:])
# also append those paths to DYLD_FALLBACK_LIBRARY_PATH to
# support libraries that have the wrong install_name
# (such as MKL on canopy installs)
if (f[2:] not in lib_path):
lib_path.append(f[2:])
# this goes into the python process environment that is
# inherited by subprocesses/used by dyld when loading new objects
os.environ['DYLD_FALLBACK_LIBRARY_PATH'] = ':'.join(lib_path)
test_code = textwrap.dedent("""\ test_code = textwrap.dedent("""\
extern "C" float sdot_(int*, float*, int*, float*, int*); extern "C" float sdot_(int*, float*, int*, float*, int*);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论