Skip to content

Commit

Permalink
Ensure that we can propagate the correct library path
Browse files Browse the repository at this point in the history
On OS X El Capitan we need to explicitly copy LSST_LIBRARY_PATH
to DYLD_LIBRARY_PATH. We use a sconsUtils utility function for this.
  • Loading branch information
timj committed Jan 29, 2016
1 parent fdd2c1c commit e5dfd5a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions hsc/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ import os

# scons steals our environment away, so we have to reinstate it
env = lsst.sconsUtils.env.Clone()
environ = dict((name, os.environ[name]) for name in ("PYTHONPATH", "LD_LIBRARY_PATH",
"DYLD_LIBRARY_PATH", "PATH"))
env.Append(**environ)
# scons also hacks sys.path, so we need to set PYTHONPATH very explicitly at the start of each command.
python = "PYTHONPATH=%s " % environ["PYTHONPATH"]
for name in ("PYTHONPATH", "LD_LIBRARY_PATH",
"DYLD_LIBRARY_PATH", "PATH"):
if name in os.environ:
env.AppendENVPath(name, os.environ[name])

# we may need an explicit library load path specified in the command
libpathstr = lsst.sconsUtils.utils.libraryLoaderEnvironment()

# We always run these commands with an explicit python rather than relying on the shebang
python = "{} python".format(libpathstr)

dep = "#python/lsst/obs/subaru/_subaruLib.so" # Dependency required for running the python scripts

Expand Down

0 comments on commit e5dfd5a

Please sign in to comment.