The CMake build (-DMPAS_CORE=atmosphere -DMPAS_COMPILER=nvhpc, added in #1286) fails with the same NVFORTRAN-S-0290-Unexpected continuation line error in setup_packages.inc that #1495 fixed for the Makefile build. Looks like the CMake build never defines CPRPGI, so the #ifdef CPRPGI guard gen_pkg_debug_info (in src/tools/registry/gen_inc.c) that fixed the make build doesn't work here.
The Makefile's nvhpc: target explicitly adds -DCPRPGI to CPPFLAGS when building the registry-generator tool:
"CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DCPRPGI" )
Neither the top-level CMakeLists.txt nor src/tools/registry/CMakeLists.txt sets CPRPGI and nvfortran fails compiling setup_packages.inc
Here is an example of the failure: https://github.com/NCAR/MPAS-Model-CI/actions/runs/35262905040/job/105342840422
mkdir build && cd build
cmake .. -DMPAS_CORE=atmosphere -DMPAS_COMPILER=nvhpc -DMPAS_PRECISION=double
cmake --build .
Fails at ~98% with:
NVFORTRAN-S-0290-Unexpected continuation line (.../build/src/core_atmosphere/setup_packages.inc: 107)
0 inform, 0 warnings, 1 severes, 0 fatal for atm_setup_sfclayer_package
Proposed fix:
Similarly to what was done in the Makefile, define CPRPGI when compiling the registry tool for the nvhpc compiler branch in CMake. In CMakeLists.txt's MPAS_COMPILER STREQUAL nvhpc branch, something like:
target_compile_definitions(<registry-tool-target> PRIVATE CPRPGI)
The CMake build (
-DMPAS_CORE=atmosphere -DMPAS_COMPILER=nvhpc, added in #1286) fails with the sameNVFORTRAN-S-0290-Unexpected continuation lineerror insetup_packages.incthat #1495 fixed for the Makefile build. Looks like the CMake build never definesCPRPGI, so the#ifdef CPRPGIguardgen_pkg_debug_info(insrc/tools/registry/gen_inc.c) that fixed the make build doesn't work here.The Makefile's
nvhpc:target explicitly adds-DCPRPGItoCPPFLAGSwhen building the registry-generator tool:Neither the top-level
CMakeLists.txtnorsrc/tools/registry/CMakeLists.txtsetsCPRPGIandnvfortranfails compilingsetup_packages.incHere is an example of the failure: https://github.com/NCAR/MPAS-Model-CI/actions/runs/35262905040/job/105342840422
Fails at ~98% with:
Proposed fix:
Similarly to what was done in the Makefile, define
CPRPGIwhen compiling the registry tool for thenvhpccompiler branch in CMake. InCMakeLists.txt'sMPAS_COMPILER STREQUAL nvhpcbranch, something like: