Skip to content

packages.yaml: allow virtuals to specify buildable: false#14934

Merged
tgamblin merged 15 commits intodevelopfrom
features/allow-virtual-buildable-false
Mar 31, 2020
Merged

packages.yaml: allow virtuals to specify buildable: false#14934
tgamblin merged 15 commits intodevelopfrom
features/allow-virtual-buildable-false

Conversation

@becker33
Copy link
Copy Markdown
Member

@becker33 becker33 commented Feb 13, 2020

Currently, to force Spack to use an external MPI, you have to specify buildable: False for every MPI provider in Spack in your packages.yaml file. This is both tedious and fragile, as new MPI providers can be added and break your workflow when you do a git pull.

This PR allows you to specify an entire virtual dependency as non-buildable, and specify particular implementations to be built:

packages:
all:
    providers:
        mpi: [mpich]
mpi:
    buildable: false
    paths:
        [email protected] %[email protected]: /usr/packages/mpich-3.2-gcc-7.3.0

will force all Spack builds to use the specified mpich install.

@adamjstewart
Copy link
Copy Markdown
Member

@tgamblin
Copy link
Copy Markdown
Member

@becker33: this needs docs in a follow-on PR

@tgamblin tgamblin requested a review from alalazo March 26, 2020 14:47
@alalazo
Copy link
Copy Markdown
Member

alalazo commented Mar 26, 2020

Tried to test drive this and it seems to work correctly. One comment I have before diving into the implementation is that the error message when trying to enforce another provider:

$ spack spec netlib-scalapack ^openmpi
Input spec
--------------------------------
netlib-scalapack
    ^openmpi

Concretized
--------------------------------
==> Error: The spec
    'openmpi ^autoconf ^automake ^gdbm ^hwloc@:1.999 ^libtool ^[email protected]: ^ncurses ^numactl ^perl ^pkgconfig ^readline'
    is configured as not buildable, and no matching external installs were found

can probably be improved. For instance:

$ spack spec netlib-scalapack ^openmpi
Input spec
--------------------------------
netlib-scalapack
    ^openmpi

Concretized
--------------------------------
==> Error: "mpi" is not buildable and no externals matching "openmpi" were found. Run "spack config get packages" for more details.

Copy link
Copy Markdown
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

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

This LGTM overall, only left minor suggestions to improve implementation details.

Copy link
Copy Markdown
Member

@tgamblin tgamblin left a comment

Choose a reason for hiding this comment

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

@becker33: requesting changes since @alalazo didn't -- I agree with most of his review comments. If we can easily improve the error message, let's do that. If not let's hold it for another PR.

@tgamblin
Copy link
Copy Markdown
Member

oh I guess @alalazo did request changes :). I saw his review as yellow (pending) and then saw his comments and thought they were just comments. thanks @alalazo!

@becker33 becker33 force-pushed the features/allow-virtual-buildable-false branch from 3ca644d to 7e38fda Compare March 31, 2020 21:33
@tgamblin
Copy link
Copy Markdown
Member

@adamjstewart: this is approved -- want to update the config tutorial?

@tgamblin tgamblin merged commit 336191c into develop Mar 31, 2020
jedbrown added a commit that referenced this pull request Mar 31, 2020
* origin/develop:
  packages.yaml: allow virtuals to specify buildable: false (#14934)
  GMT: add 6.0.0 (#15785)
  autoconf-archive: add new package (#15782)
  JasPer: add 2.0.16 (#15781)
  Update link for codecov's browser extensions (#15779)
  geant4: new version 10.6 plus simplifications (#15447)
  ppOpen-APPL/FVM: new package. (#15772)
@adamjstewart adamjstewart deleted the features/allow-virtual-buildable-false branch April 1, 2020 01:20
ax3l added a commit to spack/spack-tutorial that referenced this pull request Jul 22, 2020
Document virtual package configs as documented in spack/spack#14934 (comment)
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.

4 participants