In 8.2.0 on macos (Ventura, intel-based, gfortran/gcc-11), the parse tool is failing to correctly generate two files:
core_variables.inc (no definitions of executableName, git_version, and build_target)
domain_variables.inc (empty)
It appears to be an issue with the order of items in CPPFLAGS, where parse stops looking for the defined macros (MPAS_NAMELIST_SUFFIX, DMPAS_EXE_NAME, etc.) as soon as it encounters a define without an '='. For example, I can run the following manually, and then those .inc files are correct:
MPAS-Model/src/tools/registry/parse ../Registry_processed.xml -DMPAS_NAMELIST_SUFFIX=init_atmosphere -DMPAS_EXE_NAME=init_atmosphere_model -DMPAS_GIT_VERSION=v8.1.0-148-g82681e986-dirty -DMPAS_BUILD_TARGET=gfortran
but the following does not work (added -D_MPI):
MPAS-Model/src/tools/registry/parse ../Registry_processed.xml -D_MPI -DMPAS_NAMELIST_SUFFIX=init_atmosphere -DMPAS_EXE_NAME=init_atmosphere_model -DMPAS_GIT_VERSION=v8.1.0-148-g82681e986-dirty -DMPAS_BUILD_TARGET=gfortran
I don't know if this is somehow just a Mac issue or not, as I haven't tested on a linux system yet. A work-around is to change the particular lines that add these options to CPPFLAGS to prepend instead of append. For example,
override CPPFLAGS += -DMPAS_EXE_NAME=$(EXE_NAME)
becomes
override CPPFLAGS := -DMPAS_EXE_NAME=$(EXE_NAME) $(CPPFLAGS)
(Apparently the ":=" is needed instead of just "=" to avoid recursion. I'm not much of makefile programmer...)
- Ted Mansell
core_variables.inc (no definitions of executableName, git_version, and build_target)
domain_variables.inc (empty)
It appears to be an issue with the order of items in CPPFLAGS, where parse stops looking for the defined macros (MPAS_NAMELIST_SUFFIX, DMPAS_EXE_NAME, etc.) as soon as it encounters a define without an '='. For example, I can run the following manually, and then those .inc files are correct:
MPAS-Model/src/tools/registry/parse ../Registry_processed.xml -DMPAS_NAMELIST_SUFFIX=init_atmosphere -DMPAS_EXE_NAME=init_atmosphere_model -DMPAS_GIT_VERSION=v8.1.0-148-g82681e986-dirty -DMPAS_BUILD_TARGET=gfortran
but the following does not work (added -D_MPI):
MPAS-Model/src/tools/registry/parse ../Registry_processed.xml -D_MPI -DMPAS_NAMELIST_SUFFIX=init_atmosphere -DMPAS_EXE_NAME=init_atmosphere_model -DMPAS_GIT_VERSION=v8.1.0-148-g82681e986-dirty -DMPAS_BUILD_TARGET=gfortran
I don't know if this is somehow just a Mac issue or not, as I haven't tested on a linux system yet. A work-around is to change the particular lines that add these options to CPPFLAGS to prepend instead of append. For example,
override CPPFLAGS += -DMPAS_EXE_NAME=$(EXE_NAME)
becomes
override CPPFLAGS := -DMPAS_EXE_NAME=$(EXE_NAME) $(CPPFLAGS)
(Apparently the ":=" is needed instead of just "=" to avoid recursion. I'm not much of makefile programmer...)
- Ted Mansell