-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake build should check package versions and capabilities #2413
Comments
Most of the libraries that are currently required by ufs-weather-model (this repo, not the subcomponents) are versioned:
Only MPI, OpenMP and IFI are not. If the versions listed here are not the minimum required versions, they should be updated. I am not sure if we really need 4.9.2 version of netcdf or 4.7.4 is sufficient. MAPL is required by GOCART (https://github.com/GEOS-ESM/GOCART/blob/041422934cae1570f2f0e67239d5d89f11c6e1b7/CMakeLists.txt#L70), so please open an issue there. Regarding the zstd, that's an optional feature and model should be able to use netcdf library without zstd. If we want to check whether a particular netcdf installation has support for zstd, then that in formation should be provided by FindNetCDF module, for example: diff --git a/Modules/FindNetCDF.cmake b/Modules/FindNetCDF.cmake
index f6a9098..f05ba3c 100644
--- a/Modules/FindNetCDF.cmake
+++ b/Modules/FindNetCDF.cmake
@@ -199,6 +199,15 @@ if(NetCDF_PARALLEL)
find_package(MPI)
endif()
+## Detect zstd filter
+netcdf_config(${NetCDF_C_CONFIG_EXECUTABLE} --has-zstd _val)
+if( _val MATCHES "^(yes)$" )
+ set(NetCDF_ZSTD TRUE CACHE STRING "NetCDF has zstd IO capability." FORCE)
+else()
+ set(NetCDF_ZSTD FALSE CACHE STRING "NetCDF has no zstd IO capability." FORCE)
+endif()
+
+
## Find libraries for each component
set( NetCDF_LIBRARIES )
foreach( _comp IN LISTS _search_components ) We can then check NetCDF_ZSTD variable. Similar for other filters. Please open CMakeModules issue. |
Zstd is not supported in netCDF until 4.9.2. If you want to continue to use 4.7.4 should should add logic to handle the case when the user is using 4.7.4 and asks for zstd. We have a ticket open to upgrade ESMF to 8.6.1, but the CMake says 8.3.0. |
I do not know exactly what minimum version of esmf is currently required by the model, is it 8.6., or maybe 8.5.. We should then update the minimum required version. |
@edwardhartnett Using "zstd" is a run time choice. The model will throw out an error message and stop the run. Please see: https://github.com/NOAA-EMC/fv3atm/blob/develop/io/module_write_netcdf.F90#L145 Also the model supports a large community, so the minimum required version is listed in the cmake file. E.g. model will compile and run with netcdf 4.7.4 without options of data compression and parallelization turned on when writing out netcdf files. |
I tried to run uncoupled (atm only) model using netcdf 4.7.4 and it works, I just had to and logic around netcdf calls that set compression options. I'll add that in one of my future PRs. |
Description
Recently ufs-weather-model was built on WCOSS2 with a version of netCDF which did not support zstd. This should be checked by the build. Also the CMakeLists.txt requires netcdf-c-4.7.4, but shouldn't that be 4.9.2? Is there a check for the MAPL library? We need to confirm that version is 2.46.3.
All required versions need to be kept up to date, so if MAPL 2.46.4 is one day required, the CMake build must be changed to reflect that.
To Reproduce:
Inspection
Additional context
Everything that can be checked about dependencies should be checked in the cmake build. THis prevents install errors and saves time debugging.
Output
N/A
The text was updated successfully, but these errors were encountered: