Skip to content
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

Create first draft of an example fpm.yaml file #46

Conversation

everythingfunctional
Copy link
Member

This is a first shot at what an fpm.yaml file might look like.

@certik
Copy link
Member

certik commented Mar 13, 2020

Thanks for trying to figure out what to put in.

My view is to do exactly what Rust / Cargo does. In Cargo, you can set many of these options, but by default, you do not, and you follow the layout. And you then tell cargo to build in Release or Debug modes, and Cargo chooses the default options.

In our case, I was thinking of following exactly the same approach. That is, fpm will support all Fortran compilers. Which means, the compiler specific options should not be set in fpm.toml, because those would be specific to a compiler, so would not work with another compiler.

So I would suggest to simplify your example as follows:

name:                package-name
version:             0.1.0
license:             BSD3
author:              "Author name here"
maintainer:          "example@example.com"
copyright:           "2020 Author name here"

dependencies: 
- stdlib

tests-dependencies:
    - vegetables 1.0  # I think in Cargo this means >= 1.0 and < 2.0

Finally, I would follow Cargo's naming conventions.

I am going to post a TOML example.

@certik
Copy link
Member

certik commented Mar 13, 2020

Here is the TOML equivalent:

[package]
name = "package-name"
version = "0.1.0"
license = "BSD3"
authors = ["Author name here <example@example.com>"]
edition = "2018"

[dependencies]
stdlib = "0.2.3"

[dev-dependencies]
vegetables = "1.0"

@certik
Copy link
Member

certik commented Mar 13, 2020

For comparison, a literal translation of the YAML to TOML is:

name = "package-name"
version = "0.1.0"
license = "BSD3"
author = "Author name here"
maintainer = "example@example.com"
copyright = "2020 Author name here"
dependencies = ["../std-lib.tar.gz"]
compiler = "gfortran"
devel-options = ["-g", "-Wall", "-Wextra", "-Werror", "-pedantic"]
release-options = ["-O3"]

[library]
source-dirs = "src"

[executables.executable-name]
main = "Main.f90"
source-dirs = "app"
linker-options = ["-O3"]
dependencies = ["iso_varying_string"]

[tests.test-name]
main = "Spec.f90"
source-dirs = "test"
linker-options = ["-Og"]
dependencies = ["vegetables >= 1.0 && < 2.0"]

(But as I said, I think we should simplify some of the sections and follow Rust's naming scheme.)

@everythingfunctional
Copy link
Member Author

Closing, since we're going with toml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants