Skip to content

Spack prints a warning message before downgrading targets#13513

Merged
tgamblin merged 3 commits intospack:developfrom
alalazo:features/warning_message_when_downgrading
Nov 1, 2019
Merged

Spack prints a warning message before downgrading targets#13513
tgamblin merged 3 commits intospack:developfrom
alalazo:features/warning_message_when_downgrading

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented Oct 30, 2019

fixes #13482

Whenever the default compiler is too old to build for the current host, Spack prints a warning message to make the user aware of the downgrading.

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Oct 30, 2019

With this PR:

$ spack arch
linux-ubuntu18.04-broadwell

$ spack spec zlib %gcc@4.8
Input spec
--------------------------------
zlib%gcc@4.8

Concretized
--------------------------------
==> Warning: cannot build optimized binaries for "broadwell" using gcc@4.8. Downgrading the target to "haswell"
zlib@1.2.11%gcc@4.8+optimize+pic+shared arch=linux-ubuntu18.04-haswell

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Oct 30, 2019

Marked the PR as draft as I am not sure how we want to treat preferences in packages.yaml - should we error out or downgrade as above when we have a target preference in packages.yaml and we specify a compiler that doesn't support it?

@tgamblin
Copy link
Copy Markdown
Member

Proposed wording change to make it clear where the limitation is coming from:

Instead of:

Warning: cannot build optimized binaries for "broadwell" using gcc@4.8. Downgrading the target to "haswell"

Say:

Warning: gcc@4.8 cannot build optimized binaries for 'broadwell'. Using best target possible: 'haswell'

@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented Oct 30, 2019

should we error out or downgrade as above when we have a target preference in packages.yaml and we specify a compiler that doesn't support it?

For now, downgrade and warn here too, as packages.yaml has always been a soft preference. There is probably a larger discussion about enabling it to have hard constraints. @becker33: thoughts?

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Oct 31, 2019

For now, downgrade and warn here too, as packages.yaml has always been a soft preference.

The current behavior for target is a hard requirement. With this packages.yaml:

packages:
  all:
    target: [icelake]

I get the following output when compiling with old compilers:

$ spack spec zlib %gcc@4.8
Input spec
--------------------------------
zlib%gcc@4.8

Concretized
--------------------------------
==> Error: cannot produce optimized binary for micro-architecture 'icelake' with gcc@4.8 [supported compiler versions are 8.0:]

Is this to be considered a bug that needs fixing?

@alalazo alalazo force-pushed the features/warning_message_when_downgrading branch from d02915b to b31b73b Compare October 31, 2019 10:03
@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Oct 31, 2019

@tgamblin With the latest commit target preferences in packages.yaml are considered soft preferences. Added unit tests to ensure that.

@alalazo alalazo marked this pull request as ready for review October 31, 2019 10:33
@tgamblin tgamblin merged commit 42b8355 into spack:develop Nov 1, 2019
@alalazo alalazo deleted the features/warning_message_when_downgrading branch November 1, 2019 10:37
tgamblin pushed a commit that referenced this pull request Nov 1, 2019
* Make package preferences a soft failure for targets, instead of a hard failure.
* Added unit tests for preferences expressed via packages.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Print or log a warning when downgrading targets

2 participants