cached_cmake: mpifc is not always defined (#46861)

* cached_cmake: mpifc is not always defined
* mpich: only depend on fortran when +fortran
This commit is contained in:
Richard Berger 2024-11-18 15:49:56 -07:00 committed by GitHub
parent c8e4ae08da
commit 73316c3e28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -192,7 +192,10 @@ def initconfig_mpi_entries(self):
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

View File

@ -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")