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

Generate compiler flags from toml file #251

Merged
merged 30 commits into from
Jan 8, 2019
Merged

Conversation

mikebentley15
Copy link
Collaborator

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

  1. The names of the variables in the Makefile are not abbreviated, and thus much longer.
  2. Switches and optimization levels are no longer guaranteed to be executed in any order.

Documentation:

  • Documentation was updated with the new configuration file format and examples.
  • All configuration files within the repository were updated with the new format
  • The default configuration was updated with comments describing each field.

Tests:

  • New tests were added for the flit_update.py tool automatically verifying the new functionality.
  • New functions added to flit_update.py and flitutil.py were added with doctest strings that pass

jjgarzella and others added 28 commits November 27, 2018 14:48
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
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
@mikebentley15 mikebentley15 added enhancement python Involves touching python code labels Dec 19, 2018
@mikebentley15 mikebentley15 added make Involves touching GNU Makefiles documentation Involves touching documentation tests Involves touching tests labels Dec 19, 2018
@mikebentley15
Copy link
Collaborator Author

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.

data/Makefile.in Outdated Show resolved Hide resolved
@IanBriggs IanBriggs merged commit f23a122 into devel Jan 8, 2019
@mikebentley15 mikebentley15 deleted the issue119-user-flag-tests branch April 9, 2019 19:09
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants