To install a Fortran compiler (gFortran) to be used within the Code::Blocks IDE editor:

  1. Go to
  2. Click on “Download the binary release”
  3. Click on “Windows 2000/XP/Vista/7//8”
  4. Click on “codeblocks-13.12mingw-setup.exe” to download from
  5. Once downloaded (~100MB), install Code::Blocks IDE
    • Full installation
    • Destination “Program Files\CodeBlocks”
    • “Do you want to run CodeBlocks now?” NO
  6. Start Code::Blocks from the shortcut on Desktop (or find in programs)
  7. When the IDE opens, go to “Settings” > “Compiler…”
  8. From the “Selected Compiler” option, select the “GNU Fortran Compiler” from the list
  9. From below, select “Toolchain executables” TAB
  10. Now check that the “Compilers installation directory” is set to the MinGW folder within Codeblocks
    [bash]c:\Program Files\CodeBlocks\MinGW[/bash]
  11. Click Ok to close the options dialog, close Code::Blocks and re-open
  12. You should now be able to create and compile Fortran sources

Create a simple program (try .f90 or .f95 or .f) and compile:

[cpp]program test
do i=1,5
print*, ‘Hello Fortran’
end do
end program[/cpp]