diff options
author | Gregory Becker <becker33@llnl.gov> | 2016-05-18 17:14:16 -0700 |
---|---|---|
committer | Gregory Becker <becker33@llnl.gov> | 2016-05-18 17:14:16 -0700 |
commit | deb5011d08467c0a19b52e5ee9fefa3fb0854b89 (patch) | |
tree | c06091c38c58709ae3e98b01d675c88a926dd3fb /lib | |
parent | 80310a3b7c09c8b59b3414b0c20aed6c36620675 (diff) | |
download | spack-deb5011d08467c0a19b52e5ee9fefa3fb0854b89.tar.gz spack-deb5011d08467c0a19b52e5ee9fefa3fb0854b89.tar.bz2 spack-deb5011d08467c0a19b52e5ee9fefa3fb0854b89.tar.xz spack-deb5011d08467c0a19b52e5ee9fefa3fb0854b89.zip |
more merge work
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/build_environment.py | 23 | ||||
-rw-r--r-- | lib/spack/spack/spec.py | 10 |
2 files changed, 18 insertions, 15 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 4974cc1e76..7aeea5c672 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -213,13 +213,12 @@ def set_compiler_environment_variables(pkg): if flags[flag] != []: env.set('SPACK_' + flag.upper(), ' '.join(f for f in flags[flag])) -#ifdef NEW env.set('SPACK_COMPILER_SPEC', str(pkg.spec.compiler)) - return env -#else /* not NEW */ + for mod in compiler.modules: load_module(mod) -#endif /* not NEW */ + + return env def set_build_environment_variables(pkg, env): @@ -283,16 +282,13 @@ def set_build_environment_variables(pkg, env): pcdir = join_path(p, maybe, 'pkgconfig') if os.path.isdir(pcdir): pkg_config_dirs.append(pcdir) -#ifdef NEW - env.set_path('PKG_CONFIG_PATH', pkg_config_dirs) - return env -#else /* not NEW */ - path_put_first("PKG_CONFIG_PATH", pkg_config_dirs) + env.prepend_path('PKG_CONFIG_PATH', pkg_config_dirs) if pkg.spec.architecture.target.module_name: load_module(pkg.spec.architecture.target.module_name) -#endif /* not NEW */ + + return env def set_module_variables_for_package(pkg, module): @@ -368,16 +364,13 @@ def set_module_variables_for_package(pkg, module): def get_rpaths(pkg): """Get a list of all the rpaths for a package.""" - for spec in pkg.spec.traverse(root=False): - if spec.external_module: - load_module(spec.external_module) - spec.external = get_path_from_module(spec.external_module) - rpaths = [pkg.prefix.lib, pkg.prefix.lib64] rpaths.extend(d.prefix.lib for d in pkg.spec.dependencies.values() if os.path.isdir(d.prefix.lib)) rpaths.extend(d.prefix.lib64 for d in pkg.spec.dependencies.values() if os.path.isdir(d.prefix.lib64)) + for mod in pkg.spec.compiler.modules: + rpaths.append(get_path_for_module(mod)) return rpaths diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index e61ffc0912..9d217d17ca 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -120,6 +120,7 @@ from spack.version import * from spack.util.string import * from spack.util.prefix import Prefix from spack.virtual import ProviderIndex +from spack.build_environment import get_path_from_module, load_module # Valid pattern for an identifier in Spack identifier_re = r'\w[\w-]*' @@ -1085,6 +1086,15 @@ class Spec(object): if s.namespace is None: s.namespace = spack.repo.repo_for_pkg(s.name).namespace + + for s in self.traverse(root=False): + if spec.external_module: + compiler = spack.compilers.compiler_for_spec(spec.compiler, spec.architecture.platform_os) + for mod in compiler.modules: + load_module(mod) + + spec.external = get_path_from_module(spec.external_module) + # Mark everything in the spec as concrete, as well. self._mark_concrete() |