build(c++): report machine flags used - #211
Open
robertodr wants to merge 10 commits into
Open
Conversation
robertodr
requested review from
adamglos92,
diagonal-hamiltonian,
fpietra and
ludmilaasb
as code owners
August 6, 2026 19:37
robertodr
force-pushed
the
build-report-machine-flags-used
branch
from
August 7, 2026 08:17
2f71aa3 to
964f036
Compare
robertodr
force-pushed
the
build-report-machine-flags-used
branch
from
August 7, 2026 08:22
ace65b2 to
9cf5662
Compare
|
Docs preview: https://pr-211.monoprop-docs.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor-use-hwloc #211 +/- ##
===================================================
Coverage 97.58% 97.58%
===================================================
Files 14 14
Lines 745 745
Branches 99 99
===================================================
Hits 727 727
Misses 13 13
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more. |
Assisted-by: GitHub Copilot, gpt-5.3-codex
robertodr
force-pushed
the
build-report-machine-flags-used
branch
from
August 7, 2026 12:28
fd4f296 to
e0da3d3
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
🤖 AI text below 🤖
This pull request introduces reporting of machine-dependent compiler flags (such as those set via
-march) used to build the project. It adds a mechanism to query, clean, and expose the actual flags used for the active variant, making this information available at both the C++ and Python levels. Additionally, it introduces a utility script and its tests for parsing GCC target options.Machine-dependent flags reporting and variant introspection:
_monoprop_query_machine_flags) to query and clean the machine-dependent flags used for each build variant, storing them in CMake variables and generating a new header (Variants.h) with compile-time functions to report the active variant and flags. [1] [2]Info.h.inand the C++ bindings to expose the active variant and its compiler flags viavariant()andvariant_flags()functions, which are now also accessible in Python asmonoprop.__variant__andmonoprop.__compiler_flags__. [1] [2] [3] [4] [5] [6]Utility script and testing:
tools/gcc-target-help-clean.py, a script to normalize the output ofgcc -Q --help=target, and a corresponding test suite to ensure robust parsing and cleaning of compiler flag output. [1] [2]CMake and source organization:
VariantMacros.h,Info.h, etc.) are included in the public interface and properly listed in the CMake configuration.These changes improve transparency into the build environment, facilitate reproducibility, and make it easier to debug and optimize builds for different architectures.
Checklist
docs/,CONTRIBUTING.md) if neededCHANGELOG/ release notes updated if applicableAI/LLM disclosure
Important
By opening this PR I confirm that I have read CONTRIBUTING.md and I agree to the terms of the Contributor License Agreement.
Warning
If you're contributing on behalf of your employer, contact cla@algorithmiq.fi to arrange a Corporate CLA.