summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkwryankrattiger <80296582+kwryankrattiger@users.noreply.github.com>2024-06-14 18:07:37 -0500
committerGitHub <noreply@github.com>2024-06-14 19:07:37 -0400
commit72bb656b9e8b67e6151b38ad623f7d29ef241893 (patch)
tree54ac62a68f6365c5d6a6a741042a5fe12056b357
parente092026eb8680473db4aa88053f353a8662aac85 (diff)
downloadspack-72bb656b9e8b67e6151b38ad623f7d29ef241893.tar.gz
spack-72bb656b9e8b67e6151b38ad623f7d29ef241893.tar.bz2
spack-72bb656b9e8b67e6151b38ad623f7d29ef241893.tar.xz
spack-72bb656b9e8b67e6151b38ad623f7d29ef241893.zip
Intel MKL express requirements as requires (#44727)
The ``+cluster` variant requires there be an MPI family known in the spec. When using externals it is easy to miss-configure this requirement leading to a runtime exception which is not desirable. This converts the exception to a package rule.
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py37
1 files changed, 14 insertions, 23 deletions
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py b/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py
index 600c83cbfa..8671595545 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py
@@ -148,6 +148,18 @@ class IntelOneapiMkl(IntelOneApiLibraryPackage):
# cluster libraries need mpi
depends_on("mpi", when="+cluster")
+ # If a +cluster then mpi_family must be set
+ with when("+cluster"):
+ conflicts("mpi_family=none")
+ requires("mpi_family=mpich", when="^intel-oneapi-mpi")
+ requires("mpi_family=mpich", when="^intel-mpi")
+ requires("mpi_family=mpich", when="^mpich")
+ requires("mpi_family=mpich", when="^mvapich")
+ requires("mpi_family=mpich", when="^mvapich2")
+ requires("mpi_family=mpich", when="^cray-mpich")
+ requires("mpi_family=openmpi", when="^openmpi")
+ requires("mpi_family=openmpi", when="^hpcx-mpi")
+
provides("fftw-api@3")
provides("scalapack", when="+cluster")
provides("mkl")
@@ -226,31 +238,10 @@ class IntelOneapiMkl(IntelOneApiLibraryPackage):
libs.append("libmkl_core")
if self.spec.satisfies("+cluster"):
- if any(
- self.spec.satisfies(m)
- for m in [
- "^intel-oneapi-mpi",
- "^intel-mpi",
- "^mpich",
- "^mvapich",
- "^mvapich2",
- "^cray-mpich",
- "mpi_family=mpich",
- ]
- ):
+ if self.spec.satisfies("mpi_family=mpich"):
libs.append(self._xlp64_lib("libmkl_blacs_intelmpi"))
- elif any(
- self.spec.satisfies(m) for m in ["^openmpi", "^hpcx-mpi", "mpi_family=openmpi"]
- ):
+ elif self.spec.satisfies("mpi_family=openmpi"):
libs.append(self._xlp64_lib("libmkl_blacs_openmpi"))
- else:
- raise RuntimeError(
- (
- "intel-oneapi-mkl +cluster requires one of ^intel-oneapi-mpi, "
- "^intel-mpi, ^mpich, ^cray-mpich, mpi_family=mpich, ^openmpi, "
- "^hpcx-mpi, or mpi_family=openmpi"
- )
- )
lib_path = (
self.component_prefix.lib if self.v2_layout else self.component_prefix.lib.intel64