Skip to content

Commit

Permalink
Refs #4204. Be slighlty more picky about which file is chosen
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Dec 6, 2011
1 parent cf65373 commit b8b6005
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Code/Mantid/Framework/PythonAPI/MantidFramework.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,15 @@
dlloader = libdlopen.loadlibrary
import subprocess

_bin = os.environ['MANTIDPATH']
_bin = os.path.abspath(os.path.dirname(__file__))
pythonlib = os.path.join(_bin,'libMantidPythonAPI.so')
if not os.path.exists(pythonlib):
_bin = os.environ['MANTIDPATH']
pythonlib = os.path.join(_bin,'libMantidPythonAPI.so')
if not os.path.exists(pythonlib):
raise RuntimeError('Unable to find libMantidPythonAPI, cannot continue')

os.environ['MANTIDPATH']
def get_libpath(mainlib, dependency):
if platform.system() == 'Linux':
cmd = 'ldd %s | grep %s' % (mainlib, dependency)
Expand All @@ -80,7 +88,6 @@ def get_libpath(mainlib, dependency):
ldpath = os.environ.get(library_var, "")
ldpath += ":" + _bin
os.environ[library_var] = ldpath
pythonlib = os.path.join(_bin,'libMantidPythonAPI.so')
dlloader(get_libpath(pythonlib, 'stdc++'))
dlloader(get_libpath(pythonlib, 'libNeXus'))
dlloader(get_libpath(pythonlib, 'libMantidKernel'))
Expand Down

0 comments on commit b8b6005

Please sign in to comment.