Repository: spack/spack

Issue:
Installation issue: hdf5 ~mpi+subfiling (subfiling VFD requires parallel HDF5 build)
### Steps to reproduce the issue

```console
$ spack spec -li hdf5 ~mpi +subfiling
Input spec
--------------------------------
 -   hdf5

Concretized
--------------------------------
 -   udayehb  hdf5@1.14.0%gcc@11.3.0+cxx+fortran+hl+ipo~java+map~mpi+shared+subfiling+szip+threadsafe+tools api=default build_system=cmake build_type=RelWithDebInfo generator=make patches=0b5dd6f arch=linux-rhel8-zen2
[+]  cuq3yf3      ^cmake@3.26.3%gcc@11.3.0~doc+ncurses+ownlibs build_system=generic build_type=Release arch=linux-rhel8-zen2
[+]  rqi7wnq          ^curl@7.88.1%gcc@11.3.0+gssapi~ldap+libidn2~librtmp~libssh+libssh2+nghttp2 build_system=autotools libs=shared,static patches=7caf935 tls=gnutls,mbedtls,openssl arch=linux-rhel8-zen2
[+]  iipjglz              ^gnutls@3.7.8%gcc@11.3.0+guile+zlib build_system=autotools arch=linux-rhel8-zen2
[+]  vn2be7o                  ^gettext@0.21.1%gcc@11.3.0+bzip2+curses+git+libunistring+libxml2+pic+shared+tar+xz build_system=autotools arch=linux-rhel8-zen2
[+]  lobshny                      ^bzip2@1.0.8%gcc@11.3.0~debug+pic+shared build_system=generic arch=linux-rhel8-zen2
[+]  aquoz53                      ^libiconv@1.17%gcc@11.3.0 build_system=autotools libs=shared,static arch=linux-rhel8-zen2
[+]  p4nyem3                      ^libxml2@2.10.3%gcc@11.3.0+pic~python+shared build_system=autotools arch=linux-rhel8-zen2
[+]  mfxfz7z                      ^tar@1.34%gcc@11.3.0 build_system=autotools zip=pigz arch=linux-rhel8-zen2
[+]  lygsw6b                          ^pigz@2.7%gcc@11.3.0 build_system=makefile arch=linux-rhel8-zen2
[+]  av7lan5                          ^zstd@1.5.5%gcc@11.3.0+programs build_system=makefile compression=lz4,lzma,zlib libs=shared,static arch=linux-rhel8-zen2
[+]  7dfqnqj                              ^lz4@1.9.4%gcc@11.3.0+pic build_system=makefile libs=shared,static arch=linux-rhel8-zen2
[+]  lhmceb4                  ^guile@2.2.6%gcc@11.3.0+readline build_system=autotools threads=none arch=linux-rhel8-zen2
[+]  4ddtpju                      ^bdw-gc@8.2.2%gcc@11.3.0+libatomic-ops build_system=autotools threads=none arch=linux-rhel8-zen2
[+]  5id57uf                          ^libatomic-ops@7.8.0%gcc@11.3.0 build_system=autotools arch=linux-rhel8-zen2
[+]  2paddyd                      ^gmp@6.2.1%gcc@11.3.0+cxx build_system=autotools libs=shared,static patches=69ad2e2 arch=linux-rhel8-zen2
[+]  tvfinbo                          ^autoconf@2.69%gcc@11.3.0 build_system=autotools patches=35c4492,7793209,a49dd5b arch=linux-rhel8-zen2
[+]  ftl7xvi                          ^automake@1.16.5%gcc@11.3.0 build_system=autotools arch=linux-rhel8-zen2
[+]  fziby3c                      ^libffi@3.4.4%gcc@11.3.0 build_system=autotools patches=070b1f3 arch=linux-rhel8-zen2
[+]  422jnim                      ^libtool@2.4.7%gcc@11.3.0 build_system=autotools arch=linux-rhel8-zen2
[+]  fai3ujy                      ^readline@8.2%gcc@11.3.0 build_system=autotools patches=bbf97f1 arch=linux-rhel8-zen2
[+]  ys24eoi                  ^nettle@3.8.1%gcc@11.3.0 build_system=autotools arch=linux-rhel8-zen2
[+]  kzqfvqc                      ^m4@1.4.19%gcc@11.3.0+sigsegv build_system=autotools patches=9dc5fbd,bfdffa7 arch=linux-rhel8-zen2
[+]  yinrd63                          ^libsigsegv@2.14%gcc@11.3.0 build_system=autotools arch=linux-rhel8-zen2
[+]  cfz7dvm              ^krb5@1.20.1%gcc@11.3.0+shared build_system=autotools arch=linux-rhel8-zen2
[+]  geaagva                  ^bison@3.8.2%gcc@11.3.0 build_system=autotools arch=linux-rhel8-zen2
[+]  mp5s5aw                  ^diffutils@3.9%gcc@11.3.0 build_system=autotools arch=linux-rhel8-zen2
[+]  eqe4ljz                  ^findutils@4.9.0%gcc@11.3.0 build_system=autotools patches=440b954 arch=linux-rhel8-zen2
[+]  e6vqsdp              ^libidn2@2.3.4%gcc@11.3.0 build_system=autotools arch=linux-rhel8-zen2
[+]  yxpa2bw                  ^libunistring@1.1%gcc@11.3.0 build_system=autotools arch=linux-rhel8-zen2
[+]  x6ma6gp              ^libssh2@1.11.0%gcc@11.3.0+shared build_system=autotools crypto=mbedtls patches=011d926 arch=linux-rhel8-zen2
[+]  onaga4x                  ^xz@5.4.1%gcc@11.3.0+pic build_system=autotools libs=shared,static arch=linux-rhel8-zen2
[+]  zippd4y              ^mbedtls@2.28.2%gcc@11.3.0+pic build_system=makefile build_type=RelWithDebInfo libs=shared,static arch=linux-rhel8-zen2
[+]  2gsp5ln              ^nghttp2@1.52.0%gcc@11.3.0 build_system=autotools arch=linux-rhel8-zen2
[+]  uhpxoe5              ^openssl@3.1.3%gcc@11.3.0~docs+shared build_system=generic certs=system arch=linux-rhel8-zen2
[+]  cpre3gf                  ^perl@5.36.0%gcc@11.3.0+cpanm+opcode+open+shared+threads build_system=generic arch=linux-rhel8-zen2
[+]  lpy3xqo                      ^berkeley-db@18.1.40%gcc@11.3.0+cxx+docs+stl build_system=autotools patches=26090f4 arch=linux-rhel8-zen2
[+]  cf6xmja                      ^gdbm@1.23%gcc@11.3.0 build_system=autotools arch=linux-rhel8-zen2
[+]  y2wrxak          ^ncurses@6.4%gcc@11.3.0+symlinks+termlib abi=5 build_system=autotools arch=linux-rhel8-zen2
[+]  3e4f3dq      ^gmake@4.4.1%gcc@11.3.0~guile build_system=generic arch=linux-rhel8-zen2
[+]  6nuv4rt      ^libszip@2.1.1%gcc@11.3.0 build_system=autotools arch=linux-rhel8-zen2
[+]  k3xdx2b      ^pkg-config@0.29.2%gcc@11.3.0+internal_glib build_system=autotools arch=linux-rhel8-zen2
[+]  zrp5uo3      ^zlib@1.2.13%gcc@11.3.0+optimize+pic+shared build_system=makefile arch=linux-rhel8-zen2
``

### Error message

Fails during configure stage with the following error:

<details><summary>Error message</summary>
<pre>
...
-- Testing maximum decimal precision for C - 21;33
-- maximum decimal precision for C var - 33
-- Found Perl: /bin/perl (found version "5.26.3")
-- ... disable color and URL extended diagnostic messages
-- ....All Warnings are enabled
CMake Error at CMakeLists.txt:725 (message):
  Subfiling VFD requires a parallel HDF5 build


-- Configuring incomplete, errors occurred!
</pre></details>


### Information on your system

```console
$ spack debug report
* **Spack:** 0.22.0.dev0 (868a3c43e4206f864121cdb81f9613ff260a3a3b)
* **Python:** 3.6.8
* **Platform:** linux-rhel8-zen2
* **Concretizer:** clingo
```


### Additional information

Maintainers are: @brtnfld  @byrnHDF  @gheber  @hyoklee  @lkurz  @lrknox

* [CMakeError.log](https://github.com/spack/spack/files/14067999/CMakeError.log)
* [CMakeOutput.log](https://github.com/spack/spack/files/14068000/CMakeOutput.log)
* [spack-build-env.txt](https://github.com/spack/spack/files/14068001/spack-build-env.txt)
* [spack-build-out.txt](https://github.com/spack/spack/files/14068002/spack-build-out.txt)

This looks to mostly be due to my ignorance/eager to try a new variant; apparently +subfiling requires a parallel build of HDF5.  This should be enforced in the spack recipe.

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py
--- a/var/spack/repos/builtin/packages/hdf5/package.py
+++ b/var/spack/repos/builtin/packages/hdf5/package.py
@@ -88,7 +88,9 @@ class Hdf5(CMakePackage):
     variant("hl", default=False, description="Enable the high-level library")
     variant("cxx", default=False, description="Enable C++ support")
     variant("map", when="@1.14:", default=False, description="Enable MAP API support")
-    variant("subfiling", when="@1.14:", default=False, description="Enable Subfiling VFD support")
+    variant(
+        "subfiling", when="@1.14: +mpi", default=False, description="Enable Subfiling VFD support"
+    )
     variant("fortran", default=False, description="Enable Fortran support")
     variant("java", when="@1.10:", default=False, description="Enable Java support")
     variant("threadsafe", default=False, description="Enable thread-safe capabilities")


Test patch: