This document is intended to help the user install MSYS and start using it.

INSTALLATION

  1. Download: MSYS releases
  2. Double-click the executable
    1. Click Next
    2. Enter c:\slosh-msys
    3. Enter SLOSH-MSYS
    4. Wait for the installation
    5. Click Finish (Don’t run MSYS2 now)
  3. Choose an environment
    For more see: MSYS-environment

    Name Prefix Tool chain Architecture C-lib C++-lib
    MSYS /usr gcc x86_64 cygwin libstdc++
    UCRT64 /ucrt64 gcc x86_64 ucrt libstdc++
    CLANG64 /clang64 llvm x86_64 ucrt libc++
    CLANGARM64 /clangarm64 llvm aarch64 ucrt libc++
    CLANG32 /clang32 llvm i686 ucrt libc++
    MINGW64 /mingw64 gcc x86_64 msvcrt libstdc++
    MINGW32 /mingw32 gcc i686 msvcrt libstdc++
    • This document assumes you picked UCRT64.
    • Note CLANG: llvm lacks features compared to gcc.
    • Note MINGW: msvcrt is stuck in the past (backward compatibility) so is not c99 compatible.
  4. Create taskbar icon
    1. Browse for c:\slosh-msys\ucrt64.exe
    2. Double-click
    3. Pin it to the taskbar

PACKAGE MANAGEMENT

MSYS uses ‘pacman’ for its package management. Some key commands are:

INITIAL UPDATE

After an initial install, you must update the package database, update the base packages, and install extra packages required by the SLOSH model.

  1. Update package database:

     pacman -Syu
     # Prompt: Proceed with installation? [Y/n] Y
     # Prompt: To complete ... terminal closed ... Confirm? [Y/n] Y
    

    Restart the terminal.

  2. Update the base packages:

     pacman -Su
     # Prompt: Proceed with installation? [Y/n] Y
    
  3. Install required packages:

     pacman -S --needed diffutils git make vim man
     # Prompt: Proceed with installation? [Y/n] Y
    

CONFIGURATION FILES

Beyond installing basic packages, updating your configuration files will significantly improve your MSYS experience. The steps below update .vimrc, .bash_profile, .bashrc, and .minttyrc to enhance Vim, Bash, and the terminal.

  1. Minimal ~/.vimrc

     vim ~/.vimrc
    

    Enter the following vimrc

  2. Minimal ~/.bash_profile and ~/.bashrc

     mv ~/.bash_profile bash_profile-orig
     vim ~/.bash_profile
    

    Enter the following bash_profile

     mv ~/.bashrc bashrc-orig
     vim ~/.bashrc
    

    Enter the following bashrc

  3. Minimal ~/.minttyrc

     vim ~/.minttyrc
    

    Enter the following minttyrc

  4. Capture the PATH It is useful to know the MS-Windows path to the home directory in case there are multiple versions of MSYS on a system. It can also come in handy for determining how long ago you installed this version of MSYS.

     a=$(cygpath -m ~) ; d=${a:0:1} ; echo "/${d,,}${a:2}" > ~/PATH
    
  5. Close and open To have the configuration files go into effect, it is recommended to close your MSYS prompt and re-open it now.