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

Automate building external libraries #694

Merged
merged 32 commits into from
Jan 25, 2024

Conversation

program--
Copy link
Contributor

@program-- program-- commented Dec 28, 2023

This PR provides automation around building external libraries based on options selected.

Additions

  • Adds options
    • NGEN_WITH_EXTERN_SLOTH
    • NGEN_WITH_EXTERN_TOPMODEL (Dependent on NGEN_WITH_BMI_C)
    • NGEN_WITH_EXTERN_CFE (Dependent on NGEN_WITH_BMI_C)
    • NGEN_WITH_EXTERN_PET (Dependent on NGEN_WITH_BMI_C)
    • NGEN_WITH_EXTERN_NOAH_OWP_MODULAR (Dependent on NGEN_WITH_BMI_FORTRAN)
    • NGEN_WITH_EXTERN_ALL: enables all models if the dependency is enabled, i.e. sets NGEN_WITH_EXTERN_CFE=ON if NGEN_WITH_BMI_C=ON.
  • Adds cmake/ExternalSubdirectory.cmake which provides the add_external_subdirectory function. This is a simple convenience function wrapping add_subdirectory that can auto-update git submodules (GIT_UPDATE), and ensures a given target is imported (IMPORTS).
  • Automates building test BMI libraries when a dependent option is enabled, i.e. NGEN_WITH_BMI_C means testbmicmodel will be built.
  • Adds a Fortran compiler configuration step in the ngen-build action.

Changes

  • Updates build summary output to include new options and C/CXX flags set.
  • Modifies ngen_add_test to allow DEPENDS arguments, which are dependent targets for that test. This differs from REQUIRES and LIBRARIES in that DEPENDS are simply dependent targets, and otherwise have no relation/linkage to the target.
  • Modifies CMake listfile for noah-owp-modular, iso_c_bmi, and testbmifortran to better handle building in conjunction with NGen, or independently.
  • Modifies the Docker container used for an example run of NGen.

Removals

  • Removes the deprecated option -DPACKAGE_TESTS since this conflicts with SLoTH when auto-building.
  • Removes FindBMI_FORTRAN_ISO_C module since this PR removes the need for it.

TODO

  • Resolve including git submodules in new ngen.dockerfile.
  • Resolve CFE BMI sanitizer error.

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Target Environment support

  • Linux
  • macOS

@program-- program-- added the build Issues related to CMake and building ngen label Dec 28, 2023
@program-- program-- requested a review from PhilMiller December 28, 2023 15:56
@program-- program-- self-assigned this Dec 28, 2023
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
test/CMakeLists.txt Outdated Show resolved Hide resolved
@program-- program-- marked this pull request as ready for review January 3, 2024 22:30
@PhilMiller
Copy link
Contributor

The to-do left here is to update the version of cfe we test against to incorporate NOAA-OWP/cfe#101 and see it pass the tests, right?

@PhilMiller PhilMiller mentioned this pull request Jan 9, 2024
11 tasks
@PhilMiller
Copy link
Contributor

#664 already has that CFE update in progress

@program--
Copy link
Contributor Author

The to-do left here is to update the version of cfe we test against to incorporate NOAA-OWP/cfe#101 and see it pass the tests, right?

That is correct.

@aaraney
Copy link
Member

aaraney commented Jan 11, 2024

#664 has been merged.

@program-- program-- force-pushed the jsm-automate-extern branch from d265dea to fe8836c Compare January 11, 2024 19:48
CMakeLists.txt Outdated Show resolved Hide resolved
docker/ngen.dockerfile Outdated Show resolved Hide resolved
PhilMiller
PhilMiller previously approved these changes Jan 12, 2024
Copy link
Contributor

@PhilMiller PhilMiller left a comment

Choose a reason for hiding this comment

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

Anyone else want to have a look at this before it gets merged?

@PhilMiller
Copy link
Contributor

Let's mention this on the stand-up tomorrow, and merge if no one wants to hold it for their own review.

@program--
Copy link
Contributor Author

@PhilMiller Is there anything else needed for this? Otherwise, I think we're good to merge now.

program-- and others added 2 commits January 24, 2024 16:37
- adds options:
  + NGEN_WITH_EXTERN_CXX_MODELS
  + NGEN_WITH_EXTERN_C_MODELS
  + NGEN_WITH_EXTERN_FORTRAN_MODELS
- modifies ngen_add_test to allow `DEPENDS` arguments,
  which are dependent targets for that test. This differs
  from `REQUIRES` and `LIBRARIES` in that `DEPENDS` are simply
  dependent targets, and otherwise have no relation/linkage to the target.
- adds cmake/ExternalSubdirectory.cmake which provides the
  `add_external_subdirectory` function. This is a simple convenience
  function wrapping `add_subdirectory`.
program-- and others added 22 commits January 24, 2024 16:37
Co-authored-by: Phil Miller <[email protected]>
docker/ngen.dockerfile Outdated Show resolved Hide resolved
@PhilMiller PhilMiller merged commit 28dee37 into NOAA-OWP:master Jan 25, 2024
19 checks passed
@program-- program-- deleted the jsm-automate-extern branch February 12, 2024 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues related to CMake and building ngen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants