wgrib2 is part of the external libraries. For the UFS v1.0.0 release, we had to build wgrib2 without NetCDF support. This is because the wgrib2 build creates its entire software stack based on certain versions of NetCDF (and dependencies in case of NetCDF4), which it also tries to download first (in case of NetCDF4).
There are a few issues related with this approach:
downloading doesn't work on all systems (firewalls ...)
the versions of HDF5 and NetCDF don't match what NCEPLIBS-external is using (ours are newer), and the build options aren't exactly the same either
because we need to build the wgrib2 library and link it into an executable that also links to our NetCDF, this can result in linker errors or bad behavior
What we need in order to build wgrib2 with NetCDF support and without the overhead/danger of building NetCDF twice is an option to tell the wgrib2 build to use existing dependencies if so provided by the user: jasper, zlib, hdf5, netcdf, ...
There are standard/common variables that are used to indicate where those installations can be found, for example:
ZLIB_ROOT
HDF5_ROOT
Jasper_ROOT
NETCDF
NETCDF_FORTRAN (if not installed in NETCDF)
All those ending in _ROOT are following the CMake rules, for NetCDF the community has come up with its own standard before CMake got there.
Users could, for example, indicate to the wgrib2 build system that they do not want to build package A and tell the build system where A can be found.
wgrib2 is part of the external libraries. For the UFS v1.0.0 release, we had to build wgrib2 without NetCDF support. This is because the wgrib2 build creates its entire software stack based on certain versions of NetCDF (and dependencies in case of NetCDF4), which it also tries to download first (in case of NetCDF4).
There are a few issues related with this approach:
What we need in order to build wgrib2 with NetCDF support and without the overhead/danger of building NetCDF twice is an option to tell the wgrib2 build to use existing dependencies if so provided by the user: jasper, zlib, hdf5, netcdf, ...
There are standard/common variables that are used to indicate where those installations can be found, for example:
ZLIB_ROOT HDF5_ROOT Jasper_ROOT NETCDF NETCDF_FORTRAN (if not installed in NETCDF)
All those ending in _ROOT are following the CMake rules, for NetCDF the community has come up with its own standard before CMake got there.
Users could, for example, indicate to the wgrib2 build system that they do not want to build package A and tell the build system where A can be found.