NetCDF: fix constraints 2#16719
Conversation
|
Honestly, I wouldn't overthink this at the moment. Once the new concretizer is released (supposedly sometime this month??) then all of these hacks will be irrelevant and Spack should be smart enough to figure out the right way to do things. |
|
@adamjstewart Which of the modifications do you consider a hack? |
|
I consider the previous state to be mostly hacks. I think this PR is a step in the right direction, but I can't tell what the impacts of this will be on the current concretizer since we presumably added them for a reason. Ideally, we would just add |
|
@adamjstewart I don't know how the concretizer (the current one or the new one) would know whether we need You might also have questions regarding the deleted conflicts. On top of what I have written in #15950, I would like to remind that it was me who introduced them in #5819. And it was a mistake. spack/var/spack/repos/builtin/packages/netcdf-c/package.py Lines 113 to 118 in 7449bf8 It should have been replaced with depends_on('hdf5+mpi', when='+mpi') from the beginning because it was decided that hdf5+mpi is what we have by default.Second, the following is also redundant: spack/var/spack/repos/builtin/packages/netcdf-c/package.py Lines 105 to 110 in 7449bf8 It should have been simply replaced with depends_on('hdf5~mpi', when='@:4.3~mpi') because what I meant under "doesn't work" should read as "doesn't help". I didn't like the default error message of the concretizer and decided to replace it with a "better" one from the conflict statement. What I wanted to get help of the concretizer with was also rather strange: I had hdf5+mpi by default and netcdf~mpi in my packages.yaml and I wanted the concretizer to handle spack spec [email protected] but it could handle only spack spec [email protected]~mpi and this made me angry because I did have netcdf~mpi in packages.yaml. Probably affected by this anger, I messed things up. Moreover, I just checked that old version of Spack and added netcdf~mpi and hd5~mpi to packages.yaml and ran spack spec [email protected]+mpi. And it failed: "+mpi" conflicts with "netcdf^hdf5~mpi" [netcdf+mpi requires hdf5+mpi]. This is another confirmation that putting those conflicts was a bad idea and we need to remove them.
I am closing #15950 and opening this PR for merging. |
adf7fad to
053108d
Compare
|
Going through old PRs. I'm not sure what to do about this one. Does @WardF have any comments? If not, I'm inclined to merge this since @skosukhin is a maintainer and is willing to take all the blame if anything goes wrong and submit a follow-up PR to fix anything that breaks because of it 😛 |
This PR
is mainly for the discussion in #16671 andis an extension of #15950.The advantage of merging this is that we can install all valid configurations of
netcdf-c:It is possible to build
netcdf-cwithout parallel I/O even whenhdf5is built with+mpi:$ spack install netcdf-c~mpi ^hdf5+mpibut not for versions before
4.4.0as it should be:It is possible to build
netcdf-fortranwhennetcdf-cis built without NetCDF4 parallel features (i.e.~mpi) but with parallel features for NetCDF3 (i.e.+parallel-netcdf):$ spack install netcdf-fortran ^netcdf-c~mpi+parallel-netcdfThe main disadvantage of this is that in order to build
netcdf-cwithout MPI dependencies at all, one has to run:$ spack spec -I netcdf-fortran ^netcdf-c~mpi ^hdf5~mpi`But this can be handled in
packages.yaml:With this configuration, one can install
netcdf-fortranwithout MPI dependencies by calling:$ spack install netcdf-fortranand enable MPI by calling:
$ spack install netcdf-fortran ^netcdf-c+mpi