From 84073466e61f5c4074e5fba4e41c008f9c38ff61 Mon Sep 17 00:00:00 2001 From: Ken Raffenetti Date: Wed, 3 Aug 2022 02:21:50 -0500 Subject: mpich: fix hwloc config option for version >= 4.0 (#31874) In MPICH 4.0, the config option for external hwloc changed from --with-hwloc-prefix to --with-hwloc --- var/spack/repos/builtin/packages/mpich/package.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index 2167ebbfd9..88c84de801 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -280,7 +280,7 @@ with '-Wl,-commons,use_dylibs' and without for exe in exes: variants = [] output = Executable(exe)(output=str, error=str) - if re.search(r"--with-hwloc-prefix=embedded", output): + if re.search(r"--with-hwloc(-prefix)*=embedded", output): variants.append("~hwloc") if re.search(r"--with-pm=hydra", output): @@ -457,9 +457,6 @@ with '-Wl,-commons,use_dylibs' and without config_args = [ "--disable-silent-rules", "--enable-shared", - "--with-hwloc-prefix={0}".format( - spec["hwloc"].prefix if "^hwloc" in spec else "embedded" - ), "--with-pm={0}".format("hydra" if "+hydra" in spec else "no"), "--{0}-romio".format("enable" if "+romio" in spec else "disable"), "--{0}-ibverbs".format("with" if "+verbs" in spec else "without"), @@ -467,6 +464,18 @@ with '-Wl,-commons,use_dylibs' and without "--with-yaksa={0}".format(spec["yaksa"].prefix if "^yaksa" in spec else "embedded"), ] + # hwloc configure option changed in 4.0 + if spec.satisfies("@4.0:"): + config_args.append( + "--with-hwloc={0}".format(spec["hwloc"].prefix if "^hwloc" in spec else "embedded") + ) + else: + config_args.append( + "--with-hwloc-prefix={0}".format( + spec["hwloc"].prefix if "^hwloc" in spec else "embedded" + ) + ) + if "~fortran" in spec: config_args.append("--disable-fortran") -- cgit v1.2.3-60-g2f50