Skip to content

[Fortran fpm] Add support for command-line specification of compiler options #235

@urbanjost

Description

@urbanjost

The h-fpm version allows compiler options on the command line. I would propose allowing the same capability but using the
syntax

fpm build [NAME(S)] [-release] -- ARGS

where ARGS could be multiple compiler options.

  • Any feedback on use cases for the feature, and comments on the h-fpm option would be informative as to whether this option should be added or not.
  • should the options replace all the options sans the ones required for the build (ie. -J, -I, ...) or be in addition to the default options?
  • I think the documentation should indicate that this potentially breaks a package being self-describing, as it would be problematic to have required options on external dependencies. It would be useful for building a top-level package with different options. Options for profiling come to mind, as well as external system libraries. Other options are being discussed to handle the compile and load options as something provided in the manifest file but there will probably always be a case for supplying various options while developing a package.
  • The h-fpm version hashes the options to create a unique pathname for each combination of switches. That is an option here ; as well as requiring a user-supplied name ;or still being built in the standard location. Not sure what the general sentiment is about that. Using the hash resolves all kinds of collision problems but could be hard to remember and duplicate unless the hash is reversible and tagged with a name for reuse.
  • should the options only apply to an application and not external dependencies and files in src/? Should there be an option to control what it applies to? Would a rebuild of all package components be required?
  • should the syntax be the same in both the f-fpm and h-fpm packages or is it an advantage to allow for two syntaxes (and underlying implementation differences) for exploring more possibilities?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions