Compilers, Installation & Tooling

2.1 Compilers

free, widely available, excellent standard support free, LLVM-based, OpenMP offload (replaces classic ifort) flang (LLVM Flang) modern open-source compiler (flang / flang-new) NVIDIA HPC SDK

GPU support: OpenACC, CUDA Fortran, do concurrent offload interactive (REPL), Jupyter kernel, compiles to LLVM/C/WASM Cray/HPE Fortran (ftn) NAG Fortran strict standard checking

AMD Flang (aocc), IBM XL Fortran

2.2 Installing gfortran

Linux (Ubuntu/Debian) Install MSYS2, then pacman -S mingw-w64-ucrt-x86_64-gcc-fortran, or

Install Intel oneAPI HPC Toolkit (ifx), or use WSL2 with Ubuntu, or

conda install -c conda-forge gfortran / winget install for the Intel compiler.

sudo apt install gfortran
brew install gcc        # provides gfortran
gfortran --version

2.3 The Fortran Package Manager (fpm)

conda install -c conda-forge fpm      # or download a binary / pip install fpm
fpm new hello
cd hello
fpm run
fpm test
fpm build --profile release

2.4 Editors & tools

VS Code with the *Modern Fortran* extension + fortls language server (pip install fortls).

Vim/Neovim/Emacs with fortls; Intel's Visual Studio integration on Windows.

Formatter: fprettify (pip install fprettify), findent.

Online: Compiler Explorer (godbolt.org), LFortran in the browser.