Some while ago I created a setup-fortran action for usage in CI with GitHub actions, which apparently is already in use around the Fortran ecosystem. Turns out I never properly announced it in our discourse, so here we go:
Currently the action allows to setup gfortran (gcc), ifort (intel-classic) and ifx (intel):
Supported Intel toolchains (the version refers to the compiler version in the output not the version of the oneapi release, read more about this here):
I’m not much of a GitLab user, but the setup steps are mainly collected in one big script at setup-fortran/setup-fortran.sh at main · awvwgk/setup-fortran · GitHub and should be reusable. There are some GitHub actions specific steps like making the Intel setup persistent between workflow steps, which could be guarded by checking for GHA specific env vars. Is there an equivalent to custom GHA for providing steps in a GitLab pipeline?
Hello. Thanks @awvwgk for sharing the setup-fortran action. I’m using in my workflows and it has worked great.
Since this morning I am seeing worfkflows failing with erorr: Error: Unable to resolve action. Repository not found: awvwgk/setup-fortran. Posting here to check fi this is a general problem. Has the action been migrated? The usage instructions on github marketplace have not changed for what I can tell.
Thanks for confirming @milancurcic . Indeed I had tried replacing with fortran-lang/ and it works. Does it help if I send a PR to update the usage note?
Thanks, this looks neat. I’m curious about the use with gfortran? For Github runners based on Ubuntu 22.04, gfortran-10, -11, and -12 are available default (see this example).
Another possible compiler for which support would be useful is the Nvidia HPC toolkit (i.e. nvfortran). I’m using my own home-built containers for this and the Intel compilers. A Github action that let me skip the containers is/would be the bomb.
In addition to fortran-lang/setup-fortran (thank @awvwgk and contributors), I use the following scripts for the GitHub Actions of PRIMA to install Fortran compilers on GitHub-hosted runners.
Intel oneAPI (alternative to fortran-lang/setup-fortran)
where the Fortran source code of PRIMA is compiled using eight compilers (gfortran, ifort, ifx, nvfortran, AOCC flang, Classic flang, sunf95, and g95) with strict debug options to make sure that no error (of course) or warning is raised (PRIMA does not tolerate any warning).
N.B.: Do not use the scripts on your own computers before examining them. They may make unwanted changes to your system.