-
Notifications
You must be signed in to change notification settings - Fork 103
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
Ability to pass any compiler flags directly to the compiler #1096
Comments
My understanding of the fortran features structure is to hide compiler details behind the flags, so I'm not 100% sure adding compiler-specific flags is the best approach here. Regarding max line length, not all compilers support varying it but GNU definitely offers this good option. Instead of adding one more structure (remember that custom flags are passed via CLI rather than manifest), could we instead just change this: Line 173 in 1cfcaf8
to this? flag_gnu_free_form = " -ffree-form -ffree-line-length-none -ffixed-line-length-none", & |
Thank you for your speedy comments!
This is intended to not be specific to any compiler and the responsibility then is passed to the "user". But I understand that hiding compiler specifics is a design choice and therefore shouldn't be changed lightly. However, I can still see the benefit of having a way to specify any compiler flags via the manifest, rather than requiring
I think this sounds good and would solve issues with that particular flag. I shall raise another issue/PR to update the free-form but I am still interested in this mechanism of passing any compiler flag through the manifest. Happy to be proved wrong though. |
I agree, would probably make the most sense to have them under the [build]
link = ["blas","lapack"]
flags = ["-some-other-flag"]
c-flags = ["-c-only-flag"]
cxx-flags = ["-cpp-only-flag"] |
Description
It would be very useful to pass compiler flags from the fpm.toml file directly to the compilation commands. It seems that currently it is possible to pass very specific flags such as -ffree-form but something more generic would be more flexible. For example
The new
user-defined-flags
would then be passed straight through to the compiler and the compiler allowed to catch any errors with the flags.Possible Solution
get_feature_flags could handle a new feature
user_defined_flags
This would of course require further changes to add
user-defined-flags
. Could this be added everywheresource-form
also is currently?Additional Information
No response
The text was updated successfully, but these errors were encountered: