summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTZ <tz-rrze@users.noreply.github.com>2018-12-17 19:45:49 +0100
committerAdam J. Stewart <ajstewart426@gmail.com>2018-12-17 12:45:49 -0600
commita02cf107b5f0f4407a670365de77e286dc562cfa (patch)
tree658bbf8dbe5c367311d8e119b60420615893d958
parent90b34c96d6a255489ccc03c62f64c191130a32ac (diff)
downloadspack-a02cf107b5f0f4407a670365de77e286dc562cfa.tar.gz
spack-a02cf107b5f0f4407a670365de77e286dc562cfa.tar.bz2
spack-a02cf107b5f0f4407a670365de77e286dc562cfa.tar.xz
spack-a02cf107b5f0f4407a670365de77e286dc562cfa.zip
zoltan: rely on MPI wrappers instead of guessing MPI libraries (#8986)
* zoltan: only add gussed MPI libs if no MPI wrappers are used - if MPI-wrappers are used for compilation, we can assume that linking works without manually specifying MPI libs (guessing may result in wrong libs, cf. #8979) - thus, only guess the NPI libs and add them explicitly if no MPI-wrappers are used - use llnl.util.filesystem.find_libraries instead of a locally defined routine to guess the MPI libs if needed (cf. #8979) * zoltan: rely on MPI-wrappers to know the required MPI libs
-rw-r--r--var/spack/repos/builtin/packages/zoltan/package.py30
1 files changed, 5 insertions, 25 deletions
diff --git a/var/spack/repos/builtin/packages/zoltan/package.py b/var/spack/repos/builtin/packages/zoltan/package.py
index 3fd29e17c3..bda22c0757 100644
--- a/var/spack/repos/builtin/packages/zoltan/package.py
+++ b/var/spack/repos/builtin/packages/zoltan/package.py
@@ -87,16 +87,11 @@ class Zoltan(Package):
config_args.append('--with-mpi={0}'.format(spec['mpi'].prefix))
- mpi_libs = self.get_mpi_libs()
-
- # NOTE: Some external mpi installations may have empty lib
- # directory (e.g. bg-q). In this case we need to explicitly
- # pass empty library name.
- if mpi_libs:
- mpi_libs = ' -l'.join(mpi_libs)
- config_args.append('--with-mpi-libs=-l{0}'.format(mpi_libs))
- else:
- config_args.append('--with-mpi-libs= ')
+ # NOTE: Zoltan assumes that it's linking against an MPI library
+ # that can be found with '-lmpi' which isn't the case for many
+ # MPI packages. We rely on the MPI-wrappers to automatically add
+ # what is required for linking and thus pass an empty list of libs
+ config_args.append('--with-mpi-libs= ')
# NOTE: Early versions of Zoltan come packaged with a few embedded
# library packages (e.g. ParMETIS, Scotch), which messes with Spack's
@@ -135,18 +130,3 @@ class Zoltan(Package):
def get_config_flag(self, flag_name, flag_variant):
flag_pre = 'en' if '+{0}'.format(flag_variant) in self.spec else 'dis'
return '--{0}able-{1}'.format(flag_pre, flag_name)
-
- # NOTE: Zoltan assumes that it's linking against an MPI library that can
- # be found with '-lmpi,' which isn't the case for many MPI packages. This
- # function finds the names of the actual libraries for Zoltan's MPI dep.
- def get_mpi_libs(self):
- mpi_libs = set()
-
- for lib_path in glob.glob(join_path(self.spec['mpi'].prefix.lib, '*')):
- mpi_lib_match = re.match(
- r'^(lib)((\w*)mpi(\w*))\.((a)|({0}))$'.format(dso_suffix),
- os.path.basename(lib_path))
- if mpi_lib_match:
- mpi_libs.add(mpi_lib_match.group(2))
-
- return list(mpi_libs)