Repository: spack/spack

Issue:
Installation issue: intel-oneapi-mpi is incomplete
### Steps to reproduce the issue

<!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->
```console
$ (spack) rscohn2@rscohn1-MOBL:work$ spack install hdf5%intel@2021.1 ^intel-oneapi-mpi
[+] /home/rscohn2/local/Projects/spack/work/opt/spack/linux-ubuntu20.04-skylake/intel-2021.1/intel-oneapi-mpi-2021.1.1-4ipltnk6vi7vm\
oezshrfaysyuaii6ip2
[+] /home/rscohn2/local/Projects/spack/work/opt/spack/linux-ubuntu20.04-skylake/intel-2021.1/zlib-1.2.11-zkxwt5sqzpfpsitx65hqveu3lzw\
rmg5u
==> Installing hdf5-1.10.7-ytdsc3yfdrwemyaaajntq4vnnoyzvdx2
==> No binary for hdf5-1.10.7-ytdsc3yfdrwemyaaajntq4vnnoyzvdx2 found: installing from source
==> Fetching https://spack-llnl-mirror.s3-us-west-2.amazonaws.com/_source-cache/archive/7a/7a1a0a54371275ce2dfc5cd093775bb025c365846\
512961e7e5ceaecb437ef15.tar.gz
############################################################################################################################# 100.0%
==> hdf5: Executing phase: 'autoreconf'
==> hdf5: Executing phase: 'configure'
==> Error: AttributeError: 'Spec' object has no attribute 'mpicc'

/home/rscohn2/local/Projects/spack/work/var/spack/repos/builtin/packages/hdf5/package.py:303, in configure_args:
        300            # interface. Since they are still accessible via the C interface,
        301            # this is not actually a problem.
        302            extra_args += ['--enable-parallel',
  >>    303                           'CC=%s' % self.spec['mpi'].mpicc]
        304
        305            if '+cxx' in self.spec:
        306                extra_args.append('CXX=%s' % self.spec['mpi'].mpicxx)

See build log for details:
  /tmp/rscohn2/spack-stage/spack-stage-hdf5-1.10.7-ytdsc3yfdrwemyaaajntq4vnnoyzvdx2/spack-build-out.txt

(spack) rscohn2@rscohn1-MOBL:work$
...
```





Discussion:
@scheibelp : I found the code in build_systems/intel.py that implements extra logic for packages that provide virtual dependencies and will try to move it over to the oneapi package.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py b/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
--- a/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
@@ -28,6 +28,20 @@ def __init__(self, spec):
                             url_name='mpi_oneapi')
         super(IntelOneapiMpi, self).__init__(spec)
 
+    def setup_dependent_package(self, module, dep_spec):
+        dir = join_path(self.prefix, 'mpi', 'latest', 'bin')
+        self.spec.mpicc  = join_path(dir, 'mpicc')
+        self.spec.mpicxx = join_path(dir, 'mpicxx')
+        self.spec.mpif77 = join_path(dir, 'mpif77')
+        self.spec.mpifc  = join_path(dir, 'mpifc')
+
+    def setup_dependent_build_environment(self, env, dependent_spec):
+        env.set('MPICH_CC', spack_cc)
+        env.set('MPICH_CXX', spack_cxx)
+        env.set('MPICH_F77', spack_f77)
+        env.set('MPICH_F90', spack_fc)
+        env.set('MPICH_FC', spack_fc)
+
     @property
     def libs(self):
         libs = []


Test patch: