Skip to content

Commit

Permalink
Merge pull request #409 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
GitFlow: Merge develop into main for release
  • Loading branch information
mathomp4 authored Nov 5, 2024
2 parents a580fce + 612652b commit 1093788
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2.1

# Anchors in case we need to override the defaults from the orb
#baselibs_version: &baselibs_version v8.0.2
#bcs_version: &bcs_version v11.3.0
#baselibs_version: &baselibs_version v8.7.0
#bcs_version: &bcs_version v12.0.0

orbs:
ci: geos-esm/circleci-tools@5
Expand All @@ -21,7 +21,10 @@ workflows:
#baselibs_version: *baselibs_version
repo: GEOSgcm
checkout_fixture: true
mepodevelop: true
# V12 code uses a special branch for now.
fixture_branch: feature/sdrabenh/gcm_v12
# We comment out this as it will "undo" the fixture_branch
#mepodevelop: true
persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra

# Run AMIP GCM (1 hour, no ExtData)
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [4.8.0] - 2024-11-05

### Added

- Added new `esma_capture_mepo_status` function (in `esma_support/esma_mepo_status.cmake`) to capture the output of `mepo status --hashes` when `mepo` was used to clone the fixture. It will output this into a file `MEPO_STATUS.rc` which is installed to `${CMAKE_INSTALL_PREFIX}/etc` and can be used to help determine the exact state of the fixture at build time.

## [4.7.0] - 2024-10-10

### Changed
Expand Down
3 changes: 3 additions & 0 deletions esma.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ include(DetermineMPIStack)
#list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/esma_support")
include (esma_support)

#### Capture mepo status ####
esma_capture_mepo_status()

### Python ###

list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/python")
Expand Down
43 changes: 43 additions & 0 deletions esma_support/esma_mepo_status.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
function(esma_capture_mepo_status)

# Step 1: Set the path to the .mepo directory
set(MEPO_DIR "${CMAKE_SOURCE_DIR}/.mepo")
set(OUTPUT_FILE_NAME "MEPO_STATUS.rc")
set(OUTPUT_FILE "${CMAKE_BINARY_DIR}/${OUTPUT_FILE_NAME}")

if(EXISTS "${MEPO_DIR}")
message(DEBUG ".mepo directory found")

# Step 2: Check for the `mepo` command
find_program(MEPO_COMMAND mepo)

if(MEPO_COMMAND)
message(DEBUG "Found mepo command at ${MEPO_COMMAND}")

# Step 3: Run `mepo status --hashes` and capture the output
execute_process(
COMMAND ${MEPO_COMMAND} status --hashes
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_FILE "${OUTPUT_FILE}"
RESULT_VARIABLE MEPO_STATUS_RESULT
)

if(NOT MEPO_STATUS_RESULT EQUAL 0)
message(WARNING "mepo state and command were found but failed to run mepo status --hashes. This is odd.")
else()
message(STATUS "mepo status output captured in ${OUTPUT_FILE_NAME}")

# Step 4: Install the output file in the etc directory
install(
FILES "${OUTPUT_FILE}"
DESTINATION etc
)
endif()
else()
message(DEBUG "mepo command not found, skipping mepo status")
endif()
else()
message(DEBUG ".mepo directory not found, skipping mepo status check")
endif()

endfunction()
1 change: 1 addition & 0 deletions esma_support/esma_support.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ include (esma_generate_automatic_code)
include (esma_create_stub_component)
include (esma_fortran_generator_list)
include (esma_add_fortran_submodules)
include (esma_mepo_status)

# Testing
include (esma_enable_tests)

0 comments on commit 1093788

Please sign in to comment.