Steps to reproduce
I ran into an issue where I need to enforce the same compiler chain on all packages built by Spack. Spack lost the use of gfortran on my dependencies and went with just using flang, which I did not want. The important take away is the high level package does not depend on fortran but packages under it do. The quick fix was to add depends_on("fortran", type="build") to the high level package but that is not ideal.
Here is a minimal thing to show what is wrong:
Compiler toolchain:
toolchains:
clang_19:
- spec: '%cxx=llvm'
when: '%cxx'
- spec: '%fortran=gcc'
when: '%fortran'
Minimal Packages:
class TopLevel(CMakePackage):
depends_on("lowlevel")
depends_on("cxx", type="build")
class LowLevel(CMakePackage):
depends_on("fortran", type="build")
Minimal concretization of showing the wrong fortran compiler:
==> Concretized 1 spec:
- cjd6jhd serac@develop fflags=-fPIC ~asan~cuda+devtools+enzyme~ipo+openmp~petsc+profiling+raja~rocm~shared~slepc+strumpack+sundials+tribol+umpire build_system=cmake build_type=Release dev_path=/serac/repo generator=make arch=linux-rhel8-ivybridge %c,cxx=clang@19.1.7
- tnt5ej5 ^adiak@0.4.1 fflags=-fPIC ~ipo+mpi~shared build_system=cmake build_type=Release commit=7ac997111785bee6d9391664b1d18ebc2b3c557b generator=make arch=linux-rhel8-ivybridge %c,cxx,fortran=clang@19.1.7
@scheibelp
Error message
No response
Information on your system
General information
Steps to reproduce
I ran into an issue where I need to enforce the same compiler chain on all packages built by Spack. Spack lost the use of
gfortranon my dependencies and went with just usingflang, which I did not want. The important take away is the high level package does not depend on fortran but packages under it do. The quick fix was to adddepends_on("fortran", type="build")to the high level package but that is not ideal.Here is a minimal thing to show what is wrong:
Compiler toolchain:
Minimal Packages:
Minimal concretization of showing the wrong fortran compiler:
@scheibelp
Error message
No response
Information on your system
General information
spack debug reportand reported the version of Spack/Python/Platform