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

Make modifications needed to build a Python-wrapped version of SHiELD #28

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

spencerkclark
Copy link
Member

@spencerkclark spencerkclark commented Oct 4, 2023

Description

This PR makes changes required for building a Python wrapped version of SHiELD. It does two main things:

  • It builds all code except the coupler_main.F90 driver into static libraries, which downstream applications can link to (for now I did this only for the shield configuration option, but I could make a similar change for the solo configuration as well).
  • It adds an option for build all components with position independent code, through adding a nopic / pic option to the COMPILE, BUILDlibfms, and BUILDnceplibs scripts, and adding an PIC option to the Makefile templates for the gnu, intel, and nvhpc compilers.

Fixes #27

How Has This Been Tested?

These changes have been tested in ai2cm/SHiELD-wrapper#1. The continuous integration setup there builds the fortran model and its dependencies using the COMPILE script, builds the Python wrapper, and runs several tests. An important test checks that the Python-wrapped model produces bit-for-bit identical results to the fortran executable for an identically configured run.

Checklist:

Please check all whether they apply or not

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Build/COMPILE Show resolved Hide resolved
Build/BUILDlibfms Show resolved Hide resolved
Build/BUILDnceplibs Show resolved Hide resolved
Build/mk_scripts/MAKE_libFMS Show resolved Hide resolved
Build/mk_scripts/mk_make Show resolved Hide resolved
@spencerkclark
Copy link
Member Author

Thanks for the review @laurenchilutti -- good catch. I added default values for the pic argument in all of the relevant scripts. Let me know if you'd like me to make any more changes.

Copy link
Contributor

@laurenchilutti laurenchilutti left a comment

Choose a reason for hiding this comment

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

Thanks this looks good!

@laurenchilutti laurenchilutti merged commit 776a76a into NOAA-GFDL:main Oct 19, 2023
@spencerkclark spencerkclark deleted the harmonize-library branch October 19, 2023 12:02
@spencerkclark
Copy link
Member Author

Thanks @laurenchilutti and @bensonr!

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.

Features required for building a Python-wrapped version of SHiELD
3 participants