Conversation
WardF
commented
Nov 4, 2019
- fixes Failure building with mpicc in current master #1507
| #include "netcdf.h" | ||
| #include "nc_logging.h" | ||
| #ifdef USE_PARALLEL | ||
| #include "netcdf_par.h" |
There was a problem hiding this comment.
Might be better to have netcdf_par.h #include netcdf.h?
|
Why should netcdf_par.h be different than e.g. netcdf_mem.h? |
|
Either solution would work; in this case, I’m inclined to err on the side of verbosity. Trying to untangle what has been included, and from where, can be a headache. Or perhaps it’s just me :). I am attracted to the idea that you must include “netcdf.h” if you are working with the ‘default’ NetCDF API. |
|
Well if you must include netcdf.h when you use netcdf_par.h or netcdf_mem.h, then why not have those files do the work? The reason it's better is to prevent issues exactly like the one that occurred here. |
|
The rule as added to the include/netcdf_XXX.h files is this:
|
|
You are telling people to do something we can do. No one reads the documentation, as you know! ;-) |