-
Notifications
You must be signed in to change notification settings - Fork 99
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
Compiler flags profiles #498
base: main
Are you sure you want to change the base?
Conversation
…in all fully defined profiles and stores them in a list
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.
I had a quick look over the patch and already a couple of questions/comments.
if (size(key_list).ge.1) then | ||
do ikey=1,size(key_list) | ||
key_name = key_list(ikey)%key |
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.
Why do we have to iterate over a list of keys here? All required key names in a profile are known at compile time.
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.
This is supposed to be ready for further error handling. We had a discussion about whether an error should occur if the table contains other key names.
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.
Also, I think that this is the easiest way how to deal with the error handling of the fields as they are. They do not need to be defined, but if they are, they need to be just key-value pairs.
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.
This still needs to be addressed.
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.
I still think that this is the easiest solution, if you want to suggest anything else, please do.
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.
Fantastic work Jakub @kubajj! You've achieved a lot so far! I've left a few comments on some things that stand out to me at this stage. We can discuss these at our upcoming meeting, or at an additional one before you head off.
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.
The profile priority check is fragile, instead of checking the fpm output, it should fail to compile or create a runtime error if the profiles are not used correctly to produce a reliable regression test.
I prefer to have the changes for the dependency tree in a different PR, this makes them easier to review and we will also get them merged much faster. |
Co-authored-by: Laurence Kedward <[email protected]>
…oad_compiler_profiles
I opened a new PR #539. Hope this helps. |
I checked the manifest validation a bit and found a few interesting edge cases: Too deep nested tables are not flagged as invalid as long as they contain valid keywords. name = "example"
[profiles.gfortran.gfortran.gfortran.gfortran]
[profiles.gfortran.ifort.flang.lfortran]
[profiles.linux.windows.macos.freebsd] Schema check on profile level does not catch invalid keywords: name = "example"
[profiles.ifort]
not-supported = true |
This is one of the reasons why I decided to keep the loop in |
If you've got the time this week to look into addressing these cases, that would be great. It may need to be done before merging anyway. What is the main difficulty in identifying these cases? |
If I remember correctly, there were some issues with the difference between |
I take this back, it was not difficult at all. |
I'll look into the conflicts soon-ish and than we can sort out how we will proceed to get this important patch merged smoothly. |
I can look into it tomorrow, but I need to set up |
@kubajj or @awvwgk , have either of you had time to look at and/or resolve the merge conflicts? I'm getting more and more anxious to start using (and see how others use) this feature. Is there something tricky about resolving them? I could potentially find some time in the next week or two to help out if needed. |
I am sorry for replying so late. I am currently traveling to UK to start the semester on Monday and I had limited connection. I looked into the merge conflicts, but did not manage to fix them. There are parts of the |
There is still an open issue with the dependency tree, I believe that it is a bad idea to introduce the parent nodes in the tree structure to fix that we are working with the flattened dependency tree, instead we should define the connectivity in with the child nodes and just walk the graph to apply the profiles. This is something I promised to look into, but haven't found the time yet to create a patch with a proper implementation. Of course the dependency tree issue is only one part of this patch, the different build directories and the profiles for the package manifest are fine. Therefore, my suggestion was to use the build directory implementation from this patch for fixing #422 and get the first part of this project into the fpm main branch. This way we can make the changes introduced here more modular without affecting all parts of fpm at once. |
I started updating the build directory change from this patch in #575. Please have a look if this is sufficient to implement the compiler profiles in the target generation. |
This pull request contains all my contribution implemented during my GSoC 2021 Handling compiler arguments project.
I have implemented the following features:
Changes:
profiles.f90
to the functionget_default_profiles
, which returns an array ofprofile_config_t
s'gfortran'
infpm.90/build_model
toDEFAULT_COMPILER
introduced inprofiles.f90
, for consistencyproj_dir
argument toget_package_data
andnew_package
for file scope profilespackage_t
andpackage_config_t
definitions withprofile_config_t
include_dirs
at the beginning ofbuild_package
subroutinebuild_name
fromfpm_command_line
and simplifycheck_build_vals
subroutinefpm_compiler/get_module_flags
not to include any directories, but just handle module flagsfpm_model
- Should fix issues withshow_model
model%output_directory
with functionget_output_directory
New features:
profile_config_t
andprofiles
toml table parser insrc/fpm/manifest/profiles.f90
find_profile
subroutine which finds a profile with given parameters in an array ofprofile_config_t
info_profile
function which returns representation of a profile as a stringfpm_targets/build_target_list
test_manifest.f90
ci/run_tests.sh
My blog on Fortran-lang discourse
link to Fortran-lang discourse