Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match bootstrapped compiler to architecture #14059

Merged
merged 1 commit into from Dec 15, 2019

Conversation

becker33
Copy link
Member

@becker33 becker33 commented Dec 9, 2019

@scottwittenburg noticed that when bootstrapping compilers, we just concretize the compiler spec without trying to match its arch/os to the spec it came from.

This PR ensures that the bootstrapped compiler is built for the same architecture as the spec for which it is being bootstrapped.

@@ -1509,6 +1509,7 @@ def bootstrap_compiler(self, **kwargs):
)
if not compilers:
dep = spack.compilers.pkg_spec_for_compiler(self.spec.compiler)
dep.architecture = self.spec.architecture
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 nitpicks @becker33:

  1. Should we be this specific, or should we use the family? I'm just curious because I thought there was a discussion where when we detect compilers we add the family as the target.
  2. What about cross-compiled environments? Should we use the frontend family if the target is the backend? Given that I'm not sure we can handle that situation properly now anyway I am not sure I care for this PR, but I thought I'd ask.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could put os=fe target=fe in, although that would require a bit more refactoring. Not too much though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tgamblin on point 1, the target of a compiler and the target for which a compiler package is built are different things. We definitely want the compiler target to be the family, because that controls which processors it knows about for cross-compilation. But some users probably want their compilers built for the fastest architecture they can, to speed up build times. I don't know how much of a difference in build time it makes to build the compiler for broadwell vs x86_64, but it could be enough to be worth something.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I will merge this for now (cc: @scottwittenburg), and this may not even be an issue when compilers are dependencies. I definitely think there is some stuff we need to flesh out for compiler modeling.

The way we currently handle the target attribute is not quite as clear about where the compiler runs and what it targets as I'd like it to be -- I think we use the target for both...

@tgamblin tgamblin added this to Todo in Spack v0.14.0 release via automation Dec 15, 2019
Spack v0.14.0 release automation moved this from Todo to In review Dec 15, 2019
@tgamblin tgamblin merged commit 9f1d728 into develop Dec 15, 2019
Spack v0.14.0 release automation moved this from In review to Done Dec 15, 2019
@tgamblin tgamblin deleted the bugfix/match-boostrapped-compiler-to-arch branch December 24, 2019 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants