-
Notifications
You must be signed in to change notification settings - Fork 212
Addition of tables summarizing preprocessing macros and flags #1083
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1083 +/- ##
==========================================
+ Coverage 68.60% 68.69% +0.08%
==========================================
Files 393 393
Lines 12710 12720 +10
Branches 1377 1376 -1
==========================================
+ Hits 8720 8738 +18
+ Misses 3990 3982 -8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jalvesz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the table @jvdp1, here a couple of minor edits
Co-authored-by: José Alves <102541118+jalvesz@users.noreply.github.com>
Co-authored-by: José Alves <102541118+jalvesz@users.noreply.github.com>
perazz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this work @jvdp1. I guess this is more of a style comment rather than a content one. Regarding "optional" functionality either from "modularized" components or external libraries, some macros are affirmative and some are negative. I wonder if it is still early enough that this behavior could be standardized?
For example:
- only use affirmative version ->
defined(STDLIB_BITSET)vs.!defined(STDLIB_BITSET) - only use boolean formulation (I believe the C preprocessor treats boolean exactly in the same way as an integer 0/1, so this may just be different syntactic sugar - no need to change functionality).
I think it is the right time to discuss about it ;) because we didn't communicate on most of them yet. Currently the default behaviour for With The main issue is with If I am correct, it was argued in #1050 to use \cc @jalvesz |
|
I agree that the positive form is definitely superior @jvdp1, I also personally think the |
Any ideas how we should deal with |
|
If I'm not understanding correctly the discussion please let me know. Maybe one way to simplify things would be to unify in a single macro variable per library using only the positive version: !--------- macro
#ifndef STDLIB_BITSET
#define STDLIB_BITSET 1
#endif
!--------- usage
#if STDLIB_BITSET
print *, "hello"
#else
print *, "goodbye"
#endif
end
I think it would be less confusing as there is just one variable to manage. |
With the positive form, I believe the deployment script should generate the macros.inc file from scratch every time - containing all relevant macro definitions. If this is the case, perhaps it would be better (/more robust?) to just put them in |
|
I think the existence of the macro.inc file being self-contained is the most robust and simple solution. No need to change anything elsewhere. Either with CMake or FPM, one would just modify to change the default behavior. |
This was not possible with FPM as it did not parse macros, at least until recently |
|
I see, so we need a solution that is simple and robust across: CMake, FPM (and pure make file?) build systems. I thought about the Without an include file, the only alternative solution would be to have a centralized file with all macros as flags that can be added to the list of build time flags. |
|
@perazz sorry if I don't get still the details of the issue, I had already used include files previously without any problems with fpm: https://github.com/jalvesz/fast_math/tree/main/src/utilities. Is the issue related to |
As suggested by @jalvesz in his comment, here is a PR to introduce tables that summarize fypp and C-preprocessing flags and macros.