Skip to content

Fix CMake path semantics and error handling in ocean.cmake#8354

Open
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-cmake-semantics-ocean-marbl
Open

Fix CMake path semantics and error handling in ocean.cmake#8354
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-cmake-semantics-ocean-marbl

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 3, 2026

Several CMake issues in components/mpas-ocean/src/ocean.cmake were causing unreliable submodule existence checks and silent no-op error messages.

Changes

  • MARBL submodule check: Prefixed bare relative path with ${CMAKE_CURRENT_SOURCE_DIR} so the NOT EXISTS check resolves against the source tree rather than the working directory. Changed message(FATAL ...) to message(FATAL_ERROR ...)FATAL is not a valid CMake message mode and was a silent no-op.
  • GOTM submodule check: Applied the same fixes — added ${CMAKE_CURRENT_SOURCE_DIR}/ prefix to the NOT EXISTS path and changed message(FATAL ...) to message(FATAL_ERROR ...).
  • GOTM include path (line 6): Changed bare relative path core_ocean/gotm/include to ${CMAKE_CURRENT_SOURCE_DIR}/core_ocean/gotm/include so the compiler include path is absolute and reliable.

All fixes are consistent with the pattern already used by the CVMix, BGC, and PPR submodule checks in the same file.

Copilot AI linked an issue May 3, 2026 that may be closed by this pull request
@xylar xylar added MPAS-ocean Concerning the MPAS-ocean model coupled to E3SM. bug fix PR labels May 3, 2026
Copilot AI changed the title [WIP] Fix wrong cmake semantics for ocean MARBL Fix CMake path semantics for MARBL submodule existence check May 3, 2026
Copilot finished work on behalf of xylar May 3, 2026 11:59
Copilot AI requested a review from xylar May 3, 2026 11:59
@xylar xylar marked this pull request as ready for review May 3, 2026 12:06
@xylar xylar requested a review from mahf708 May 3, 2026 12:07
@xylar xylar assigned jonbob and unassigned xylar and Copilot May 3, 2026
@xylar
Copy link
Copy Markdown
Contributor

xylar commented May 3, 2026

@jonbob, I did a little hunting around https://github.com/E3SM-Project/E3SM/blob/c24b628c1d50718429284e76af32bc7ef20b9f59/cime_config/tests.py and didn't see a test for OECO to use to test MARBL. Any recommendations? I'm also happy to review by inspection if you think that's sufficient.

I'm also not aware of GOTM being used in E3SM at all so I guess there won't be any tests for that.

Copy link
Copy Markdown
Contributor

@mahf708 mahf708 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot a few more potential issues in this file worth fixing while at it --- please review the entire file.

  • Line 6 uses a bare relative path; is that correct?
  • Like MARBL, GOTM blocks near line 203 need fixing; let's fix as well?
  • FATAL isn't valid cmake, do we want FATAL_ERROR here?

…AL, gotm include path

Agent-Logs-Url: https://github.com/E3SM-Project/E3SM/sessions/5e3f90f5-3137-4c10-9ccf-ee1efd2096f8

Co-authored-by: mahf708 <122953255+mahf708@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 3, 2026

@copilot a few more potential issues in this file worth fixing while at it --- please review the entire file.

  • Line 6 uses a bare relative path; is that correct?...

Fixed all three issues in e03f109:

  • Line 6: core_ocean/gotm/include${CMAKE_CURRENT_SOURCE_DIR}/core_ocean/gotm/include
  • MARBL and GOTM NOT EXISTS checks: added ${CMAKE_CURRENT_SOURCE_DIR}/ prefix to both
  • Both message(FATAL ...) calls changed to message(FATAL_ERROR ...)

Copilot AI changed the title Fix CMake path semantics for MARBL submodule existence check Fix CMake path semantics and error handling in ocean.cmake May 3, 2026
Copilot finished work on behalf of mahf708 May 3, 2026 15:18
Copilot AI requested a review from mahf708 May 3, 2026 15:18
@xylar
Copy link
Copy Markdown
Contributor

xylar commented May 3, 2026

@mahf708, great, thanks for pointing out the other issues.

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

Labels

bug fix PR CMake build system MPAS-ocean Concerning the MPAS-ocean model coupled to E3SM.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wrong cmake semantics for ocean MARBL stuff

5 participants