Opened 18 years ago
Closed 18 years ago
#32 closed upgrade (Fixed)
Control application cpp flags from make command line
Reported by: | m.hadfield | Owned by: | arango |
---|---|---|---|
Priority: | major | Milestone: | Release ROMS/TOMS 3.1 |
Component: | Nonlinear | Version: | 3.1 |
Keywords: | Cc: |
Description
Test cases CANYON and FLT_TEST have 2D and 3D variants. Currently the respective application header files start with
#undef SOLVE3D
and you have to override that somehow to get the 3D case. As far as I know, the only way to do that is to edit the file.
It would be nice to be able to choose between the 2D or 3D versions via the make command line. At the moment there are 2 obstacles:
- The #undef statement above will take precedence over any arguments passed to cpp. (At least I think so; I haven't checked.)
- If you just do
make ROMS_APPLICATION=CANYON CPPFLAGS=-DSOLVE3D
then you will override all the CPPFLAGS values constructed in the make file.
So I have made two changes:
- Remove "#undef SOLVE3D" statements from canyon.h and flt_test.h.
- In makefile add an additional variable that is passed to cpp. It is called CPP_APP_FLAGS (alternative suggestions welcome).
So to compile the 3D canyon
make ROMS_APPLICATION=CANYON CPP_APP_FLAGS=-DSOLVE3D
I imagine this will be useful in other contexts.
Files attached.
Attachments (3)
Change History (5)
by , 18 years ago
by , 18 years ago
by , 18 years ago
Attachment: | flt_test.h added |
---|
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Yes, good suggestion. I used macro MY_CPP_FLAGS instead and appended to CPPFLAGS instead of modifying the compile rules.
I mis-spoke: flt_test.h has "#define SOLVE3D".
Anyway, removing this line allows it to be controlled externally.