MSYS2 / mingw-w64-x86_64

MSYS2 introduction
MSYS2 Wiki

MSYS2 vs. MinGw64

MSYS vs. MinGW: internal environment variables

$ uname
MSYS_NT-10.0

$ uname
MINGW64_NT-10.0

Pin to Taskbar

$ pacman -S msys2-launcher

$ pacman -Qi msys2-launcher
Name            : msys2-launcher-git
Version         : 0.3.32.56c2ba7-2
Description     : Helper for launching MSYS2 shells
Architecture    : x86_64
URL             : None
Licenses        : MIT
Groups          : base
Provides        : msys2-launcher
Depends On      : mintty>=1~2.2.1
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : msys2-launcher
Replaces        : None
Installed Size  : 157.00 KiB
Packager        : Alexey Pavlov <alexpux@gmail.com>
Build Date      : Wed, Sep 7, 2016 7:59:07 PM
Install Date    : Thu, Apr 18, 2019 9:46:39 PM
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

$ pacman -Ql msys2-launcher
msys2-launcher-git /mingw32.exe
msys2-launcher-git /mingw32.ini
msys2-launcher-git /mingw64.exe
msys2-launcher-git /mingw64.ini
msys2-launcher-git /msys2.exe
msys2-launcher-git /msys2.ini

Update

MinGW coding under Windows (C, C++, OpenMP, MPI)
openFrameworks: msys2

$ pacman -Syu
$ pacman -Su
$ pacman -S base-devel
$ pacman -S mingw-w64-x86_64-toolchain
$ pacman -S git

arm-none-eabi

mingw-w64-arm-none-eabi-newlib
MINGW-packages wiki
MSYS2-packages

arm-none-eabi GCC toolchain

$ git clone https://github.com/Alexpux/MINGW-packages.git
$ cd ~/MINGW-packages/mingw-w64-arm-none-eabi-binutils/
$ MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
$ pacman -U mingw-w64-x86_64-arm-none-eabi-binutils-2.24-1-any.pkg.tar.xz

$ cd ~/MINGW-packages/mingw-w64-arm-none-eabi-gcc/
$ MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
==> Making package: mingw-w64-gcc 4.8.4-1 (Sun, Mar  5, 2017  9:50:40 AM)
==> Checking runtime dependencies...
==> Installing missing dependencies...
error: target not found: mingw-w64-x86_64-arm-none-eabi-newlib
==> ERROR: 'pacman' failed to install missing dependencies.

$ cd ~/MINGW-packages/mingw-w64-arm-none-eabi-newlib/
$ MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
==> Making package: mingw-w64-newlib 2.1.0-1 (Sun, Mar  5, 2017  9:51:25 AM)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
[...]
/bin/sh ../../gcc/gcc/../move-if-change tmp-mlib.h multilib.h
echo timestamp > s-mlib
rm cpp.pod gcov.pod fsf-funding.pod gfdl.pod
make[1]: Leaving directory '/home/bachman0/MINGW-packages/mingw-w64-arm-none-eabi-newlib/src/build-gcc-x86_64-w64-mingw32/gcc'
make: *** [Makefile:3892: all-gcc] Error 2
==> ERROR: A failure occurred in prepare().
    Aborting...

List of files installed by a package

$ pacman -Ql mingw-w64-x86_64-arm-none-eabi-binutils
[...]
mingw-w64-x86_64-arm-none-eabi-binutils /mingw64/bin/arm-none-eabi-addr2line.exe
mingw-w64-x86_64-arm-none-eabi-binutils /mingw64/bin/arm-none-eabi-ar.exe
mingw-w64-x86_64-arm-none-eabi-binutils /mingw64/bin/arm-none-eabi-as.exe
mingw-w64-x86_64-arm-none-eabi-binutils /mingw64/bin/arm-none-eabi-ld.exe
mingw-w64-x86_64-arm-none-eabi-binutils /mingw64/bin/arm-none-eabi-objcopy.exe
mingw-w64-x86_64-arm-none-eabi-binutils /mingw64/bin/arm-none-eabi-objdump.exe
mingw-w64-x86_64-arm-none-eabi-binutils /mingw64/bin/arm-none-eabi-readelf.exe
mingw-w64-x86_64-arm-none-eabi-binutils /mingw64/bin/arm-none-eabi-strip.exe
[...]

MSYS2 consists of three subsystems and their corresponding package repositories, msys2, mingw32, and mingw64.

The mingw subsystems provide native Windows programs and are the main focus of the project. These programs are built to co-operate well with other Windows programs, independently of the other subsystems.

The msys2 subsystem provides an emulated mostly-POSIX-compliant environment for building software, package management, and shell scripting. These programs live in a virtual single-root filesystem (the root is the MSYS2 installation directory). Some effort is made to have the programs work well with native Windows programs, but it’s not seamless.

Each of the subsystems provides its own native (i.e. target=host) compiler toolchain, in msys2-devel, mingw-w64-i686-toolchain, and mingw-w64-x86_64-toolchain. There are also cross compiler toolchains with host={i686,x86_64}-pc-msys and target={i686,x86_64}-w64-mingw32 in mingw-w64-cross-toolchain, but these are of limited use because there are no library packages for them.

Every subsystem has an associated “shell”, which is essentially a set of environment variables that allow the subsystems to co-operate properly. These shells can be invoked using scripts in the MSYS2 installation directory or shortcuts in the Start menu. The scripts set the MSYSTEM variable and start a terminal emulator with bash. Bash in turn sources /etc/profile which sets the environment depending on the value of MSYSTEM.

Update MSYS2

ssh not finding ssh config or IdentityFile

$ pacman -Sy
:: Synchronisiere Paketdatenbanken...
 mingw32                  291,3 KiB   867K/s 00:00 [#####################] 100%
 mingw32.sig               96,0   B  0,00B/s 00:00 [#####################] 100%
 mingw64                  290,9 KiB  1672K/s 00:00 [#####################] 100%
 mingw64.sig               96,0   B  0,00B/s 00:00 [#####################] 100%
 msys                     135,6 KiB  11,0M/s 00:00 [#####################] 100%
 msys.sig                  96,0   B  0,00B/s 00:00 [#####################] 100%

$ pacman --needed -S bash pacman msys2-runtime
(1/3) Aktualisiere msys2-runtime                   [#####################] 100%
(2/3) Aktualisiere bash                            [#####################] 100%
(3/3) Aktualisiere pacman                          [#####################] 100%

$ exit

$ pacman -Su
:: Starting core system upgrade...
[...]
      WARNING: the shell starting scripts have been unified. Please update your
      shortcuts to the following targets, otherwise they will STOP WORKING:

          * MSYS2_ROOT\msys2_shell.cmd -mingw32
          * MSYS2_ROOT\msys2_shell.cmd -mingw64
          * MSYS2_ROOT\msys2_shell.cmd -msys
[...]

$ exit
Update Links => .bat to .cmd

$ pacman -S openssh
$ pacman -S git

$ pacman -h -S
Verwendung:  pacman {-S --sync} [Optionen] [Paket(e)]
Optionen:
  -b, --dbpath <Pfad>  Setzt einen anderen Ort für die Datenbank
  -c, --clean          Entfernt alte Pakete aus dem Paketpuffer (-cc für alle)
  -d, --nodeps         Überspringt die Versionsüberprüfungen für Abhängigkeiten (-dd um alle Überprüfungen zu überspringen)
  -g, --groups         Zeigt alle Mitglieder einer Paket-Gruppe an
                       (-gg um alle Gruppen samt Mitgliedern anzuzeigen)
  -i, --info           Zeigt Paketinformationen an (-ii für erweiterte Informationen)
  -l, --list <repo>    Zeigt eine Liste aller Pakete eines Repositoriums an
  -p, --print          Zeigt die Ziele an, statt die Operation auszuführen
  -q, --quiet          Zeigt weniger Information bei Abfragen und Suche an
  -r, --root <Pfad>    Setzt ein alternatives Wurzelverzeichnis zur Installation
  -s, --search <regex> Durchsucht entfernte Repositorien nach einem Wort
  -u, --sysupgrade     Aktualisiert installierte Pakete (-uu ermöglicht Downgrades)
  -v, --verbose        Sei gesprächig
  -w, --downloadonly   Lädt Pakete herunter, ohne etwas zu installieren oder aktualisieren
  -y, --refresh        Lädt aktuelle Paketdatenbanken vom Server herunter
                       (-yy um eine Aktualisierung auch bei aktuellen Datenbanken durchzuführen)
      --arch <arch>    Setzt eine alternative Architektur
      --asdeps         Installiert Pakete als nicht-ausdrücklich installiert
      --asexplicit     Installiert Pakete als ausdrücklich installiert
      --assume-installed <package=version>
                       Fügt ein virtuelles Paket hinzu, um Abhängigkeiten zu erfüllen
      --cachedir <Verzeichnis>  Setzt einen anderen Ort für den Paketpuffer
      --color <wann>   Ausgabe farbig darstellen
      --config <Pfad>  Setzt eine alternative Konfigurationsdatei
      --confirm        Immer nach einer Bestätigung fragen
      --dbonly         Verändert nur Datenbank-Einträge, keine Paketdateien
      --debug          Zeigt Debug-Meldungen an
      --force          Installation erzwingen, Dateikonflikte überschreiben
      --gpgdir <path>  Setzt alternatives Konfigurationsverzeichnis für GnuPG
--hookdir <dir> setze ein anderes Hook-Verzeichnis
      --ignore <pkg>   Ignoriert ein neues Paket (kann mehrfach genutzt werden)
      --ignoregroup <grp>
                       Ignoriert Upgrade einer Gruppe (kann mehrfach genutzt werden)
      --logfile <Pfad> Setzt eine alternative Log-Datei
      --needed         Installiert aktuelle Pakete nicht erneut
      --noconfirm      Niemals nach einer Bestätigung fragen
      --noprogressbar  Keine Fortschrittsanzeige anzeigen, wenn Dateien heruntergeladen werden
      --noscriptlet    Installationsskript nicht ausführen, falls vorhanden
      --print-format <string>
                       Legt fest, wie die Ziele ausgegeben werden sollen

C:\msys64\msys2_shell.bat’ is not recognized as an internal or external command

Current installer/installation instructions are broken
==> update links. Don’t use msys2_shell.bat but msys2_shell.cmd

Install Python NumPy

Practical Computing for Biologists – Setting up Windows and Linux

# download MSYS2 (Arch Linux)
https://msys2.github.io/
# Choose the version that says x86_64, not i686
 
# Update system
pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime
 
# Restart MSYS 
# (Close all windows and reopen from start menu)
# All Programs > MSYS2 64-bit > MSYS Shell
 
pacman -Su
 
# You might get some errors. If so, just run the command again and it should pick up the slack.
 
#install python and other utilities
# REQUIRED
pacman --noconfirm -S  gcc python2 man nano sqlite vim git bc tar 
 
# This can take a while to download
 
# Note: To search for other package locations, use
 
    pacman -Ss <package_name>
 
Then to install, copy the name (before the version number) after a pacman -Sy command...
 
 
# issues: sudo and screen not there in default pacman...
 
# NEXT you should do these commands:
cd /usr/bin
ln -sf python2 python
cd
 
# Then install pip using these steps:
 
mkdir ~/scripts
cd ~/scripts
curl -O 'https://bootstrap.pypa.io/get-pip.py'
./get-pip.py
 
# If that succeeds (which pip should now find something)
then..
 
  rm get-pip.py
 
# Now to use the installer for grabbing python packages like numpy, Biopython, and beautifulSoup:
 
   pip install numpy
 
##########################
Working in MSYS2
 
Your home directory, as we refer to it in the book, will be /home/lucy in the terminal window, but it lives in the c:\msys32 (or msys64) folder. You could make a shortcut from the folder here with our username to the Windows desktop for easy cross-platform access.
 
# MSYS2 starts with an annoying multi-line prompt, so edit your .bash_profile using this command
 
    nano ~/.bash_profile
 
# Note that <ctrl>C will not work for copying in the terminal, because it has another function.
# Right click to copy/paste from the pop-up menu
 
# Add the following four lines to your .bash_profile
 
PS1='\[\e[1;32m\]\u:\[\e[1;36m\]\w \$ \e[0m'
export PATH=$PATH:$HOME/scripts
export EDITOR=/usr/bin/nano
set -o noclobber
 
################################
 
Next, in Windows, install the GUI
Install <a href="http://www.sublimetext.com/3">Sublime Text 3</a>
 
After installation, Change color scheme to iPlastic
 
To get the command-line option (so you can edit files from the terminal by typing 'subl' google the page about changing your System Path to work with Sublime Text 3.
##############################

Difference between native python and mingw-w64 python.
Numpy Mingw w64 FAQ
Anaconda – open data science platform
Conda – open source package management system

Install mingw-w64-x86_64 packages

$ pacman -S mingw-w64-x86_64-python3
[...]
(24/24) checking for file conflicts                                                                                 [####################################################################] 100%
error: failed to commit transaction (conflicting files)
mingw-w64-x86_64-gmp: /mingw64 exists in filesystem
[...]

Msys2 + Windows 10 + pacman errors

$ mkdir /mingw64

Change language

$ export LC_ALL=en_US.UTF-8

No C Compiler installed

$ python3 setup.py install
running install
running build
running build_py
creating build
creating build/lib.mingw-3.5
creating build/lib.mingw-3.5/bigfloat
copying bigfloat/context.py -> build/lib.mingw-3.5/bigfloat
copying bigfloat/core.py -> build/lib.mingw-3.5/bigfloat
copying bigfloat/ieee.py -> build/lib.mingw-3.5/bigfloat
copying bigfloat/rounding_mode.py -> build/lib.mingw-3.5/bigfloat
copying bigfloat/__init__.py -> build/lib.mingw-3.5/bigfloat
creating build/lib.mingw-3.5/bigfloat/test
copying bigfloat/test/test_bigfloat.py -> build/lib.mingw-3.5/bigfloat/test
copying bigfloat/test/test_context.py -> build/lib.mingw-3.5/bigfloat/test
copying bigfloat/test/test_mpfr.py -> build/lib.mingw-3.5/bigfloat/test
copying bigfloat/test/test_rounding_mode.py -> build/lib.mingw-3.5/bigfloat/test
copying bigfloat/test/test___all__.py -> build/lib.mingw-3.5/bigfloat/test
copying bigfloat/test/__init__.py -> build/lib.mingw-3.5/bigfloat/test
running build_ext
Traceback (most recent call last):
  File "setup.py", line 267, in <module>
    'bigfloat.test',
  File "C:/msys64/mingw64/lib/python3.5\distutils\core.py", line 148, in setup
    dist.run_commands()
  [...]
  File "C:/msys64/mingw64/lib/python3.5\distutils\ccompiler.py", line 1033, in new_compiler
    return klass(None, dry_run, force)
  File "C:/msys64/mingw64/lib/python3.5\distutils\cygwinccompiler.py", line 288, in __init__
    CygwinCCompiler.__init__ (self, verbose, dry_run, force)
  File "C:/msys64/mingw64/lib/python3.5\distutils\cygwinccompiler.py", line 127, in __init__
    if self.ld_version >= "2.10.90":
TypeError: unorderable types: NoneType() >= str()

$ pacman -S mingw-w64-x86_64-gcc

$ python3 setup.py install
running install
running build
running build_py
running build_ext
building 'mpfr' extension
creating build/temp.mingw-3.5
C:\msys64\mingw64\bin/x86_64-w64-mingw32-gcc.exe -Wno-unused-result -Wsign-compare -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -DNDEBUG -IC:/msys64/mingw64/include/python3.5m -c mpfr.c -o build/temp.mingw-3.5/mpfr.o
[...]
Writing C:/msys64/mingw64/lib/python3.5/site-packages/bigfloat-0.3.0-py3.5.egg-info

pacman install build system for mingw-w64-x86_64

$ pacman -S mingw-w64-x86_64-gcc
$ pacman -S mingw-w64-x86_64-gdb

pacman query

How can I show the list of all installed packages in Arch Linux (pacman packet manager)?

       -Q, --query
           Query the package database.
           This operation allows you to view installed packages
           and their files, as well as meta-information about
           individual packages
       -i, --info
           Display information on a given package. 
       -s, --search <regexp>
           Search each locally-installed package for names or
           descriptions that match regexp.
$ pacman -Qi mingw-w64-x86_64-python3
Name                     : mingw-w64-x86_64-python3
Version                  : 3.5.2-2

$ pacman -Qs python
local/mingw-w64-x86_64-python3 3.5.2-2
    A high-level scripting language (mingw-w64)
local/mingw-w64-x86_64-python3-cairo 1.10.0-5
    Python2 bindings for the cairo graphics library (mingw-w64)
local/mingw-w64-x86_64-python3-cycler 0.9.0-1
    Composable style cycles

[...]
$ pacman -Ss xpdf
mingw32/mingw-w64-i686-poppler 0.76.1-1
    PDF rendering library based on xpdf 3.0 (mingw-w64)
mingw32/mingw-w64-i686-xpdf 4.00-1
    Utilities for PDF files (mingw-w64)
mingw64/mingw-w64-x86_64-poppler 0.76.1-1
    PDF rendering library based on xpdf 3.0 (mingw-w64)
mingw64/mingw-w64-x86_64-xpdf 4.00-1
    Utilities for PDF files (mingw-w64)
[...]
$ pacsearch python2
$ pacman -R mingw-w64-x86_64-arm-none-eabi-binutils

Leave a Reply

Your email address will not be published. Required fields are marked *