diff --git a/lib/spack/env/cc b/lib/spack/env/cc index f1ace0d3f7..1f706a7ab6 100755 --- a/lib/spack/env/cc +++ b/lib/spack/env/cc @@ -10,6 +10,7 @@ def get_path(name): # Import spack parameters through the build environment. spack_lib = os.environ.get("SPACK_LIB") +spack_prefix = os.environ.get("SPACK_PREFIX") spack_deps = get_path("SPACK_DEPENDENCIES") spack_env_path = get_path("SPACK_ENV_PATH") if not spack_lib or spack_deps == None: @@ -62,8 +63,15 @@ arguments += other_args arguments += ['-L%s' % path for path in options.lib_path] arguments += ['-l%s' % path for path in options.libs] +spack_rpaths = [spack_prefix] + spack_deps +arguments += ['-Wl,-rpath,%s/lib64' % path for path in spack_rpaths] +arguments += ['-Wl,-rpath,%s/lib' % path for path in spack_rpaths] + # Unset some pesky environment variables pop_keys(os.environ, "LD_LIBRARY_PATH", "LD_RUN_PATH", "DYLD_LIBRARY_PATH") + +sys.stderr.write(" ".join(arguments)) + rcode = cmd(*arguments, fail_on_error=False) sys.exit(rcode) diff --git a/lib/spack/spack/Package.py b/lib/spack/spack/Package.py index 57cefb21a9..5fc1a0be8d 100644 --- a/lib/spack/spack/Package.py +++ b/lib/spack/spack/Package.py @@ -111,6 +111,7 @@ def add_commands_to_module(self): self.module.install = install self.module.rmtree = shutil.rmtree self.module.move = shutil.move + self.module.remove = os.remove # Useful directories within the prefix self.module.prefix = self.prefix @@ -119,6 +120,7 @@ def add_commands_to_module(self): self.module.etc = new_path(self.prefix, 'etc') self.module.include = new_path(self.prefix, 'include') self.module.lib = new_path(self.prefix, 'lib') + self.module.lib64 = new_path(self.prefix, 'lib64') self.module.libexec = new_path(self.prefix, 'libexec') self.module.share = new_path(self.prefix, 'share') self.module.doc = new_path(self.module.share, 'doc') @@ -288,6 +290,9 @@ def setup_install_environment(self): for dep in self.dependencies: path_prepend("SPACK_DEPENDENCIES", dep.package.prefix) + # Install location + path_prepend("SPACK_PREFIX", self.prefix) + def do_install_dependencies(self): # Pass along paths of dependencies here diff --git a/lib/spack/spack/compilation.py b/lib/spack/spack/compilation.py index ee1feabca7..82adfcb917 100644 --- a/lib/spack/spack/compilation.py +++ b/lib/spack/spack/compilation.py @@ -46,7 +46,7 @@ def get_next(arg, args): if os.path.isdir(target): rpaths.append(target) else: - other_args.extend([arg, target]) + other_args.extend(['-Wl,' + arg, '-Wl,' + target]) else: - other_args.append(arg) + other_args.append('-Wl,' + arg) return rpaths, other_args diff --git a/lib/spack/spack/packages/libdwarf.py b/lib/spack/spack/packages/libdwarf.py index 747ac1dd1f..480e3280c0 100644 --- a/lib/spack/spack/packages/libdwarf.py +++ b/lib/spack/spack/packages/libdwarf.py @@ -21,21 +21,22 @@ def clean(self): def install(self, prefix): make.add_default_arg('ARFLAGS=rcs') - for dir in dwarf_dirs: - with working_dir(dir): - #configure("--prefix=%s" % prefix, '--enable-shared') - configure("--prefix=%s" % prefix) - make() - - # Dwarf doesn't provide an install. Annoying. + # Dwarf doesn't provide an install, so we have to do it. mkdirp(bin, include, lib, man1) + with working_dir('libdwarf'): + configure("--prefix=%s" % prefix, '--enable-shared') + make() + install('libdwarf.a', lib) - #install('libdwarf.so', lib) + install('libdwarf.so', lib) install('libdwarf.h', include) install('dwarf.h', include) with working_dir('dwarfdump2'): + configure("--prefix=%s" % prefix) + make() + install('dwarfdump', bin) install('dwarfdump.conf', lib) install('dwarfdump.1', man1) diff --git a/lib/spack/spack/packages/libelf.py b/lib/spack/spack/packages/libelf.py index 7d2aca2102..7daf5c7d89 100644 --- a/lib/spack/spack/packages/libelf.py +++ b/lib/spack/spack/packages/libelf.py @@ -7,6 +7,7 @@ class Libelf(Package): def install(self, prefix): configure("--prefix=%s" % prefix, + "--enable-shared", "--disable-dependency-tracking", "--disable-debug") make() diff --git a/lib/spack/spack/tty.py b/lib/spack/spack/tty.py index 964e9c8945..915fde35d6 100644 --- a/lib/spack/spack/tty.py +++ b/lib/spack/spack/tty.py @@ -60,9 +60,9 @@ def pkg(msg): import platform from version import Version - mac_version = platform.mac_ver()[0] - if Version(mac_version) >= Version("10.7"): + mac_ver = platform.mac_ver()[0] + if mac_ver and Version(mac_ver) >= Version('10.7'): print u"\U0001F4E6" + indent, else: - print '[%] ', + print '{}[+]{} '.format(green, reset), print msg