-
Notifications
You must be signed in to change notification settings - Fork 108
A Possible Solution for Compiler Flags #350
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
Comments
Too bad we can't steal a good idea from cargo here, since they never had to deal more than one compiler in their ecosystem. Requiring some deeper nesting in the package manifest seems inevitable for a good Fortran compiler support.
I would prefer to put the profiles under the
Agreed. Using
I made a similar proposal using a table of tables in #112 (comment), after thinking through different format this one seems to be the only feasible choice to support multiple compilers.
How do you distinguish between compile arguments, link arguments and global arguments here?
This warrants matching rules for file names, like
|
Good point. I'd suggest instead of having a single |
Agreed. I would prefer not to encourage the use of per file compiler flags, but at some point somebody's going to "need" it, so we should have a way to do it. |
Personally, the only time I use different versions of the same compiler is to find the oldest compiler version which works. In Linux I can do this easily with update-alternatives. I can imagine problems when compiler-flags change meaning or are removed. But if a package required some specific compiler flags to make it work right, there is a high change the package was non-standard to begin with. Ideally the users would bring this up to the package maintainer who could find a workaround. |
Personally, I have always at least the four last versions of gfortran installed: gfortran is the latest (10), then I have gfortran-9, gfortran-8, gfortran-7, etc. When I have long computations to run, I choose the fastest one! And the latest version is not necessarily the fastest. Sometimes there is some kind of regressions considering the speed when a new major version arrives, and it improves with the following minor versions... Not huge differences but it can be up to 5 to 10%... Not negligible. |
Same here, I have at least two versions of GCC available on the same system, usually gcc-7 and gcc-10, mainly for regression testing. Also, when working with conda-build the compiler name is usually something like |
I was trying to package the original netlib's QUADPACK as |
It would be nice to be able to set flags for a specific operating system. For example, the linker flag |
I have a proposed solution to the issue of how we deal with compiler flags.
I propose adding a section to the
fpm.toml
file where compiler flags can be specified, with the following schema.For example:
One can then use a specified profile like
fpm build --profile only_debug_symbols
. The default/built-in profiles would correspond to our existing modes, and the existing modes would be equivalent to specifying the profile explicitly. I.e.fpm build
is equivalent to/impliesfpm build --profile debug
andfpm build --release
is equivalent to/impliesfpm build --profile release
.This has the following benefits:
I admit that the table structure seems somewhat deeply nested, so I'm open to suggestions of other schemas, but I think this covers everything that needs to be included.
P.S. If this works out I'd like to suggest an additional built-in profile - strict - that includes all possible compile and run time checking, with all warnings treated as errors. I think this is a very useful option to have, even if not utilized very often.
The text was updated successfully, but these errors were encountered: