Skip to content

Commit

Permalink
Refs #4204. Fix for the installed version of MantidFramework on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Dec 6, 2011
1 parent 96210bf commit cf65373
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Code/Mantid/Framework/PythonAPI/MantidFramework.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
dlloader = libdlopen.loadlibrary
import subprocess

_bin = os.path.abspath(os.path.dirname(__file__))
_bin = os.environ['MANTIDPATH']
def get_libpath(mainlib, dependency):
if platform.system() == 'Linux':
cmd = 'ldd %s | grep %s' % (mainlib, dependency)
Expand All @@ -74,9 +74,12 @@ def get_libpath(mainlib, dependency):
# NeXus has to be loaded as well as there seems to be an issue with
# the thread-local storage not being initialized properly unles
# it is loaded before other libraries.
ldpath = os.environ.get("LD_LIBRARY_PATH", "")
library_var = "LD_LIBRARY_PATH"
if platform.system() == 'Darwin':
library_var = 'DY' + library_var
ldpath = os.environ.get(library_var, "")
ldpath += ":" + _bin
os.environ["LD_LIBRARY_PATH"] = ldpath
os.environ[library_var] = ldpath
pythonlib = os.path.join(_bin,'libMantidPythonAPI.so')
dlloader(get_libpath(pythonlib, 'stdc++'))
dlloader(get_libpath(pythonlib, 'libNeXus'))
Expand Down

0 comments on commit cf65373

Please sign in to comment.