-
Notifications
You must be signed in to change notification settings - Fork 262
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
Prefix all options with NETCDF_ #2895
Conversation
It's for the reviewer, because on the |
This looks good; there's a change I'm considering, although I'd be happy to make it (simple string replace, it's no problem). We typically abbreviate netCDF as 'NC'. I'm not sure if replacing |
BTW, remember that many of the current option names are used in the C code as well via config.h. |
IMO, only 2 letters is a bit risky w.r.t. namespace collision. I would say, that within this PR or release preparation, it is good to clean up the options, e.g.
That is trivial. The usual design is to have a |
When you make changes to the CMAKE options, please look at the same option |
This will break hundreds of workflows around the world. Is there a really good reason to do that? NetCDF options are complex, compared to most other science libraries. Most institutions do not have a great handle on the netCDF build system - they figured out the options that worked, and they coded them into shell scripts, etc. Now all the options will change name? Everyone will have to drop what they want to do, and once again spend time figuring out the netCDF build. What is the benefit that will accrue from all that work? For example, has anyone communicated with the spack maintainers about this? |
@K20shores, btw, there are also the
Good point. I see that all Lines 137 to 145 in 7babdcb
if (DEFINED $CACHE{ENABLE_NETCDF4})
message(WARNING ...) (the usage of
Yes, because it limits the potential of the project to be used by others via Another issue is many of the options were unnecessary in the first place, and going through them here will make it easier to comunicate what the options should be designed as independent of the autotools nomenclature and constraints. E.g. most of the
The proper way to address this is to provide presets that will handle most cases, e.g. the sets of plugin options. Than the user would just call something like $ cmake --preset default-with-plugin -DNETCDF_ENABLE_NCZARR_FILTERS=OFF --install-prefix=... Also note that it is possible to maintain compatibility as shown in the |
That's an understandable concern. But, as a leading scientific package, netcdf should confirm to good best practices, and providing build options that don't conflict with downstream packages seems to be a good goal. Further, this makes it safer to include netcdf with cmake's fetch content functionality, meaning that there is yet another way to include netcdf in a package. As far as breaking builds, that seems to be unavoidable pain. But it isn't that complicated to fix. Cmake will warn of unused options (which would be all of them). Any sort of A further mitigation step could be to include this PR only after the 4.9.3 release and then release 4.10.0 with the only change being what's included in this PR. Those release notes would make it clear that build options are changing for any future version of netcdf. As for spack, if these changes are deemed acceptable, I could make a draft PR into spack that would accommodate these changes and publish it when a release of netcdf with these changes goes out. Of course, the option to abandon this PR is on the table. The technical answer is that it's not necessary, but it is nice to have these changes, from my perspective. However, the downstream changes would definitely be annoying |
Also, speaking as a Fedora packager, I am looking forward to these changes |
For what it's worth, I've got a work-around that will let us deprecate existing options without otherwise breaking the build. I'll push the fix to this branch. I have no doubt that it will be a blunt hammer approach, but that's why these contributions from experts are so vital and appreciated :). I'll push something today or tomorrow, I need to construct the list of deprecated options and do some testing, but so far it appears to be working for the handful of options I've tested. Ignore the various 'message' lines that I've been using for debugging as I step through, but this gives a rough idea of the approach I'm taking. This is a new file,
|
Good fix. We still need to deal with the config.h problem. |
Taking a quick look, it appears that this has already been addressed. Re: parity between Allowing netCDF to be included trivially in other projects is a fantastic strength that will provide a lot of direct and indirect benefits. It also makes dropping autotools a realistic option, down the line. Well, more realistic at any rate. It won't happen anytime soon, however. I'll push my changes into this branch tomorrow at the latest, I need to run down the list of options that were changed, clean up debugging messages, etc. etc. |
… up the logic, remove some rough edges.
Thank you for the comments @LecrisUT; you have referenced a fair bit of cmake functionality I am unfamiliar with, and I will take a look in the morning. We need to get |
THis PR has a big error in it. |
Also, the reversion needs to occur in config.h.in and config.h.cmake.in |
Also in all the Makefile.am files. |
Also lib_flags.am |
I really wish you had not this. It was unnecessary. |
Essentially I found all options that cmake defines:
grep -r "option(" . | sed -n -e 's/.*option(\([^ ]*\).*/\1/p'
> variables.txtAlso replaced
NC_USE_STATIC_CRT
->NETCDF_USE_STATIC_CRT
NC_FIND_SHARED_LIBS
->NETCDF_FIND_SHARED_LIBS
Then removed some that shouldn't be modified, or needed to be modified different from others.
Then ran this script
In general it worked, but I had to go through each commit by hand to remove the script file from git.