2  Installing gfortran

TRIGRS is written in Fortran and distributed as source code — so the first step is to install a compiler. We will use gfortran (free, part of GCC).

2.1 Download and install

  1. Download the 64-bit installer from https://www.equation.com/servlet/equation.cmd?fa=fortran (e.g., gcc-14.2.0-64.exe).
  2. Run the installer and accept the suggested default location (e.g., C:\Users\YOUR_USER\gcc). The installer adds the compiler to the Windows PATH automatically.

2.2 Check the installation

Close any open PowerShell window, open a new one, and type:

gfortran --version

The expected response is something like:

GNU Fortran (GCC) 14.2.0
WarningIf the command is not recognized

The PATH is only updated in new PowerShell windows. If it still does not work in a new window, check that the installation’s bin folder (e.g., C:\Users\YOUR_USER\gcc\bin) is in the PATH environment variable (Settings → System → Environment Variables).

2.3 Why not use the ready-made USGS executables?

The USGS distributes Windows binaries (TRIGRS_2.1_Win64.zip), but they were compiled under Cygwin and depend on the cygwin1.dll library. On a machine without Cygwin the program does not open and shows no error at all — Windows silently returns the code 0xC0000135 (DLL not found). This was exactly the problem that stalled our first attempts. By compiling it ourselves with the -static option (next chapter), the executable becomes self-contained and runs on any 64-bit Windows machine.