-
Notifications
You must be signed in to change notification settings - Fork 12
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
Integrate MPAS build infrastructure with CIME #245
Integrate MPAS build infrastructure with CIME #245
Conversation
@kuanchihwang just letting you know that I'll make sure to review this PR once PR #244 has been merged (as you suggested above). Thanks! |
Variables (e.g., build options) will be read from `${CASEROOT}/Macros.make`. MPAS will be built as a static library located at `${LIBROOT}/libmpas.a`.
Build MPAS by invoking/reusing its own build infrastructure. This way, it would be easier to keep in sync with future upstream changes.
`cime/CIME/Tools/Makefile` explicitly queries the value of `CAM_DYCORE`. If the value is `mpas`, it attempts to build MPAS by using old rules and fails. There are some ways to work around this without modifying `cime/CIME/Tools/Makefile` and breaking backward compatibility for CAM. One of them is to rename the value to `mpasa`.
5f7793f
to
c58c5ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @kuanchihwang ! However I believe many of these changes may be unnecssary as the top-level CESM Makefile in CIME already has the setup needed to build the MPAS-A dycore as a library. For example see here:
https://github.com/ESMCI/cime/blob/master/CIME/Tools/Makefile#L519
and here:
https://github.com/ESMCI/cime/blob/master/CIME/Tools/Makefile#L556
So I think in CAM-SIMA you only have to create the relevant Makefile and associated paths/linking commands (which you are doing in the PR already). Everything else can theoretically be removed, which explains my comments below.
Of course if you and @mgduda would prefer to move away from the CIME Makefile method then please let me know and I'll change my review. Thanks!
This helps keep MPAS source code in sync between `mpas_dycore_src_root` and `mpas_dycore_bld_root`.
This reverts commit c58c5ec.
Setup MPAS build infrastructure in a way that MPAS can be built along with CAM.
Drop dependency to `$(CASEROOT)/Macros.make`. Users are responsible to provide all necessary build options via environment variables or command line arguments. In this case, rely on CIME Makefile to handle this. Print those build options for transparency.
This Makefile catches the `make` command from CIME Makefile and then executes appropriate targets in order.
Address reviewer's suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me now. Thanks @kuanchihwang!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
This PR brings integration of MPAS build infrastructure with CIME. If MPAS dynamical core is selected (determined from model grid specifications), it will be built as a part of the usual CIME build process (i.e.,
case.build
).The approach taken here is to reuse upstream MPAS build infrastructure as much as possible. This way, it would be easier to keep in sync with future upstream changes. However, by default, MPAS is built as a standalone executable. A supplemental
Makefile
is therefore needed to enable MPAS to be built as a static library, which is then linked into the host model executable.This PR should be considered after #244.