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

Resolve successive config mismatched NGenConfig.h #682

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

program--
Copy link
Contributor

@program-- program-- commented Nov 22, 2023

This PR resolves #681 by outputting the configured NGenConfig.h to the specified build directory instead of the source include directory.

i.e., in the example given in #681, now we will have 2 NGenConfig.h headers that correctly represent the build directory's configuration:

$ cmake -B build_dir_A -S . -DNGEN_WITH_MPI=OFF -DNGEN_WITH_PYTHON=OFF -DNGEN_WITH_TESTS=OFF
$ cmake -B build_dir_B -S . -DNGEN_WITH_MPI=ON -DNGEN_WITH_PYTHON=OFF -DNGEN_WITH_TESTS=OFF
$ diff build_dir_A/include/NGenConfig.h build_dir_B/include/NGenConfig.h

12c12
< #define NGEN_WITH_MPI 0
---
> #define NGEN_WITH_MPI 1
54c54
<     NGEN_WITH_MPI: OFF
---
>     NGEN_WITH_MPI: ON
67a68,75
>   MPI (C):
>     Version: 4.0
>     Library: /usr/local/lib/libmpi.so
>     Include: /usr/local/include
>   MPI (CXX):
>     Version: 4.0
>     Library: /usr/local/lib/libmpicxx.so,/usr/local/lib/libmpi.so
>     Include: /usr/local/include

Additions

  • New target for the configuration header given a build, NGen::config_header that includes ${build_directory}/include.
  • Configures the Python build version source file in src/core to ${CMAKE_CURRENT_BINARY_DIR}/src/core/NGen_Python_Build_Versions.cpp and adds it as a source to NGen::core.

Testing

Using the example above, built target ngen and target all successfully for both build configurations.

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 ➡️

@program-- program-- added bug Something isn't working build Issues related to CMake and building ngen labels Nov 22, 2023
@program-- program-- self-assigned this Nov 22, 2023
PhilMiller
PhilMiller previously approved these changes Nov 22, 2023
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.

This may not be the perfect way to do things as CMake goes, but I don't really know the right way, and I'm pretty sure it will resolve the problem for now.

@PhilMiller PhilMiller merged commit 937b60c into NOAA-OWP:master Nov 27, 2023
18 of 19 checks passed
@program-- program-- deleted the jsm-patch-681 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
bug Something isn't working build Issues related to CMake and building ngen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output configured NGenConfig header into build directories instead of include directory
2 participants