From a02cf107b5f0f4407a670365de77e286dc562cfa Mon Sep 17 00:00:00 2001 From: TZ Date: Mon, 17 Dec 2018 19:45:49 +0100 Subject: 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 --- var/spack/repos/builtin/packages/zoltan/package.py | 30 ++++------------------ 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'var') 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) -- cgit v1.2.3-60-g2f50