rpaths for dependencies. elf, dwarf, cmake build on Linux
This commit is contained in:
parent
5d81cfdac6
commit
7d9d4f3484
8
lib/spack/env/cc
vendored
8
lib/spack/env/cc
vendored
@ -10,6 +10,7 @@ def get_path(name):
|
|||||||
|
|
||||||
# Import spack parameters through the build environment.
|
# Import spack parameters through the build environment.
|
||||||
spack_lib = os.environ.get("SPACK_LIB")
|
spack_lib = os.environ.get("SPACK_LIB")
|
||||||
|
spack_prefix = os.environ.get("SPACK_PREFIX")
|
||||||
spack_deps = get_path("SPACK_DEPENDENCIES")
|
spack_deps = get_path("SPACK_DEPENDENCIES")
|
||||||
spack_env_path = get_path("SPACK_ENV_PATH")
|
spack_env_path = get_path("SPACK_ENV_PATH")
|
||||||
if not spack_lib or spack_deps == None:
|
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.lib_path]
|
||||||
arguments += ['-l%s' % path for path in options.libs]
|
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
|
# Unset some pesky environment variables
|
||||||
pop_keys(os.environ, "LD_LIBRARY_PATH", "LD_RUN_PATH", "DYLD_LIBRARY_PATH")
|
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)
|
rcode = cmd(*arguments, fail_on_error=False)
|
||||||
sys.exit(rcode)
|
sys.exit(rcode)
|
||||||
|
@ -111,6 +111,7 @@ def add_commands_to_module(self):
|
|||||||
self.module.install = install
|
self.module.install = install
|
||||||
self.module.rmtree = shutil.rmtree
|
self.module.rmtree = shutil.rmtree
|
||||||
self.module.move = shutil.move
|
self.module.move = shutil.move
|
||||||
|
self.module.remove = os.remove
|
||||||
|
|
||||||
# Useful directories within the prefix
|
# Useful directories within the prefix
|
||||||
self.module.prefix = self.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.etc = new_path(self.prefix, 'etc')
|
||||||
self.module.include = new_path(self.prefix, 'include')
|
self.module.include = new_path(self.prefix, 'include')
|
||||||
self.module.lib = new_path(self.prefix, 'lib')
|
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.libexec = new_path(self.prefix, 'libexec')
|
||||||
self.module.share = new_path(self.prefix, 'share')
|
self.module.share = new_path(self.prefix, 'share')
|
||||||
self.module.doc = new_path(self.module.share, 'doc')
|
self.module.doc = new_path(self.module.share, 'doc')
|
||||||
@ -288,6 +290,9 @@ def setup_install_environment(self):
|
|||||||
for dep in self.dependencies:
|
for dep in self.dependencies:
|
||||||
path_prepend("SPACK_DEPENDENCIES", dep.package.prefix)
|
path_prepend("SPACK_DEPENDENCIES", dep.package.prefix)
|
||||||
|
|
||||||
|
# Install location
|
||||||
|
path_prepend("SPACK_PREFIX", self.prefix)
|
||||||
|
|
||||||
|
|
||||||
def do_install_dependencies(self):
|
def do_install_dependencies(self):
|
||||||
# Pass along paths of dependencies here
|
# Pass along paths of dependencies here
|
||||||
|
@ -46,7 +46,7 @@ def get_next(arg, args):
|
|||||||
if os.path.isdir(target):
|
if os.path.isdir(target):
|
||||||
rpaths.append(target)
|
rpaths.append(target)
|
||||||
else:
|
else:
|
||||||
other_args.extend([arg, target])
|
other_args.extend(['-Wl,' + arg, '-Wl,' + target])
|
||||||
else:
|
else:
|
||||||
other_args.append(arg)
|
other_args.append('-Wl,' + arg)
|
||||||
return rpaths, other_args
|
return rpaths, other_args
|
||||||
|
@ -21,21 +21,22 @@ def clean(self):
|
|||||||
def install(self, prefix):
|
def install(self, prefix):
|
||||||
make.add_default_arg('ARFLAGS=rcs')
|
make.add_default_arg('ARFLAGS=rcs')
|
||||||
|
|
||||||
for dir in dwarf_dirs:
|
# Dwarf doesn't provide an install, so we have to do it.
|
||||||
with working_dir(dir):
|
mkdirp(bin, include, lib, man1)
|
||||||
#configure("--prefix=%s" % prefix, '--enable-shared')
|
|
||||||
configure("--prefix=%s" % prefix)
|
with working_dir('libdwarf'):
|
||||||
|
configure("--prefix=%s" % prefix, '--enable-shared')
|
||||||
make()
|
make()
|
||||||
|
|
||||||
# Dwarf doesn't provide an install. Annoying.
|
|
||||||
mkdirp(bin, include, lib, man1)
|
|
||||||
with working_dir('libdwarf'):
|
|
||||||
install('libdwarf.a', lib)
|
install('libdwarf.a', lib)
|
||||||
#install('libdwarf.so', lib)
|
install('libdwarf.so', lib)
|
||||||
install('libdwarf.h', include)
|
install('libdwarf.h', include)
|
||||||
install('dwarf.h', include)
|
install('dwarf.h', include)
|
||||||
|
|
||||||
with working_dir('dwarfdump2'):
|
with working_dir('dwarfdump2'):
|
||||||
|
configure("--prefix=%s" % prefix)
|
||||||
|
make()
|
||||||
|
|
||||||
install('dwarfdump', bin)
|
install('dwarfdump', bin)
|
||||||
install('dwarfdump.conf', lib)
|
install('dwarfdump.conf', lib)
|
||||||
install('dwarfdump.1', man1)
|
install('dwarfdump.1', man1)
|
||||||
|
@ -7,6 +7,7 @@ class Libelf(Package):
|
|||||||
|
|
||||||
def install(self, prefix):
|
def install(self, prefix):
|
||||||
configure("--prefix=%s" % prefix,
|
configure("--prefix=%s" % prefix,
|
||||||
|
"--enable-shared",
|
||||||
"--disable-dependency-tracking",
|
"--disable-dependency-tracking",
|
||||||
"--disable-debug")
|
"--disable-debug")
|
||||||
make()
|
make()
|
||||||
|
@ -60,9 +60,9 @@ def pkg(msg):
|
|||||||
import platform
|
import platform
|
||||||
from version import Version
|
from version import Version
|
||||||
|
|
||||||
mac_version = platform.mac_ver()[0]
|
mac_ver = platform.mac_ver()[0]
|
||||||
if Version(mac_version) >= Version("10.7"):
|
if mac_ver and Version(mac_ver) >= Version('10.7'):
|
||||||
print u"\U0001F4E6" + indent,
|
print u"\U0001F4E6" + indent,
|
||||||
else:
|
else:
|
||||||
print '[%] ',
|
print '{}[+]{} '.format(green, reset),
|
||||||
print msg
|
print msg
|
||||||
|
Loading…
Reference in New Issue
Block a user