Install GCC, GFortran, CMake and Make on Windows

less than 1 minute read

Alternative: Install Windows Subsystem for Linux


The GNU compilers, make and Cmake are easily available for native Windows, as follows:

  1. Download MinGW-w64 compiler (gcc, g++ gfortran)
  2. Install it to C:\mingw using: Architecture: x86_64, Threads: posix, Exception: seh. This also installs make under the bin\ directory as mingw32-make.exe.
  3. For convenience, symlink make to mingw32-make:
    cd C:\mingw\bin
            
    mklink make.exe mingw32-make.exe
    
  4. install CMake

Using CMake on Windows

assuming you want your binaries put into bin\:

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

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

Notes

  • https://sourceforge.net/p/mingw-w64/wiki2/NCurses/

Leave a Comment