Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust pkgs meson file for transitioning M4AGO #414

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

jmaerz
Copy link
Collaborator

@jmaerz jmaerz commented Oct 18, 2024

This PR informs about potential issues when setting up a run with meson - cime-managed runs are NOT affected.

The PR provides support for any of the current M4AGO versions provided meson >= 0.57 is used.

Background
I recently worked on the M4AGO-sinking-scheme package and introduced a new file, which requires to be explicitly set via meson.build. Typically, a particular tag/sha of M4AGO is checked out (where this change isn't needed), but if one for any reason moves on to M4AGO master, this will create issues when compiling with meson. The code snippet is applicable for meson versions >=0.57, where the meson file system module has been introduced. Otherwise, the file needs to be manually added in the meson.build file. Hope it helps in the current transition period for M4AGO which is for making it more general and future-ready.

@JorgSchwinger and @TomasTorsvik : if wished, I can push it to master - I was just hesitant since the required meson release was Feb. 2021, which isn't too long ago.

@matsbn : I put you in here explicitly, since I know that you are using meson every now and then (not sure, which meson version you're running, though).

…t version

Only relevant, when compiled via meson setups
@jmaerz jmaerz added iHAMOCC Issue mainly concerns the iHAMOCC code base BLOM Issues mainly concerning the BLOM code base Externals labels Oct 18, 2024
@jmaerz jmaerz self-assigned this Oct 18, 2024
Copy link
Contributor

@TomasTorsvik TomasTorsvik left a comment

Choose a reason for hiding this comment

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

@jmaerz - thanks, this looks fine to me
One question, is the testing on file existing intended as a transitional fix, or will this be permanent? I'm wondering, if we need to introduce such a test every time a file is added/removed/renamed in a submodule, or only until a new tag version is available?

@jmaerz
Copy link
Collaborator Author

jmaerz commented Oct 21, 2024

Hi @TomasTorsvik , to my understanding and according to the meson documentation, each meson.build file in the subfolders needs to include individual files explicitly to be able to compile and track changes (similar to former make) to only re-compile the changed dependencies. Hence, whenever a name has changed or a file deleted/added, one needs to adopt it. The checking for the existence of the file here is more of a transition phase (I introduced a mo_m4ago_kind.F90 file to explicitly set the working precision). That said, the PR is more for information (but I can push it, if wished) and should just make the transitioning as smooth as possible for potential meson users. A normal checkout currently just gets the right version and the snippet wouldn't be needed - but the moment you checkout M4AGO master for some reason, meson build would fail without including the file. Again, this does not affect normal cime configurations and thus NorESM users (it is only about BLOM, e.g. in the 1D setup).

@TomasTorsvik
Copy link
Contributor

Hi @jmaerz , from our latest conversation I understand that including this in master will make your testing procedure easier. This PR shouldn't break anything (except parhaps for old meson versions) so I'm fine with bringing it in.

Copy link
Contributor

@JorgSchwinger JorgSchwinger left a comment

Choose a reason for hiding this comment

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

I can't say anything about this - I have never used a non-CESM-coupled version of BLOM and I have no knowledge about how meson works.

@jmaerz jmaerz merged commit fbe15e9 into NorESMhub:master Oct 23, 2024
5 checks passed
@jmaerz jmaerz deleted the meson4m4ago branch October 23, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLOM Issues mainly concerning the BLOM code base Externals iHAMOCC Issue mainly concerns the iHAMOCC code base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants