Install GCC, GFortran, CMake and Make on Windows

Alternative: Install Windows Subsystem for Linux

Sometimes you don’t want to cross-compile for Windows from Linux or Cygwin, but want the convenience of the GNU toolset directly on Windows–here’s how to install it.

  1. install MinGW-W64 compiler (GCC, GFortran) with Architecture: x86_64, Threads: posix, Exception: seh. NOTE: This also installs make under the bin\ directory as mingw32-make.exe.
  2. For convenience, symlink make to mingw32-make from the bin\ directory

     mklink make.exe mingw32-make.exe
  3. install CMake

Using CMake on Windows

assuming you want your binaries put into bin\:

cd bin\
cmake -G "MinGW Makefiles" ..

Note that on Windows, CMake defaults “make” to Visual Studio and Nmake. The cmake options above for Windows direct the build to MinGW.



Leave a Comment