Skip to content

NetCDF: fix constraints#15950

Closed
skosukhin wants to merge 1 commit intospack:developfrom
skosukhin:netcdf_fix
Closed

NetCDF: fix constraints#15950
skosukhin wants to merge 1 commit intospack:developfrom
skosukhin:netcdf_fix

Conversation

@skosukhin
Copy link
Copy Markdown
Member

This PR fixes spack spec [email protected]. Plus I have updated my old comments.

@adamjstewart
Copy link
Copy Markdown
Member

Are you sure you want to make these changes? I believe the bug in the concretizer that necessitated these changes is still present...

# http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html
depends_on('[email protected]:+hl~mpi', when='~mpi')
depends_on('[email protected]:+hl+mpi', when='+mpi')
depends_on('[email protected]:+hl')
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We should mention a non-default value for the variant of hdf5 separately. Otherwise, we will need to mention it in all other constraints that we have.

Comment on lines -106 to -107
conflicts('~mpi', when='@:4.3^hdf5+mpi',
msg='netcdf-c@:4.3~mpi requires hdf5~mpi')
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We do not really need this conflict anymore because we put a more strict constraint below as depends_on.

# However, it is very unlikely that someone needs such combination.
# Therefore, we put the constraint for all versions to be able to avoid the
# dependency on MPI by simply running: spack install netcdf-c~mpi.
depends_on('hdf5~mpi', when='~mpi')
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As I mentioned before, we need to split the constraints into several depends_on statements. So, the result is the same as before when='~mpi'.

Comment on lines -114 to +108
conflicts('+mpi', when='^hdf5~mpi',
msg='netcdf-c+mpi requires hdf5+mpi')
depends_on('hdf5+mpi', when='+mpi')
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is what is left from the splitting of the constraints for the case when='+mpi'. Again, we don't' need the conflict anymore because it is basically impossible to have netcdf-c+mpi ^hdf5~mpi due to the depends_on statements.

@skosukhin
Copy link
Copy Markdown
Member Author

@adamjstewart I am pretty sure because it's the same as before but without redundant conflicts and the problem with spack spec [email protected]. Initially, I was going to revert #10788, which ignored my comments in the code made it easier to install netcdf-c without the dependency on mpi by simply spack install netcdf-c~mpi but

  • broke spack spec [email protected];
  • made it impossible to install netcdf-c~mpi ^hdf5+mpi, which, starting version 4.4.0, is a valid combination.

But then I thought that the second problem might be not so serious given the usability improvement that we get, so I just fixed the first one in this PR.

@adamjstewart adamjstewart mentioned this pull request Apr 13, 2020
@skosukhin
Copy link
Copy Markdown
Member Author

This also makes #11893 and similar workarounds redundant.

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.

2 participants