handle use of an unconfigured compiler#41213
Merged
rscohn2 merged 5 commits intospack:developfrom Nov 27, 2023
Merged
Conversation
becker33
previously approved these changes
Nov 22, 2023
Member
Author
|
@becker33 : you approval was dismissed when I added more changes. Can you look at it again? |
becker33
reviewed
Nov 22, 2023
Comment on lines
+157
to
+164
| if not compiler.cc: | ||
| tty.warn(f"{compiler.spec} does not have a C compiler") | ||
| if not compiler.cxx: | ||
| tty.warn(f"{compiler.spec} does not have a C++ compiler") | ||
| if not compiler.f77: | ||
| tty.warn(f"{compiler.spec} does not have a Fortran77 compiler") | ||
| if not compiler.fc: | ||
| tty.warn(f"{compiler.spec} does not have a Fortran compiler") |
Member
There was a problem hiding this comment.
I think this is going to get very verbose for macos users, since they generally have an apple-clang compiler configured with no fortran.
Member
Author
There was a problem hiding this comment.
The warning only comes when you add to your compilers.yaml, which is not too often. I could only warn about a missing C compiler or only about %intel compiler. Would any of those be ok?
becker33
approved these changes
Nov 27, 2023
Member
|
@becker33 should this be backported as a bug fix? |
Member
|
Yes, do we have an active backport branch at the moment? |
Member
|
Yes |
becker33
pushed a commit
that referenced
this pull request
Nov 27, 2023
This was referenced Nov 29, 2023
This was referenced Nov 29, 2023
alalazo
pushed a commit
that referenced
this pull request
Jan 10, 2024
RikkiButler20
pushed a commit
to RikkiButler20/spack
that referenced
this pull request
Jan 31, 2024
vjranagit
pushed a commit
to vjranagit/spack
that referenced
this pull request
Jan 18, 2026
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.
If you configure a Fortran compiler, but not a C compiler, then spack will not set CC and it can silently use the system compiler. This can happen if you use
spack compiler findto configure%intel@2024, which does not have a C compiler.There is some logic in the wrapper to handle this case:
spack/lib/spack/env/cc
Line 340 in f2192a4
But it is not reached because if you do not configure a C compiler, it does not enable a compiler wrapper. This change enables a default compiler wrapper when there is no configured compiler.
Here is what you see in
spack-build-out.txtwhen building a project that uses configure:And the
config.logshows:It isn't always convenient to examine the log files, so I also added a warning when adding a configuration with missing compilers: