-
Notifications
You must be signed in to change notification settings - Fork 6
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
Generate compiler flags from toml file #251
Merged
Merged
Conversation
This file contains 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
The flags were hardcoded into the Makefile, now the are generated through the toml file. This commit removes a layer of indirection in which each flag is stored in a variable, and the compiler's flags are lists of variables rather than lists of flags. This indirection is useful for mutliple things, including names, flags with spaces, and the empty flag. Therefore, in a future commit, this level should be reproduced at the Python level, and re-introduced. In the meantime, this commit will compile and run fine, so long as none of the special cases mentioned above are hit.
Restored the level of indirection where each flag is stored in a variable. From now on, DEFFLAGS is automatically included by FLiT, as this is almost always desired and it's hard to get out of the toml file the way the Python code works now. To process the flags at the Python level, dictionaries are used, which has the side effect of causing FLiT to run the flags in whatever order the Python dictionary decides to give it. This feels weird with optimization levels, but all the same tests still get run.
The Makefile still has them hard-coded, but this change at least makes it possible to have the switches in the flit-config.toml file and to have them be populated and checked correctly, all without breaking existing tests.
Update it for new switches_list and optimization_levels fields
Instead of having the empty switches always part of the search space handle it from the switches_list within flit-config.toml
Common baseline for toml flag feature merging
Issue119 user provided flags
tst_nocompilers.py flitutil: add extract_make_vars() function This function returns ALL makefile variables as a dictionary instead of the other extract_make_var() function that extracts only one at a time. This is useful for introspection and if many variables are desired
They weren't testing with thier actual needed configuration file, but rather with the default configuration file, of which causes all tests to pass anyway.
This tests error paths in handling the config file
Generate compiler flags from toml file
Hi Ian, I have reviewed JJ's changes and updated them. But I have not had anyone besides JJ review my changes. This is kind of a big change, but it has associated unit tests. You could perhaps review the documentation and unit tests to see how the change is perceived by users and how it is tested. If you have time, you can review the rest of it too, but I know you're pressed for time right now. |
IanBriggs
reviewed
Jan 7, 2019
IanBriggs
approved these changes
Jan 8, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
Involves touching documentation
enhancement
make
Involves touching GNU Makefiles
python
Involves touching python code
tests
Involves touching tests
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.
Fixes #119
This has additional stuff that was in pull request #247
Description:
Moved the flags from the Makefile to the toml file.
In previous versions of FLiT, each flag had a variable associated with it. These variable names are now auto-generated by Python and added to the Makefile. In particular, this means that
Documentation:
Tests:
flit_update.py
tool automatically verifying the new functionality.flit_update.py
andflitutil.py
were added with doctest strings that pass