Installing GFortran
GFortran is the name of the GNU Fortran project. The main wiki page offers many helpful links about GFortran, as well as Fortran in general. In this guide, the installation process for GFortran on Windows, Linux, macOS and OpenBSD is presented in a beginner-friendly format based on the information from GFortranBinaries.
Windows
Three sources provide quick and easy way to install GFortran compiler on Windows:
-
, provides 32 and 64-bit x86 executables of the latest (10.2) gcc-version. , provides 32 and 64-bit x86 executables of the 9.2 gcc-version. provides a 64-bit x86 executable of the 8.1.0 gcc-version.
In all the above choices, the process is straightforward—just download the installer and follow the installation wizard.
Unix-like development on Windows
For those familiar with a unix-like development environment, several emulation options are available on Windows each of which provide packages for gfortran:
- Cygwin: A runtime environment that provides POSIX compatibility to Windows;
- MSYS2: A collection of Unix-like development tools, based on modern Cygwin and MinGW-w64;
- Windows Subsystem for Linux (WSL): An official compatibility layer for running Linux binary executables on Windows. With Windows Subsystem for Linux GUI one can run text editors and other graphical programs.
All of the above approaches provide access to common shells such as bash and development tools including GNU coreutils, Make, CMake, autotools, git, grep, sed, awk, ssh, etc.
We recommend the WSL environment for those looking for a Unix-like development environment on Windows.
Linux
Debian-based (Debian, Ubuntu, Mint, etc…)
Check whether you have gfortran already installed
If nothing is returned then gfortran is not installed. To install gfortran type:
to check what version was installed type:
You can install multiple versions up to version 9 by typing the version number immediately after “gfortran”, e.g.:
To install the latest version 10 you need first to add / update the following repository and then install:
Finally, you can switch between different versions or set the default one with the update-alternatives (see manpage). There are many online tutorials on how to use this feature. A well structured one using as an example C and C++ can be found here, you can apply the same logic by replacing either gcc or g++ with gfortran .
RPM-based (Red Hat Linux, CentOS, Fedora, openSuse, Mandrake Linux)
Since Fedora 22, dnf is the default package manager for Fedora:
Arch-based (Arch Linux, Antergos, Manjaro, etc…)
macOS
Xcode
If you have Xcode installed, open a terminal window and type:
Binaries
Go to fxcoudert/gfortran-for-macOS to directly install binaries.
Homebrew
MacPorts
Search for available gcc versions:
Install a gcc version:
OpenBSD
On OpenBSD, the GFortran executable is named egfortran . To test it, type:
OpenCoarrays
OpenCoarrays is an open-source software project that produces an application binary interface (ABI) used by the GNU Compiler Collection (GCC) Fortran front-end to build executable programs that leverage the parallel programming features of Fortran 2018. Since OpenCoarrays is not a separate compiler, we include it here, under gfortran.
While with gfortran you can compile perfectly valid code using coarrays, the generated binaries will only run in a single image (image is a Fortran term for a parallel process), that is, in serial mode. OpenCoarrays allows running code in parallel on shared- and distributed-memory machines, similar to MPI:
The process of installation is provided in a clear and comprehensive manner on the official site.
We emphasize that native installation on Windows is not possible. It is only possible through WSL.
Fortran

Это среда разработки, для людей, которые занимаются программированием на одноименном языке. В качестве дополнения к среде идет подробная документация.
Fortran относится к числу удобных платформ для работы с одноименным языком. К слову, таковых платформ на сегодняшний день не так уж и много. Причиной этому служит то, что данный язык не является востребованным сегодня. Человеку, работающему на нем достаточно сложно найти достойные приложения, позволяющие писать код (не говоря о приложениях с отладчиком). Можно с уверенностью сказать, что альтернатив Fortran сейчас просто не существует.
Предоставляемые возможности
Используя данное приложение, программист сможет делать программы на языке Fortran, прибегая к использованию функций подсветки кода, отладки и рефакторинга. В случае возникновения необходимости, имеется возможность скрытия отдельных блоков программы, переключения между несколькими файлами одного проекта, выполнения поиска нужной строки или переменной. Из возможностей, присущих всем приложениям данного типа следует отметить: