Skip to content

Conversation

@jvdp1
Copy link
Member

@jvdp1 jvdp1 commented Jan 8, 2026

Simplification of CPP macros for modularizing stdlib based on the discussion in #1083

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.69%. Comparing base (17a320a) to head (fc5667a).
⚠️ Report is 42 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1088      +/-   ##
==========================================
+ Coverage   68.67%   68.69%   +0.01%     
==========================================
  Files         393      393              
  Lines       12720    12720              
  Branches     1376     1376              
==========================================
+ Hits         8736     8738       +2     
+ Misses       3984     3982       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jalvesz
Copy link
Contributor

jalvesz commented Jan 9, 2026

This looks pretty good!
What should we do with the fpm.toml file? We can make it such that the deployment script adds the macros at the toml level and allows to modify them.

@jalvesz
Copy link
Contributor

jalvesz commented Jan 9, 2026

When the python script for fypp preprocessing was introduced for fpm we discussed at a point about a function to modify the toml #791 (comment) but this specific part never made it to the final verion, maybe we should revive this section for the script? (see pre_process_toml)

@jvdp1
Copy link
Member Author

jvdp1 commented Jan 9, 2026

This looks pretty good! What should we do with the fpm.toml file? We can make it such that the deployment script adds the macros at the toml level and allows to modify them.

The fpm.toml does not need to be modified with this approach. Thanks to @perazz, the current dev version of fpm will read macros.inc and will retain the defined variables with the value of 1. For different reasons, this approach using an include inc file also works with released versions of fpm (e.g. v0.12.0)

@perazz
Copy link
Member

perazz commented Jan 9, 2026

yes: fpm <=v0.12.0 will not read any macros, so everything works provided that all modules are included in the fpm version.

@jvdp1
Copy link
Member Author

jvdp1 commented Jan 9, 2026

When the python script for fypp preprocessing was introduced for fpm we discussed at a point about a function to modify the toml #791 (comment) but this specific part never made it to the final verion, maybe we should revive this section for the script? (see pre_process_toml)

If we need to modify the fpm.toml, it is to explicitely define the macros, as fpm will find itself what should be (or not) compiled. Maybe in some rare cases (e.g., if the user uses a sort procedure for real variables only, the bitset module doesn't need to be compiled), it might be advantageous to turn off manually the compilation of stdlib_bitset using fpm.toml (e.g., by defining STDLIB_BITSET=0). However, this should be done with caution due to dependencies among the different modules.

@jvdp1 jvdp1 marked this pull request as ready for review January 9, 2026 16:02
@jalvesz
Copy link
Contributor

jalvesz commented Jan 9, 2026

@jvdp1 given the close relationship between this PR and #1081 What would you think about trying to get this one merged and then complete #1081 following this new positive nomenclature ?

@jvdp1
Copy link
Member Author

jvdp1 commented Jan 9, 2026

@jvdp1 given the close relationship between this PR and #1081 What would you think about trying to get this one merged and then complete #1081 following this new positive nomenclature ?

LGTM!

@jvdp1 jvdp1 merged commit 38576ca into fortran-lang:master Jan 10, 2026
27 checks passed
@jvdp1 jvdp1 deleted the simpli_cpp branch January 10, 2026 14:10
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.

3 participants