bugfix: make compiler preferences slightly saner#17590
Merged
Conversation
tgamblin
commented
Jul 20, 2020
Member
|
This fixes some issues I've been seeing when using default compilers on LLNL's GPU platforms (e.g. |
Member
alalazo
reviewed
Jul 20, 2020
alalazo
reviewed
Jul 20, 2020
f23143d to
de5712c
Compare
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.
becker33
approved these changes
Jul 21, 2020
alalazo
approved these changes
Jul 21, 2020
becker33
pushed a commit
that referenced
this pull request
Jul 23, 2020
* 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()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
gfortranbut you havegfortran-8, you can detectclangthat has no configured C compiler -- justf77andf90. This happens frequently on macOS with homebrew. The bug is due to some kludginess about the way we detect mixedclang/gfortran.We can prefer suffixed versions of compilers to non-suffixed versions, which means we may select
clang-gpuoverclangat LLNL. But,clang-gpuis not actually clang, and it can break builds. We should preferclangif it's available.This is related to #17542. It's really a stop-gap, since when we make compilers into proper dependencies we won't need these heuristics -- we'll just satisfy virtual dependencies.
@xjrc @alalazo @becker33 @gyllenhaal1