bugfix: make compiler preferences slightly saner (#17590)
* bugfix: make compiler preferences slightly saner This fixes two issues with the way we currently select compilers. If multiple compilers have the same "id" (os/arch/compiler/version), we currently prefer them by picking this one with the most supported languages. This can have some surprising effects: * If you have no `gfortran` but you have `gfortran-8`, you can detect `clang` that has no configured C compiler -- just `f77` and `f90`. This happens frequently on macOS with homebrew. The bug is due to some kludginess about the way we detect mixed `clang`/`gfortran`. * We can prefer suffixed versions of compilers to non-suffixed versions, which means we may select `clang-gpu` over `clang` at LLNL. But, `clang-gpu` is not actually clang, and it can break builds. We should prefer `clang` if it's available. - [x] prefer compilers that have C compilers and prefer no name variation to variation. * tests: add test for which()
Showing
- lib/spack/spack/compiler.py 13 additions, 1 deletionlib/spack/spack/compiler.py
- lib/spack/spack/compilers/__init__.py 33 additions, 16 deletionslib/spack/spack/compilers/__init__.py
- lib/spack/spack/test/cmd/compiler.py 121 additions, 1 deletionlib/spack/spack/test/cmd/compiler.py
- lib/spack/spack/test/util/executable.py 18 additions, 0 deletionslib/spack/spack/test/util/executable.py
- lib/spack/spack/util/executable.py 6 additions, 1 deletionlib/spack/spack/util/executable.py
Loading
Please register or sign in to comment