Ok,
so If I understand well, I have to express all combinations in package A.
what about several options?
In A:
depends_on('B+mpi', when='+mpi')
depends_on('B+cuda', when='+cuda')
depends_on('B+opencl', when='+opencl')
depends_on('B+mpi+cuda', when='+mpi+cuda')
depends_on('B+cuda+opencl', when='+cuda+opencl')
depends_on('B+mpi+opencl', when='+mpi+opencl')
depends_on('B+mpi+cuda+opencl', when='+mpi+cuda+opencl')
Number of combinations grows fast!
What about an expression at the level of B instead, like activation of MPI in B if activated at the upper level in A?
Thanks,
FlorentLe 16/06/2015 09:30, Gamblin, Todd a écrit :In A:
depends_on('B+mpi', when='+mpi')
depends_on('B~mpi', when='~mpi')
Should work.
Sent with Good (www.good.com)
--
You received this message because you are subscribed to the Google Groups "Spack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spack+un...@googlegroups.com.
To post to this group, send email to sp...@googlegroups.com.
Visit this group at http://groups.google.com/group/spack.
For more options, visit https://groups.google.com/d/optout.
I'm not sure that "to have some default concretization rules for
Spack that cause particular variants to be matched among packages
in a DAG." is a good idea.
It may represent a lot of effort for you to guess what are the
best default behaviors and not sure they will be widely used...
Lost of time?
Let's the packager expresses the behaviors he wants for its stack
(what should be propagated to direct deps. and what to all the
stack). If the features exist it is already a very good point :)
Hi Todd,
Your suggestions are very interesting.
I think both features:Sometimes we need to propagate the variant for all the stack and sometimes not.
- depends_on('B', match_variants=['mpi', 'cuda', 'opencl']) for a specific propagation of level 1 and not for all dependencies, and
- match_dependency_variants('mpi', 'cuda', 'opencl') for a propagation to all dependencies would be useful.
I'm not sure that "to have some default concretization rules for Spack that cause particular variants to be matched among packages in a DAG." is a good idea.It may represent a lot of effort for you to guess what are the best default behaviors and not sure they will be widely used... Lost of time?
Let's the packager expresses the behaviors he wants for its stack (what should be propagated to direct deps. and what to all the stack). If the features exist it is already a very good point :)
The conflict feature would be nice also yes. It may be useful to have the feature for any number of conflicting dependencies?
mutually_exclusive('dep1', 'dep2', 'dep3')
means just one of the list can be enabled.
Let me see if I can understand this. We have two packages, A and B. A depends on B. Both packages have useful mpi and non-mpi variants. Does package A's mpi-ability depend on package B also having its mpi-abilities enabled? It might, it might not. In other words, A+mpi might depend on B or it might depend on B+mpi or it might not matter in that either B or B+mpi will do. If A+mpi depends on B+mpi, then I think 'spack install A+mpi' should install B+mpi too. In other words, the variant gets propagated even though the default for B is to NOT build with mpi. If it depends on B or it doesn't matter, then there is no need for spack to propagate the variant and building B its default way is fine.
Is there a way of differentiating dependencies for A+mpi from those for A alone? Maybe A alone has no dependence on B. But A+mpi depends on B/B+mpi.
Maybe what we need is a way of saying, when creating this variant, these are the dependences and when creating that variant, these are the dependencies like this…for variant(+mpi):depends_on(B+mpi)depends_on( C)for variant():depends_on(D)
I have a similar situation. I've worked on the hdf5 package and added a +fortran variant. Its on by default. I installed hdf5~fortran on my OS X system because I didn't have fortran compilers handy. The netcdf package depends_on('hdf5'). When I went to install netcdf, 'hdf5~fortran' didn't satisfy netcdf's depends_on('hdf5'). So, spack went to install the default HDF5 which requires fortran compilers and it failed.
It smells to me like Spack is being frustratingly strict about its dependencies.
If I say package A depends on package B and I don't specify any variants of B, then I think that ought to mean that *any* available variants of B that can be found to satisfy the depends_on should be fine. And, when there is a choice, spack should choose the variant that will lead to the fewest number of additional dependencies.
So, in my case, suppose there was an HDF5 with zlib and another without zlib. I didn't explicitly request zlib in my spack command. The netcdf package.py doesn't either. So, spack should be allowed to choose which. I think it should pick the HDF5 without zlib to resolve any depends_on('hdf5'). But, maybe thats some kind of a global preference one can set in the way spack should operate in any given installation.Doesn't this same problem happen with virtual dependencies. Consider blas. If I have a package that depends_on('blas') and there are multiple implementations of blas avilable, how will spack resolve that? Does there need to be an explicit request for a specific implementation of blas?
Can there be a preferred implementation if none is specified?
Hope I am not adding to confusion.On Tuesday, June 16, 2015 at 12:22:05 AM UTC-7, Florent Pruvost wrote:Hi,I have a question relative to variants than could be propagated.Let's say I have a package A depending on B and both have an MPI variant, OFF by default.If I activate the MPI variant at the level of package A, e.g$ spack install A+mpiSpack will install A with MPI but B without because the MPI variant is OFF by default and because I have not added +mpi to B explicitly like this$ spack install A+mpi ^B+mpiIt could be nice to have a way to propagate the MPI activation to B automatically (expressing this possibility in package B)Can we imagine a system of propagated variants or is it already possible?Thanks!Florent