Virtual-environments: Add gfortran

Created on 22 Dec 2019  路  17Comments  路  Source: actions/virtual-environments

Tool information

  • Tool name: GFortran
  • Add or update? Add
  • Desired version: The default version. E.g. in Ubuntu, just do sudo apt install gfortran
  • Approximate size:
  • If this is an add request:

Virtual environments affected

  • [x] macOS 10.15
  • [ ] Ubuntu 16.04 LTS
  • [x] Ubuntu 18.04 LTS
  • [ ] Windows Server 2016 R2
  • [ ] Windows Server 2019

Can this tool be installed during the build?

Yes. On Ubuntu:

sudo apt-get install gfortran

On macOS::

brew install gcc9

On Windows: the image already has gfortran, no change necessary.

Are you willing to submit a PR?

Yes! Once I figure out how to do install it (see previous point.) Update: figured it out, I'll see if I can submit a PR.

C++ Ubuntu macOS awaiting-deployment

Most helpful comment

Hello, All

We have added gfortran for Ubuntu in #369 and MacOs. It should start rolling out early next week, once the rollout start it shows up as a pre-release here: https://github.com/actions/virtual-environments/releases

After that it takes about 6-7 days to reach all accounts (assuming no delays).

All 17 comments

@certik sorry for the delay looking into this. I have a few questions that might help us decide whether we can include this or not:

  1. Do you have workflows depending on this?
  2. Can this be installed on-the-fly during builds? How much does it add to a build?
  3. Are there reliable and consistent binaries available for Ubuntu, Windows, and Mac?

thanks.

@alepauly thanks a lot for the response. Here are the answers:

  1. Yes, here are a few examples:

https://github.com/fortran-lang/fpm/blob/af56c5890cd28f051147e36fa3c1d8553ec944ea/.github/workflows/CI.yml
https://github.com/fortran-lang/stdlib/blob/dc7e49b17fa728ad9f9cbd179292952f67b78ead/.github/workflows/CI.yml
https://github.com/fortran-lang/stdlib/blob/dc7e49b17fa728ad9f9cbd179292952f67b78ead/.github/workflows/ci_windows.yml

  1. > Can this be installed on-the-fly during builds?

Yes, see the above examples that install it on the fly. The Windows image already ships it, but it is installed on macOS and Linux.

How much does it add to a build?

Here is an example on Linux: https://github.com/fortran-lang/fpm/runs/396877419, which adds 1m 29s to the build. Here is an example on macOS: https://github.com/fortran-lang/fpm/runs/396877427, which adds 28s to the build time.

  1. Yes, on Ubuntu just do sudo apt-get install gfortran, on macOS we do brew install gcc9 and the Windows image already has gfortran.

Let me know if you have any other questions.

@alepauly I'm a Homebrew maintainer, and, full disclosure, work on fortran-lang/stdlib. I came here for this same reason and I was thinking about working up a PR for this. Looking at the Linux environment there is an install script named
[gcc.sh] that, somewhat confusingly, is installing g++-7. To install gfortran, one would simply need to add it to the gcc.sh script, or, better-yet, rename the [gcc.sh] script to indicate it is installing a specific version of g++ and create a gfortran.sh install script for linux.

My personal preference would be to install GFortran 8, but to make it consistent with other gcc tools we could easily install GFortran 7, 8 or 9 following the paradigm set in [gcc.sh].

One question: Where is the macOS infrastructure defined? I don't see anything in the images/macos folder. It would be really nice to install graphviz and gcc by default on macOS. (gcc in homebrew is the same as gcc@9, the latest stable release and includes gfortran, and g++.)

(Also, I have a number of public and private repos with workflows depending on gfortran)

@zbeekman thanks for all the info. I've gone ahead and moved this to get done (and figure out #103 and #104 at the same time).

gcc.sh that, somewhat confusingly, is installing g++-7. To install gfortran, one would simply need to add it to the gcc.sh script, or, better-yet, rename the gcc.sh script to indicate it is installing a specific version of g++ and create a gfortran.sh install script for linux.

not sure why it's pinned to g++7, from what I can see only gcc 8 and 9 are still supported, so we should definitely upgrade. Based on yours and other requests we should probably go to 8 across all languages for consistency.

One question: Where is the macOS infrastructure defined? I don't see anything in the images/macos folder. It would be really nice to install graphviz and gcc by default on macOS. (gcc in homebrew is the same as gcc@9, the latest stable release and includes gfortran, and g++.)

Unfortunately that's not public yet, we have some work to clean it up and make it public in this repository - so in the meantime we have to make all the changes to it. Do you want to open a new issue for graphviz so our team can look into adding it? I see you opened #335, I'll go ahead and add some detail there.

thanks again.

not sure why it's pinned to g++7, from what I can see only gcc 8 and 9 are still supported, so we should definitely upgrade. Based on yours and other requests we should probably go to 8 across all languages for consistency.

That sounds good to me. I'd also recommend renaming gcc.sh unless you want to lump the gfortran install in with it. FYI, the gfortran compiler isn't policed as strictly as gcc and g++ so having access to at least the previous version is recommended; sometimes severe gfortran bugs and regressions make it into major releases of GCC.

Unfortunately that's not public yet, we have some work to clean it up and make it public in this repository

It would be really awesome if that were documented in CONTRIBUTING.md, the README.md (both for the repo and the images/macos/README.md) and/or somewhere else logical. I spent a while hunting around to make sense of why there was nothing in the images/macos folder. Adding detail to #335 is helpful but a more prominent notice would be nice.

Do you want to open a new issue for graphviz

I'm going to take a look at the packages installed in macos runners and I'll open new issues for graphviz, and possibly gcc and/or gcc@8 if they're missing. But I have other fires to put out first.

It would be really awesome if that were documented in CONTRIBUTING.md, the README.md (both for the repo and the images/macos/README.md) and/or somewhere else logical. I spent a while hunting around to make sense of why there was nothing in the images/macos folder. Adding detail to #335 is helpful but a more prominent notice would be nice.

Will do, thanks for noting it. There's a few areas where docs could be very much improved in this repo, I'll add this to the list.

Good day!
We have added gcc, gfortran and clang tools on Windows and Ubuntu virtual environments in #369

Hello, All

We have added gfortran for Ubuntu in #369 and MacOs. It should start rolling out early next week, once the rollout start it shows up as a pre-release here: https://github.com/actions/virtual-environments/releases

After that it takes about 6-7 days to reach all accounts (assuming no delays).

@certik the images have been rolled out. Could you check GFortran, please?

@miketimofeev thanks for the heads up. I tested it in https://github.com/fortran-lang/fpm/pull/37 and it works!

So this issue is fixed, as far as I am concerned. Thank you everybody (@miketimofeev, @al-cheb, @ivan-nosar, @alepauly) for fixing it, and thanks @zbeekman for providing additional info.

Is there a reason gfortran-10 isn鈥檛 included in the latest images?

@junghans they probably install the version in Ubuntu 18.04, which is 7.5.0.

ubuntu-latest comes with 4 versions of gcc, but only 3 versions of gfortran.
(See https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md)

Ok, in that case it should be possible to enable gfortran for GCC version 10 also.

@junghans , no one has asked for it so we didn't add it.
Feel free to raise feature request.

@maxim-lobanov see #1796

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raulpopadineti picture raulpopadineti  路  3Comments

mxschmitt picture mxschmitt  路  3Comments

Poolitzer picture Poolitzer  路  4Comments

frankieroberto picture frankieroberto  路  4Comments

trajano picture trajano  路  3Comments