Linux

Follow your distributions guide to install gcc, clang, or whatever compiler suits you.

Windows

Multiple options exists: Visual Studio, VSCode, mingw-64, cygwin, ...

The easiest way probably is just to use w64devkit (https://github.com/skeeto/w64devkit) based on mingw-64.  It includes gcc, g++, gfortran and some other tools, provides a shell, is self-contained, and pretty small.  For installation see https://github.com/skeeto/w64devkit#usage or:

  1. Download a release from https://github.com/skeeto/w64devkit/releases/tag/v1.21.0
    • w64devkit-1.21.0.zip contains gcc and g++
    • w64devkit-fortran-1.21.0.zip contains gcc, g++, and gfortran
  2. Extract it
  3. Run w64devkit.exe, which opens a console where gcc, g++, etc. is available
    • You might have to unblock the file in the file's property dialog, if MS Defender does not let you execute it.
  4. Edit your files with the editor of you choice (w64devkit also includes vim)
  5. In the shell navigate to the corresponding directory and compile your sources with gcc, g++, or gfortran

Last modified: Monday, 4 March 2024, 10:54 AM