Skip to content

Add CMake support to shumlib#26

Open
t00sa wants to merge 2 commits intoMetOffice:mainfrom
t00sa:cmake-2026-03-1
Open

Add CMake support to shumlib#26
t00sa wants to merge 2 commits intoMetOffice:mainfrom
t00sa:cmake-2026-03-1

Conversation

@t00sa
Copy link
Collaborator

@t00sa t00sa commented Mar 19, 2026

PR Summary

Science Reviewer: @james-bruten-mo
Code Reviewer: @cameronbateman-mo

Update the build system to use CMake. Enable support for running regression tests directly from the build files.

I think this would benefit from two sets of eyes, so I've added James as SR. I'll set aside some time to go through the change with Cameron as part of the CR.

Code Quality Checklist

(Some checks are automatically carried out via the CI pipeline)

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the
    readability of the code
  • My changes generate no new warnings

Testing

  • I have tested this change locally, using the rose-stem suite
  • If any tests fail (rose-stem or CI) the reason is understood and
    acceptable (eg. kgo changes)
  • I have added tests to cover new functionality as appropriate (eg. system
    tests, unit tests, etc.)

Interactive Testing

Regression suite running under ctest and running interactively. $SHUM_TMPDIR is set automatically by the ctest harness and manually in the interactive example:

vdi> cmake --build --preset debug-gcc -t test
Running tests...
Test project /var/tmp/persistent/Development/shumlib/build/debug
    Start 1: shumlib-tests
1/1 Test #1: shumlib-tests ....................   Passed    0.03 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.03 sec
vdi> env SHUM_TMPDIR=/tmp ./build/debug/shumlib-tests 

 Test module initialized

    . : successful assert,   F : failed assert 


Testing shum_byteswap at Shumlib version: 2026011
.................................................................
Testing shum_constants at Shumlib version: 2026011
................................................
Testing shum_fieldsfile at Shumlib version: 2026011
..............................................................................
..........................................................................................................................................
.......................................................................
Testing shum_fieldsfile_class at Shumlib version: 2026011
....................................................................
Testing shum_horizontal_field_interp at Shumlib version: 2026011
.......................................................
Testing shum_kinds at Shumlib version: 2026011
........
Testing shum_latlon_eq_grids at Shumlib version: 2026011
........................................................................................................................................................................
Testing f_shum_number_tools at Shumlib version: 2026011
............................................................................................
Testing shum_spiral_search at Shumlib version: 2026011
........................
Testing shum_string_conv at Shumlib version: 2026011
..............
Testing shum_thread_utils at Shumlib version: 2026011
...........................................................
Testing shum_wgdos_packing at Shumlib version: 2026011
.............................................................................................

     Start of FRUIT summary: 

 SUCCESSFUL!

   No messages 
 Total asserts :            981
 Successful    :            981
 Failed        :              0
Successful rate:   100.00%

 Successful asserts / total asserts : [          981 /         981  ]
 Successful cases   / total cases   : [          109 /         109  ]
   -- end of FRUIT summary
vdi>

Security Considerations

  • This change does not introduce security vulnerabilities
  • I have reviewed the code for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

Performance Impact

  • Performance of the code has been considered and, if applicable, suitable
    performance measurements have been conducted

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance
    of Generative AI tool name (e.g., Met Office Github Copilot Enterprise,
    Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the
    Simulation Systems AI policy(including attribution labels)

Documentation

  • Where appropriate I have updated documentation related to this change and
    confirmed that it builds correctly

Documentation will be updated as part of a separate change

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • CLA compliance has been confirmed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Documentation is complete and accurate
  • Security considerations have been addressed
  • Performance impact is acceptable

Update the build system to use CMake.  Enable support for running
regression tests directly from the build files.
The top-level Makefile was incorrectly overwritten during testing by
CMake.  Restoring the file to the last valid commit to fix things.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants