diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2015-06-07 15:21:31 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2015-06-07 15:36:53 -0700 |
commit | 0fc3b58890ddb18c4a2384c6f015c8f9417a1c01 (patch) | |
tree | 35c03c1d998c1c3fea5ac4f703c0175143d7c7f4 /bin | |
parent | 0570660d8109eb0a1a1d80ab104f9a7ad5ecc623 (diff) | |
download | spack-0fc3b58890ddb18c4a2384c6f015c8f9417a1c01.tar.gz spack-0fc3b58890ddb18c4a2384c6f015c8f9417a1c01.tar.bz2 spack-0fc3b58890ddb18c4a2384c6f015c8f9417a1c01.tar.xz spack-0fc3b58890ddb18c4a2384c6f015c8f9417a1c01.zip |
SPACK-38: Allow specs to be indexed by virtual dependencies.
- The following now work differently:
spec['mpi']
spec['blas']
This can return a spec for openmpi, mpich, mvapich, etc., EVEN if
the spec is already concretized. This means that in a package that
`depends_on('mpi')`, you can do `spec['mpi']` to see what it was
concretized to. This should simplify MPI and BLAS packages.
'mpi' in spec
'blas' in spec
Previously, if the spec had been concretized, these would be `False`
because there was not a dependency in the DAG with either of these
names. These will now be `True` even if the spec has been
concretized. So, e.g., this will print "YES"
s = Spec('callpath ^mpich')
if 'mpi' in spec:
print "YES"
- Similarly, this will be True:
Spec('mpich').satisfies('mpi')
- Because of the way virtual dependencies are currently implemented,
the above required some fiddling around with `package.py` so that it
would never call `Spec.__contains__` (and result in endless
recursion).
- This should be fixed by allowing virutal dependnecies to have their
own package class.
- This would allow a quicker check for vdeps, without a call to
`all_packages`.
- For the time being, `package.py` shouldn't call `__contains__`
Diffstat (limited to 'bin')
0 files changed, 0 insertions, 0 deletions