Skip to content

PR #1495's fix for the nvfortran build error didn't address CMake #1517

Description

@cenamiller

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)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions