Skip to content

Update wgrib2 from JCSDA/NOAA-EMC fork#32857

Merged
tldahlgren merged 10 commits intospack:developfrom
climbfuji:feature/update_wgrib2_from_jcsda_emc
Oct 25, 2022
Merged

Update wgrib2 from JCSDA/NOAA-EMC fork#32857
tldahlgren merged 10 commits intospack:developfrom
climbfuji:feature/update_wgrib2_from_jcsda_emc

Conversation

@climbfuji
Copy link
Copy Markdown
Contributor

Addresses #32856 by updating wgrib2 from NOAA-EMC spack fork.

This major update fixes problems with wgrib2's internal use of several libraries such as netcdf etc. NOAA-EMC uses this version for the UFS applications and tools.

Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

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

Confirmed sha256. Have a minor question.

Comment on lines +24 to +27
variant("netcdf3", default=True,
description="Link in netcdf3 library to write netcdf3 files")
variant("netcdf4", default=False,
description="Link in netcdf4 library to write netcdf3/4 files")
Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren Sep 27, 2022

Choose a reason for hiding this comment

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

Can you build with both netcdf3 and netcdf4? If not, perhaps a multi-valued variant like ipolates is order here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think you can. I think you are suggesting something like this:

    variant("netcdf", default="3",
            description="Version of netCDF library to use",
            values=("3", "4"))

To me this would be confusing because to the inexperienced it reads like you can either use netcdf version 3 or version 4 files, the information that netcdf4 can read and write both 3 (classic) and 4 (all others) is lost?

Copy link
Copy Markdown
Contributor

@t-brown t-brown Sep 28, 2022

Choose a reason for hiding this comment

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

Do users actually still use netCDF3? You could change the description to something along the lines of:

description="Version of netCDF library to use. Note, version 4 also supports version 3 (classic)."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another option, if you want to leave both variants in and want to allow only one at a time, is to add a conflict() if both are enabled.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, I like that!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added the conflict. But it turns out that the +netcdf4 build is not working, because one needs to manually (or encoded in the package.py file) download the netcdf4 source code during the install. I'll demote the PR to draft mode and return it to "ready for review" once I got the time to fix this.

@tldahlgren tldahlgren self-assigned this Sep 27, 2022
…ack/repos/builtin/packages/wgrib2/package.py
@climbfuji
Copy link
Copy Markdown
Contributor Author

Style errors are now fixed.

…nt, add conflict for variants netcdf3, netcdf4
@climbfuji climbfuji marked this pull request as draft September 29, 2022 16:55
tldahlgren
tldahlgren previously approved these changes Sep 29, 2022
Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

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

Re-confirmed sha256. Will not merge since in Draft mode, etc.

@climbfuji
Copy link
Copy Markdown
Contributor Author

@tldahlgren @t-brown I fixed the failing wgrib2 build with the netcdf4 variant. I had to add line 88 and lines 163-167. You will see that wgrib2 uses its own, internal hdf5 and netcdf dependencies and doesn't link against external/spack versions. There is nothing I can do about this, it would be up to the developers at NOAA-EMC to change this. I installed both wgrib2 +netcdf3 and wgrib2 +netcdf4 on my macOS with apple-clang with the code in this PR.

@climbfuji climbfuji marked this pull request as ready for review October 5, 2022 13:50
tldahlgren
tldahlgren previously approved these changes Oct 5, 2022
Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

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

(Re) confirmed sha256 in changes.

@tldahlgren
Copy link
Copy Markdown
Contributor

@t-brown @edwardhartnett Are you fine with being removed as maintainers from this package?

@t-brown
Copy link
Copy Markdown
Contributor

t-brown commented Oct 6, 2022

@t-brown @edwardhartnett Are you fine with being removed as maintainers from this package?

I'm OK.

if self.spec.satisfies("+netcdf4"):
with working_dir(self.build_directory):
os.system(
"wget https://downloads.unidata.ucar.edu/netcdf-c/4.8.1/netcdf-c-4.8.1.tar.gz"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Really don't like this and line 170. Is there no way we can use the Spack versions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same here, but that is really not something I should be doing. That's up to the package creators at EMC.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As an alternative, we could completely disable the +netcdf4 variant in spack until they fix wgrib2.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@t-brown Can we get a motion on this PR? I am only the messenger trying to update the package in the authoritative spack repo (and fixing bugs along the way). As @edwardhartnett said, people are encouraged to move away from wgrib2 since its author has refused to cooperate on improving the package.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I thought you were removing me as a maintainer. If so, I should not be holding you up at all.

@edwardhartnett
Copy link
Copy Markdown
Contributor

@t-brown please leave me as a maintainer so I can see changes.

Although NOAA EMC is discouraging further use of wgrib2, due to it's difficult home-rolled build system which conflicts with modern practices, we still depend on this utility. I would like to get notification of changes.

@t-brown
Copy link
Copy Markdown
Contributor

t-brown commented Oct 25, 2022

@t-brown please leave me as a maintainer so I can see changes.

@edwardhartnett you should requesting @climbfuji keep you, rather than I.

Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

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

Re-confirmed new sha256.

@tldahlgren tldahlgren merged commit 10aa6bd into spack:develop Oct 25, 2022
@climbfuji
Copy link
Copy Markdown
Contributor Author

@t-brown please leave me as a maintainer so I can see changes.

@edwardhartnett you should requesting @climbfuji keep you, rather than I.

Funny thing is, nobody got removed or added in this PR ;-) but thanks everyone for getting this merged.

@climbfuji climbfuji deleted the feature/update_wgrib2_from_jcsda_emc branch October 25, 2022 19:58
@tldahlgren
Copy link
Copy Markdown
Contributor

@t-brown please leave me as a maintainer so I can see changes.

@edwardhartnett you should requesting @climbfuji keep you, rather than I.

Funny thing is, nobody got removed or added in this PR ;-) but thanks everyone for getting this merged.

My apologies. I had the PR up for a while so didn't see the comments. Do you want to revert or submit a new PR for the changes?

@climbfuji
Copy link
Copy Markdown
Contributor Author

@t-brown please leave me as a maintainer so I can see changes.

@edwardhartnett you should requesting @climbfuji keep you, rather than I.

Funny thing is, nobody got removed or added in this PR ;-) but thanks everyone for getting this merged.

My apologies. I had the PR up for a while so didn't see the comments. Do you want to revert or submit a new PR for the changes?

No worries, I think that we are actually all good and that the whole conversation about whether or not to remove anyone was a misunderstanding.

becker33 pushed a commit to RikkiButler20/spack that referenced this pull request Nov 2, 2022
* Update wgrib2 from JCSDA/NOAA-EMC fork
* var/spack/repos/builtin/packages/wgrib2/package.py: fix typo in comment, add conflict for variants netcdf3, netcdf4
* wget hdf5/netcdf4 internal dependencies for wgrib2
* Black-format var/spack/repos/builtin/packages/wgrib2/package.py
* More format changes in var/spack/repos/builtin/packages/wgrib2/package.py
charmoniumQ pushed a commit to charmoniumQ/spack that referenced this pull request Nov 19, 2022
* Update wgrib2 from JCSDA/NOAA-EMC fork
* var/spack/repos/builtin/packages/wgrib2/package.py: fix typo in comment, add conflict for variants netcdf3, netcdf4
* wget hdf5/netcdf4 internal dependencies for wgrib2
* Black-format var/spack/repos/builtin/packages/wgrib2/package.py
* More format changes in var/spack/repos/builtin/packages/wgrib2/package.py
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