Closed edwardhartnett closed 3 months ago
A related issue is that we are defining 4 pre-processor symbols on both the compiler command line and in the config file. (The compiler command line is of course put together by cmake). We need to pick one or the other...
/home/ed/wgrib2/wgrib2/config.h:2: warning: "USE_REGEX" redefined
2 | #define USE_REGEX
|
<command-line>: note: this is the location of the previous definition
In file included from /home/ed/wgrib2/wgrib2/wgrib2.h:13,
from /home/ed/wgrib2/wgrib2/AAIG.c:6:
/home/ed/wgrib2/wgrib2/config.h:9: warning: "USE_IPOLATES" redefined
9 | #define USE_IPOLATES 3
|
<command-line>: note: this is the location of the previous definition
In file included from /home/ed/wgrib2/wgrib2/wgrib2.h:13,
from /home/ed/wgrib2/wgrib2/AAIG.c:6:
/home/ed/wgrib2/wgrib2/config.h:16: warning: "USE_JASPER" redefined
16 | #define USE_JASPER
|
<command-line>: note: this is the location of the previous definition
In file included from /home/ed/wgrib2/wgrib2/wgrib2.h:13,
from /home/ed/wgrib2/wgrib2/AAIG.c:6:
/home/ed/wgrib2/wgrib2/config.h:24: warning: "USE_PNG" redefined
24 | #define USE_PNG
|
<command-line>: note: this is the location of the previous definition
In C code we always use a config.h file. In fortran code we generally use the compile command line, because historically fortran did not have an include or officially support pre-processor symbols.
Also see fnlist.
We need to generate these in cmake.
This can be bumped to the next release if we have a working solution...
See #95
I note there is a config.h file, with contents like this:
How are these set?
In almost all other C builds I'm aware of, the config.h file is generated at build time by CMake. That allows us to set things that might be build options. For example if the user selects to build without PNG we can set that in the CMake step.
I suspect that's what we should be doing here as well...