An action to setup the GNU Fortran compiler.
Note: Maintenance of this action has ceased. If the GCC preinstalled on runner images does not meet your needs, fortran-lang/setup-fortran
is recommended.
To use this action, add a step like the following to your workflow:
- name: Setup GNU Fortran
uses: modflowpy/install-gfortran-action@v1
GNU fortran is pre-installed on runners for all three platforms, so there is no need to install it fresh — this action simply symlinks the compiler executables to a common location /usr/local/bin/gfortran
on Linux and MacOS, putting gfortran
on the path. On Windows the action works around an error preventing the default installation from working properly.
On ubuntu-latest
runners this action simply symlinks /usr/bin/gfortran-10
to /usr/local/bin/gfortran
.
On macos-latest
runners this action symlinks /usr/local/bin/gfortran-12
to /usr/local/bin/gfortran
, as well as /usr/local/opt/gcc/lib/gcc/12
to the corresponding paths for versions 10 and 11 for compatibility with binaries expecting dynamically loaded modules.
On windows-latest
runners gfortran
comes pre-installed via Chocolatey. This action works around gfortran
version 20220626.1
issues by symlinking /c/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin
to Chocolatey's bin directory.