Skip to content

Commit

Permalink
cached_cmake: mpifc is not always defined (spack#46861)
Browse files Browse the repository at this point in the history
* cached_cmake: mpifc is not always defined
* mpich: only depend on fortran when +fortran
  • Loading branch information
rbberger authored Nov 18, 2024
1 parent c8e4ae0 commit 73316c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/spack/spack/build_systems/cached_cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion var/spack/repos/builtin/packages/mpich/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 73316c3

Please sign in to comment.