Skip to content

Commit a02cf10

Browse files
tz-rrzeadamjstewart
authored andcommitted
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
1 parent 90b34c9 commit a02cf10

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

var/spack/repos/builtin/packages/zoltan/package.py

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,11 @@ def install(self, spec, prefix):
8787

8888
config_args.append('--with-mpi={0}'.format(spec['mpi'].prefix))
8989

90-
mpi_libs = self.get_mpi_libs()
91-
92-
# NOTE: Some external mpi installations may have empty lib
93-
# directory (e.g. bg-q). In this case we need to explicitly
94-
# pass empty library name.
95-
if mpi_libs:
96-
mpi_libs = ' -l'.join(mpi_libs)
97-
config_args.append('--with-mpi-libs=-l{0}'.format(mpi_libs))
98-
else:
99-
config_args.append('--with-mpi-libs= ')
90+
# NOTE: Zoltan assumes that it's linking against an MPI library
91+
# that can be found with '-lmpi' which isn't the case for many
92+
# MPI packages. We rely on the MPI-wrappers to automatically add
93+
# what is required for linking and thus pass an empty list of libs
94+
config_args.append('--with-mpi-libs= ')
10095

10196
# NOTE: Early versions of Zoltan come packaged with a few embedded
10297
# library packages (e.g. ParMETIS, Scotch), which messes with Spack's
@@ -135,18 +130,3 @@ def install(self, spec, prefix):
135130
def get_config_flag(self, flag_name, flag_variant):
136131
flag_pre = 'en' if '+{0}'.format(flag_variant) in self.spec else 'dis'
137132
return '--{0}able-{1}'.format(flag_pre, flag_name)
138-
139-
# NOTE: Zoltan assumes that it's linking against an MPI library that can
140-
# be found with '-lmpi,' which isn't the case for many MPI packages. This
141-
# function finds the names of the actual libraries for Zoltan's MPI dep.
142-
def get_mpi_libs(self):
143-
mpi_libs = set()
144-
145-
for lib_path in glob.glob(join_path(self.spec['mpi'].prefix.lib, '*')):
146-
mpi_lib_match = re.match(
147-
r'^(lib)((\w*)mpi(\w*))\.((a)|({0}))$'.format(dso_suffix),
148-
os.path.basename(lib_path))
149-
if mpi_lib_match:
150-
mpi_libs.add(mpi_lib_match.group(2))
151-
152-
return list(mpi_libs)

0 commit comments

Comments
 (0)