summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Berger <rberger@lanl.gov>2024-11-18 15:49:56 -0700
committerGitHub <noreply@github.com>2024-11-18 14:49:56 -0800
commit73316c3e286d548b22dc65667810e4631479c3ea (patch)
tree1da282946c644b32f1bd96d29916d1bbc34ee80c
parentc8e4ae08da9ec5e14af6d0d8e0dd362031354ff5 (diff)
downloadspack-73316c3e286d548b22dc65667810e4631479c3ea.tar.gz
spack-73316c3e286d548b22dc65667810e4631479c3ea.tar.bz2
spack-73316c3e286d548b22dc65667810e4631479c3ea.tar.xz
spack-73316c3e286d548b22dc65667810e4631479c3ea.zip
cached_cmake: mpifc is not always defined (#46861)
* cached_cmake: mpifc is not always defined * mpich: only depend on fortran when +fortran
-rw-r--r--lib/spack/spack/build_systems/cached_cmake.py5
-rw-r--r--var/spack/repos/builtin/packages/mpich/package.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/spack/spack/build_systems/cached_cmake.py b/lib/spack/spack/build_systems/cached_cmake.py
index c22068e5ca..273eb070b1 100644
--- a/lib/spack/spack/build_systems/cached_cmake.py
+++ b/lib/spack/spack/build_systems/cached_cmake.py
@@ -192,7 +192,10 @@ class CachedCMakeBuilder(CMakeBuilder):
entries.append(cmake_cache_path("MPI_C_COMPILER", spec["mpi"].mpicc))
entries.append(cmake_cache_path("MPI_CXX_COMPILER", spec["mpi"].mpicxx))
- entries.append(cmake_cache_path("MPI_Fortran_COMPILER", spec["mpi"].mpifc))
+
+ # not all MPIs have Fortran wrappers
+ if hasattr(spec["mpi"], "mpifc"):
+ entries.append(cmake_cache_path("MPI_Fortran_COMPILER", spec["mpi"].mpifc))
# Check for slurm
using_slurm = False
diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py
index f97ce4f545..a1816d401a 100644
--- a/var/spack/repos/builtin/packages/mpich/package.py
+++ b/var/spack/repos/builtin/packages/mpich/package.py
@@ -60,7 +60,7 @@ class Mpich(AutotoolsPackage, CudaPackage, ROCmPackage):
depends_on("c", type="build") # generated
depends_on("cxx", type="build") # generated
- depends_on("fortran", type="build") # generated
+ depends_on("fortran", type="build", when="+fortran")
variant("hwloc", default=True, description="Use external hwloc package")
variant("hydra", default=True, description="Build the hydra process manager")