MinGW has been bringing GNU compiler tools to Windows since the late 1990s.
MSYS2 provides a superset of tools including MinGW, with more complete and up to date GNU compiler set, using
pacman package manager.
- download msys2-x86_64-*.exe
- run the installer, installing to c:/msys64. It needs to be on a non-FAT/ExFAT drive, such as c:.
- To run, start the MSYS2 console in the Windows Start menu, which sets up all the needed paths, just for that terminal session.
do an update to get the latest packages, in the MSYS2 terminal. Run this command multiple times until it says “nothing to do”.
To use MSYS2 / MinGW64 programs from regular command prompts, add MinGW64 to Windows PATH, typically
From MSYS2 command prompt, tasks include:
Search for packages:
pacman -Ss gcc
Install MinGW packages
pacman -S mingw64/mingw-w64-x86_64-gcc
pacman -S mingw64/mingw-w64-x86_64-gcc-fortran
pacman -S mingw64/mingw-w64-x86_64-hdf5
pacman -S mingw64/mingw-w64-x86_64-ninja
pacman -S mingw64/mingw-w64-x86_64-make
pacman -S mingw64/mingw-w64-x86_64-pkg-config
pacman -S mingw64/mingw-w64-x86_64-aspell mingw64/mingw-w64-x86_64-aspell-en
If you have confusion about why another version of a program is being used, check executable location like:
You may need to reorder directories in your Windows Path variable, for example GNU Octave may need to be moved lower in the Path list.
When packages are installed in MinGW64, you must run from from MSYS2 MinGW64 terminal, or have added MSYS2 MinGW64 to your Command Prompt Path (in step 5 above).
- MSYS2 Install reference