Skip to content

Added EXTERNL definition in netcdf_par.h#1508

Merged
WardF merged 5 commits intomasterfrom
gh1507.wif
Nov 5, 2019
Merged

Added EXTERNL definition in netcdf_par.h#1508
WardF merged 5 commits intomasterfrom
gh1507.wif

Conversation

@WardF
Copy link
Copy Markdown
Member

@WardF WardF commented Nov 4, 2019

@WardF WardF added this to the 4.7.3 milestone Nov 4, 2019
@WardF WardF self-assigned this Nov 4, 2019
@WardF WardF merged commit f0dc61a into master Nov 5, 2019
@WardF WardF deleted the gh1507.wif branch November 5, 2019 18:31
Comment thread include/nc_tests.h
#include "netcdf.h"
#include "nc_logging.h"
#ifdef USE_PARALLEL
#include "netcdf_par.h"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to have netcdf_par.h #include netcdf.h?

@DennisHeimbigner
Copy link
Copy Markdown
Collaborator

Why should netcdf_par.h be different than e.g. netcdf_mem.h?

@WardF
Copy link
Copy Markdown
Member Author

WardF commented Nov 6, 2019

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.

@edwardhartnett
Copy link
Copy Markdown
Contributor

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.

@DennisHeimbigner
Copy link
Copy Markdown
Collaborator

The rule as added to the include/netcdf_XXX.h files is this:
/*

  • In order to use any of the netcdf_XXX.h files, it is necessary
  • to include netcdf.h followed by any netcdf_XXX.h files.
  • Various things (like EXTERNL) are defined in netcdf.h
  • to make them available for use by the netcdf_XXX.h files.
    */

@edwardhartnett
Copy link
Copy Markdown
Contributor

You are telling people to do something we can do. No one reads the documentation, as you know! ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure building with mpicc in current master

4 participants