gfortran

Preprocess and compile Fortran source files, then assemble and link them together. More information: <https://gcc.gnu.org/wiki/GFortran>.

Install

All systems
curl cmd.cat/gfortran.sh
Debian Debian
apt-get install gfortran
Ubuntu
apt-get install gfortran
Alpine
apk add gfortran
Arch Arch Linux
pacman -S gcc-gfortran
image/svg+xml Kali Linux
apt-get install gfortran
CentOS
yum install gcc-gfortran
Fedora
dnf install gcc-gfortran
Windows (WSL2)
sudo apt-get update sudo apt-get install gfortran
Raspbian
apt-get install gfortran
Docker
docker run cmd.cat/gfortran gfortran powered by Commando

Preprocess and compile Fortran source files, then assemble and link them together. More information: <https://gcc.gnu.org/wiki/GFortran>.

  • Compile multiple source files into an executable:
    gfortran path/to/source1.f90 path/to/source2.f90 ... -o path/to/output_executable
  • Show common warnings, debug symbols in output, and optimize without affecting debugging:
    gfortran path/to/source.f90 -Wall -g -Og -o path/to/output_executable
  • Include libraries from a different path:
    gfortran path/to/source.f90 -o path/to/output_executable -Ipath/to/mod_and_include -Lpath/to/library -llibrary_name
  • Compile source code into Assembler instructions:
    gfortran -S path/to/source.f90
  • Compile source code into an object file without linking:
    gfortran -c path/to/source.f90

© tl;dr; authors and contributors