Changed rpaths method so that it only grabs rpaths using the compiler module name instead of PrgEnv-x module name
This commit is contained in:
parent
36450b9bc9
commit
175a042fd3
1 changed files with 10 additions and 14 deletions
|
@ -113,7 +113,6 @@ def __call__(self, *args, **kwargs):
|
||||||
|
|
||||||
return super(MakeExecutable, self).__call__(*args, **kwargs)
|
return super(MakeExecutable, self).__call__(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def load_module(mod):
|
def load_module(mod):
|
||||||
"""Takes a module name and removes modules until it is possible to
|
"""Takes a module name and removes modules until it is possible to
|
||||||
load that module. It then loads the provided module. Depends on the
|
load that module. It then loads the provided module. Depends on the
|
||||||
|
@ -145,7 +144,6 @@ def get_path_from_module(mod):
|
||||||
|
|
||||||
# Read the module
|
# Read the module
|
||||||
text = modulecmd('show', mod, output=str, error=str).split('\n')
|
text = modulecmd('show', mod, output=str, error=str).split('\n')
|
||||||
|
|
||||||
# If it lists its package directory, return that
|
# If it lists its package directory, return that
|
||||||
for line in text:
|
for line in text:
|
||||||
if line.find(mod.upper()+'_DIR') >= 0:
|
if line.find(mod.upper()+'_DIR') >= 0:
|
||||||
|
@ -170,11 +168,10 @@ def get_path_from_module(mod):
|
||||||
words = line.split()
|
words = line.split()
|
||||||
path = words[2]
|
path = words[2]
|
||||||
return path[:path.find('/lib')]
|
return path[:path.find('/lib')]
|
||||||
|
|
||||||
# Unable to find module path
|
# Unable to find module path
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def set_compiler_environment_variables(pkg):
|
def set_compiler_environment_variables(pkg, env):
|
||||||
assert(pkg.spec.concrete)
|
assert(pkg.spec.concrete)
|
||||||
compiler = pkg.compiler
|
compiler = pkg.compiler
|
||||||
flags = pkg.spec.compiler_flags
|
flags = pkg.spec.compiler_flags
|
||||||
|
@ -276,14 +273,12 @@ def set_build_environment_variables(pkg, env):
|
||||||
env.set(SPACK_DEBUG_LOG_DIR, spack.spack_working_dir)
|
env.set(SPACK_DEBUG_LOG_DIR, spack.spack_working_dir)
|
||||||
|
|
||||||
# Add any pkgconfig directories to PKG_CONFIG_PATH
|
# Add any pkgconfig directories to PKG_CONFIG_PATH
|
||||||
pkg_config_dirs = []
|
for pre in dep_prefixes:
|
||||||
for p in dep_prefixes:
|
for directory in ('lib', 'lib64', 'share'):
|
||||||
for maybe in ('lib', 'lib64', 'share'):
|
pcdir = join_path(pre, directory, 'pkgconfig')
|
||||||
pcdir = join_path(p, maybe, 'pkgconfig')
|
|
||||||
if os.path.isdir(pcdir):
|
if os.path.isdir(pcdir):
|
||||||
pkg_config_dirs.append(pcdir)
|
#pkg_config_dirs.append(pcdir)
|
||||||
|
env.prepend_path('PKG_CONFIG_PATH',pcdir)
|
||||||
env.prepend_path('PKG_CONFIG_PATH', pkg_config_dirs)
|
|
||||||
|
|
||||||
if pkg.spec.architecture.target.module_name:
|
if pkg.spec.architecture.target.module_name:
|
||||||
load_module(pkg.spec.architecture.target.module_name)
|
load_module(pkg.spec.architecture.target.module_name)
|
||||||
|
@ -369,8 +364,9 @@ def get_rpaths(pkg):
|
||||||
if os.path.isdir(d.prefix.lib))
|
if os.path.isdir(d.prefix.lib))
|
||||||
rpaths.extend(d.prefix.lib64 for d in pkg.spec.dependencies.values()
|
rpaths.extend(d.prefix.lib64 for d in pkg.spec.dependencies.values()
|
||||||
if os.path.isdir(d.prefix.lib64))
|
if os.path.isdir(d.prefix.lib64))
|
||||||
for mod in pkg.spec.compiler.modules:
|
# Second module is our compiler mod name. We use that to get rpaths from
|
||||||
rpaths.append(get_path_for_module(mod))
|
# module show output.
|
||||||
|
rpaths.append(get_path_from_module(pkg.compiler.modules[1]))
|
||||||
return rpaths
|
return rpaths
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue