Consolidate build options USE_G2CLIB_HIGH and USE_G2CLIB_LOW into single option USE_G2CLIB#499
Merged
AlysonStahl-NOAA merged 18 commits intoNOAA-EMC:developfrom Feb 26, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Consolidates the two CMake build options USE_G2CLIB_HIGH and USE_G2CLIB_LOW into a single USE_G2CLIB option, aligning code, build logic, CI, Spack packaging, and user documentation with the simplified configuration.
Changes:
- Replaced
USE_G2CLIB_HIGH/USE_G2CLIB_LOWpreprocessor guards withUSE_G2CLIBacross the C sources and generated headers. - Updated CMake logic and GitHub Actions workflows to use
USE_G2CLIB. - Updated Spack variants/dependencies and the user guide build-options table to reflect the consolidated option.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| wgrib2/wgrib2_meta.h.in | Replaced old g2clib macros with USE_G2CLIB in generated metadata header. |
| wgrib2/wgrib2.c | Switched g2clib-related compilation guards to USE_G2CLIB. |
| wgrib2/unpk.c | Switched g2clib include guard to USE_G2CLIB. |
| wgrib2/jpeg_pk.c | Switched g2clib include guard to USE_G2CLIB. |
| wgrib2/init.c | Switched g2clib initialization guards to USE_G2CLIB. |
| wgrib2/config.h.in | Replaced old g2clib macros with USE_G2CLIB in generated config header. |
| wgrib2/aec_pk.c | Switched g2clib include guard to USE_G2CLIB. |
| wgrib2/Misc.c | Updated -g2clib option gating from HIGH to consolidated USE_G2CLIB. |
| wgrib2/Grib.c | Switched g2clib include guard to USE_G2CLIB. |
| wgrib2/GDT.c | Switched g2clib guard to USE_G2CLIB. |
| wgrib2/Config.c | Updated g2clib guards; removed -g2clib 2 availability line from -config output. |
| wgrib2/CMakeLists.txt | Simplified g2c link logic to key off USE_G2CLIB. |
| spack/package.py | Adjusted variant availability/dependencies to introduce +g2c for develop. |
| docs/user_guide.md | Consolidated documentation table rows into USE_G2CLIB. |
| CMakeLists.txt | Replaced two options with USE_G2CLIB; simplified g2c find_package logic. |
| .github/workflows/developer.yml | Updated CI configuration to pass -DUSE_G2CLIB=ON. |
| .github/workflows/MacOS.yml | Updated CI configuration to pass -DUSE_G2CLIB=ON. |
| .github/workflows/Linux_options.yml | Updated options matrix to use -DUSE_G2CLIB=ON. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Hang-Lei-NOAA
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #497