-
Notifications
You must be signed in to change notification settings - Fork 117
Implement --flag option for Fortran fpm #390
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
Conversation
|
Fails due to #327 |
| character(*), intent(in) :: path | ||
| character(:), allocatable :: canon | ||
| !! FIXME: Lot's of ugly hacks following here | ||
| function canon_path(path) |
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'm not proud of what I've done here, but it seems to get the job done for now.
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 think adding in ugly hacks would make me less nervous if you also added some unit tests. 😉
- default is equal to debug unless --flag is present and overwrites all arguments - debug is the developement profile, options given by --flag are appended - release is the production profile, options given by --flag are appended
|
This is looking really great @awvwgk! I get a failure when passing flags without a profile: It looks like we were previously relying on Lines 241 to 242 in 8cbbd80
|
LKedward
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.
This all looks good to me. Great job, cheers 👍
|
Let's have a few more eyes look over this PR before merging it. |
|
I think is very much a step in the right direction. Thanks for putting it together. |
|
|
@urbanjost Thanks for the feedback. I agree, in the long term we don't want to rely on the [flag.gcc]
0x2A42023B310FA28D = " -Wall -Wextra -Wimplicit-interface -fPIC -fmax-errors=1 -g -fcheck=bounds -fcheck=array-temps -fbacktrace -fcoarray=single"
0x5F75F7C92365B9B9 = " -O3 -Wimplicit-interface -fPIC -fmax-errors=1 -funroll-loops -fcoarray=single"The ID solution is interesting, but I don't like the idea of introducing a global state dependency in the build system which might impact reproducible builds. |
|
Thanks for the feedback. Unless something is blocking this patch I'll go ahead and merge this later today. |
Exploratory implementation of
--flagand--profilefor Fortran fpm.--profiletakes either debug or release, defaults to debug but yields against--flag--profiledoes not check it's argument, but saves this it in the settings,this allows the model to potentially reuse it for reading the compilation profile from the package manifest
--flagtakes one argument which is forwarded to the compile arguments in the model--flagarguments are replacing all compile arguments if no profile is specified--flagarguments are appended if a compilation profile (debug or release) is presentgfortran-10orpowerpc64le-conda-linux-gnu-gfortranCloses #389