{"id":5035,"date":"2016-08-19T09:17:59","date_gmt":"2016-08-19T09:17:59","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=5035"},"modified":"2021-05-12T16:16:34","modified_gmt":"2021-05-12T16:16:34","slug":"msys2","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=5035","title":{"rendered":"MSYS2 \/ mingw-w64-x86_64"},"content":{"rendered":"<p><a href=\"https:\/\/sourceforge.net\/p\/msys2\/wiki\/MSYS2%20introduction\/\">MSYS2 introduction<\/a><br \/>\n<a href=\"https:\/\/github.com\/msys2\/msys2\/wiki\">MSYS2 Wiki<\/a><\/p>\n<h3>MSYS2 vs. MinGw64<\/h3>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/37460073\/msys-vs-mingw-internal-environment-variables\">MSYS vs. MinGW: internal environment variables<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ uname\r\nMSYS_NT-10.0\r\n\r\n$ uname\r\nMINGW64_NT-10.0\r\n<\/pre>\n<h3>Package Manager<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ pacman -Q\r\n&lt;list all packages&gt;\r\n\r\n$ pacman -Qi &lt;package&gt;\r\n&lt;info about a single package&gt;\r\n\r\n$ pacman -Ql &lt;package&gt;\r\n&lt;files of a single package&gt;\r\n<\/pre>\n<h3>Pin to Taskbar<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ pacman -S msys2-launcher\r\n\r\n$ pacman -Qi msys2-launcher\r\nName            : msys2-launcher-git\r\nVersion         : 0.3.32.56c2ba7-2\r\nDescription     : Helper for launching MSYS2 shells\r\nArchitecture    : x86_64\r\nURL             : None\r\nLicenses        : MIT\r\nGroups          : base\r\nProvides        : msys2-launcher\r\nDepends On      : mintty&gt;=1~2.2.1\r\nOptional Deps   : None\r\nRequired By     : None\r\nOptional For    : None\r\nConflicts With  : msys2-launcher\r\nReplaces        : None\r\nInstalled Size  : 157.00 KiB\r\nPackager        : Alexey Pavlov &lt;alexpux@gmail.com&gt;\r\nBuild Date      : Wed, Sep 7, 2016 7:59:07 PM\r\nInstall Date    : Thu, Apr 18, 2019 9:46:39 PM\r\nInstall Reason  : Explicitly installed\r\nInstall Script  : No\r\nValidated By    : Signature\r\n\r\n$ pacman -Ql msys2-launcher\r\nmsys2-launcher-git \/mingw32.exe\r\nmsys2-launcher-git \/mingw32.ini\r\nmsys2-launcher-git \/mingw64.exe\r\nmsys2-launcher-git \/mingw64.ini\r\nmsys2-launcher-git \/msys2.exe\r\nmsys2-launcher-git \/msys2.ini\r\n<\/pre>\n<h3>Update<\/h3>\n<p><a href=\"http:\/\/www.math.ucla.edu\/~wotaoyin\/windows_coding.html\">MinGW coding under Windows (C, C++, OpenMP, MPI)<\/a><br \/>\n<a href=\"http:\/\/openframeworks.cc\/setup\/msys2\/\">openFrameworks: msys2<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ pacman -Syu\r\n$ pacman -Su\r\n$ pacman -S base-devel\r\n$ pacman -S mingw-w64-x86_64-toolchain\r\n$ pacman -S git\r\n<\/pre>\n<h3>fwrite()<\/h3>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/61678806\/fwrite-c-function-writing-extra-bytes\">fwrite() c function writing extra bytes<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/43777913\/the-difference-in-file-access-mode-w-and-wb\">The difference in File access mode &#8220;w&#8221; and &#8220;wb&#8221;<\/a><\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/\/ linux doesn't care... but windows does!\r\n\r\nFILE *fp = fopen(filename, &quot;w&quot;); \/\/ text mode\r\n\/\/ if streams includes 0x0A (\\n) it prepends it with 0x0D (\\r)\r\n\r\nFILE *fp = fopen(filename, &quot;wb&quot;); \/\/ binary mode\r\n<\/pre>\n<h3>Keyring<\/h3>\n<p><a href=\"https:\/\/www.msys2.org\/news\/#2020-06-29-new-packages\">2020-06-29 &#8211; new packagers<\/a><\/p>\n<h4>Problem<\/h4>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ pacman -Syu\r\n:: Synchronizing package databases...\r\n mingw32 \r\n mingw32.sig\r\nerror: mingw32: key &quot;5F944B027F7FE2091985AA2EFA11531AA0AA7F57&quot; is unknown\r\nerror: key &quot;5F944B027F7FE2091985AA2EFA11531AA0AA7F57&quot; could not be looked up remotely\r\nerror: failed to update mingw32 (invalid or corrupted database (PGP signature))\r\n mingw64\r\n mingw64.sig\r\nerror: mingw64: key &quot;5F944B027F7FE2091985AA2EFA11531AA0AA7F57&quot; is unknown\r\nerror: key &quot;5F944B027F7FE2091985AA2EFA11531AA0AA7F57&quot; could not be looked up remotely\r\nerror: failed to update mingw64 (invalid or corrupted database (PGP signature))\r\n msys\r\n msys.sig\r\nerror: msys: key &quot;5F944B027F7FE2091985AA2EFA11531AA0AA7F57&quot; is unknown\r\nerror: key &quot;5F944B027F7FE2091985AA2EFA11531AA0AA7F57&quot; could not be looked up remotely\r\nerror: failed to update msys (invalid or corrupted database (PGP signature))\r\nerror: failed to synchronize all databases\r\n<\/pre>\n<h4>Solution<\/h4>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# rm -r \/etc\/pacman.d\/gnupg\/\r\n# pacman-key --init\r\n# pacman-key --populate msys2\r\n\r\n$ curl -O http:\/\/repo.msys2.org\/msys\/x86_64\/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz\r\n$ curl -O http:\/\/repo.msys2.org\/msys\/x86_64\/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig\r\n\r\n# pacman -U --config &lt;(echo) msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz\r\n\r\n$ pacman -Syu\r\n:: Synchronizing package databases...\r\n mingw32 is up to date\r\n mingw64 is up to date\r\n msys is up to date\r\n:: Starting core system upgrade...\r\n&#x5B;...]\r\n<\/pre>\n<h3>arm-none-eabi<\/h3>\n<p><a href=\"https:\/\/github.com\/Alexpux\/MINGW-packages\/tree\/master\/mingw-w64-arm-none-eabi-newlib\">mingw-w64-arm-none-eabi-newlib<\/a><br \/>\n<a href=\"https:\/\/github.com\/Alexpux\/MINGW-packages\/wiki\">MINGW-packages wiki<\/a><br \/>\n<a href=\"https:\/\/github.com\/Alexpux\/MSYS2-packages\">MSYS2-packages<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/Alexpux\/MINGW-packages\/issues\/842\">arm-none-eabi GCC toolchain<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ git clone https:\/\/github.com\/Alexpux\/MINGW-packages.git\r\n$ cd ~\/MINGW-packages\/mingw-w64-arm-none-eabi-binutils\/\r\n$ MINGW_INSTALLS=mingw64 makepkg-mingw -sLf\r\n$ pacman -U mingw-w64-x86_64-arm-none-eabi-binutils-2.24-1-any.pkg.tar.xz\r\n\r\n$ cd ~\/MINGW-packages\/mingw-w64-arm-none-eabi-gcc\/\r\n$ MINGW_INSTALLS=mingw64 makepkg-mingw -sLf\r\n==&gt; Making package: mingw-w64-gcc 4.8.4-1 (Sun, Mar  5, 2017  9:50:40 AM)\r\n==&gt; Checking runtime dependencies...\r\n==&gt; Installing missing dependencies...\r\nerror: target not found: mingw-w64-x86_64-arm-none-eabi-newlib\r\n==&gt; ERROR: 'pacman' failed to install missing dependencies.\r\n\r\n$ cd ~\/MINGW-packages\/mingw-w64-arm-none-eabi-newlib\/\r\n$ MINGW_INSTALLS=mingw64 makepkg-mingw -sLf\r\n==&gt; Making package: mingw-w64-newlib 2.1.0-1 (Sun, Mar  5, 2017  9:51:25 AM)\r\n==&gt; Checking runtime dependencies...\r\n==&gt; Checking buildtime dependencies...\r\n==&gt; Retrieving sources...\r\n&#x5B;...]\r\n\/bin\/sh ..\/..\/gcc\/gcc\/..\/move-if-change tmp-mlib.h multilib.h\r\necho timestamp &gt; s-mlib\r\nrm cpp.pod gcov.pod fsf-funding.pod gfdl.pod\r\nmake&#x5B;1]: Leaving directory '\/home\/bachman0\/MINGW-packages\/mingw-w64-arm-none-eabi-newlib\/src\/build-gcc-x86_64-w64-mingw32\/gcc'\r\nmake: *** &#x5B;Makefile:3892: all-gcc] Error 2\r\n==&gt; ERROR: A failure occurred in prepare().\r\n    Aborting...\r\n<\/pre>\n<h3>List of files installed by a package<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ pacman -Ql mingw-w64-x86_64-arm-none-eabi-binutils\r\n&#x5B;...]\r\nmingw-w64-x86_64-arm-none-eabi-binutils \/mingw64\/bin\/arm-none-eabi-addr2line.exe\r\nmingw-w64-x86_64-arm-none-eabi-binutils \/mingw64\/bin\/arm-none-eabi-ar.exe\r\nmingw-w64-x86_64-arm-none-eabi-binutils \/mingw64\/bin\/arm-none-eabi-as.exe\r\nmingw-w64-x86_64-arm-none-eabi-binutils \/mingw64\/bin\/arm-none-eabi-ld.exe\r\nmingw-w64-x86_64-arm-none-eabi-binutils \/mingw64\/bin\/arm-none-eabi-objcopy.exe\r\nmingw-w64-x86_64-arm-none-eabi-binutils \/mingw64\/bin\/arm-none-eabi-objdump.exe\r\nmingw-w64-x86_64-arm-none-eabi-binutils \/mingw64\/bin\/arm-none-eabi-readelf.exe\r\nmingw-w64-x86_64-arm-none-eabi-binutils \/mingw64\/bin\/arm-none-eabi-strip.exe\r\n&#x5B;...]\r\n<\/pre>\n<p>MSYS2 consists of three subsystems and their corresponding package repositories, <strong><code>msys2<\/code><\/strong>, <strong><code>mingw32<\/code><\/strong>, and <strong><code>mingw64<\/code><\/strong>.<\/p>\n<p>The <strong><code>mingw<\/code><\/strong> 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.<\/p>\n<p>The <strong><code>msys2<\/code><\/strong> 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&#8217;s not seamless.<\/p>\n<p>Each of the subsystems provides its own native (i.e. target=host) compiler toolchain, in <strong><code>msys2-devel<\/code><\/strong>, <strong><code>mingw-w64-i686-toolchain<\/code><\/strong>, and <strong><code>mingw-w64-x86_64-toolchain<\/code><\/strong>. There are also cross compiler toolchains with <code>host={i686,x86_64}-pc-msys<\/code> and <code>target={i686,x86_64}-w64-mingw32<\/code> in <strong><code>mingw-w64-cross-toolchain<\/code><\/strong>, but these are of limited use because there are no library packages for them.<\/p>\n<p>Every subsystem has an associated &#8220;shell&#8221;, 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 <code>\/etc\/profile<\/code> which sets the environment depending on the value of MSYSTEM.<\/p>\n<h3>Update MSYS2<\/h3>\n<p><a href=\"https:\/\/sourceforge.net\/p\/msys2\/tickets\/111\/\">ssh not finding ssh config or IdentityFile<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ pacman -Sy\r\n:: Synchronisiere Paketdatenbanken...\r\n mingw32                  291,3 KiB   867K\/s 00:00 &#x5B;#####################] 100%\r\n mingw32.sig               96,0   B  0,00B\/s 00:00 &#x5B;#####################] 100%\r\n mingw64                  290,9 KiB  1672K\/s 00:00 &#x5B;#####################] 100%\r\n mingw64.sig               96,0   B  0,00B\/s 00:00 &#x5B;#####################] 100%\r\n msys                     135,6 KiB  11,0M\/s 00:00 &#x5B;#####################] 100%\r\n msys.sig                  96,0   B  0,00B\/s 00:00 &#x5B;#####################] 100%\r\n\r\n$ pacman --needed -S bash pacman msys2-runtime\r\n(1\/3) Aktualisiere msys2-runtime                   &#x5B;#####################] 100%\r\n(2\/3) Aktualisiere bash                            &#x5B;#####################] 100%\r\n(3\/3) Aktualisiere pacman                          &#x5B;#####################] 100%\r\n\r\n$ exit\r\n\r\n$ pacman -Su\r\n:: Starting core system upgrade...\r\n&#x5B;...]\r\n      WARNING: the shell starting scripts have been unified. Please update your\r\n      shortcuts to the following targets, otherwise they will STOP WORKING:\r\n\r\n          * MSYS2_ROOT\\msys2_shell.cmd -mingw32\r\n          * MSYS2_ROOT\\msys2_shell.cmd -mingw64\r\n          * MSYS2_ROOT\\msys2_shell.cmd -msys\r\n&#x5B;...]\r\n\r\n$ exit\r\nUpdate Links =&gt; .bat to .cmd\r\n\r\n$ pacman -S openssh\r\n$ pacman -S git\r\n\r\n$ pacman -h -S\r\nVerwendung:  pacman {-S --sync} &#x5B;Optionen] &#x5B;Paket(e)]\r\nOptionen:\r\n  -b, --dbpath &lt;Pfad&gt;  Setzt einen anderen Ort f\u00fcr die Datenbank\r\n  -c, --clean          Entfernt alte Pakete aus dem Paketpuffer (-cc f\u00fcr alle)\r\n  -d, --nodeps         \u00dcberspringt die Versions\u00fcberpr\u00fcfungen f\u00fcr Abh\u00e4ngigkeiten (-dd um alle \u00dcberpr\u00fcfungen zu \u00fcberspringen)\r\n  -g, --groups         Zeigt alle Mitglieder einer Paket-Gruppe an\r\n                       (-gg um alle Gruppen samt Mitgliedern anzuzeigen)\r\n  -i, --info           Zeigt Paketinformationen an (-ii f\u00fcr erweiterte Informationen)\r\n  -l, --list &lt;repo&gt;    Zeigt eine Liste aller Pakete eines Repositoriums an\r\n  -p, --print          Zeigt die Ziele an, statt die Operation auszuf\u00fchren\r\n  -q, --quiet          Zeigt weniger Information bei Abfragen und Suche an\r\n  -r, --root &lt;Pfad&gt;    Setzt ein alternatives Wurzelverzeichnis zur Installation\r\n  -s, --search &lt;regex&gt; Durchsucht entfernte Repositorien nach einem Wort\r\n  -u, --sysupgrade     Aktualisiert installierte Pakete (-uu erm\u00f6glicht Downgrades)\r\n  -v, --verbose        Sei gespr\u00e4chig\r\n  -w, --downloadonly   L\u00e4dt Pakete herunter, ohne etwas zu installieren oder aktualisieren\r\n  -y, --refresh        L\u00e4dt aktuelle Paketdatenbanken vom Server herunter\r\n                       (-yy um eine Aktualisierung auch bei aktuellen Datenbanken durchzuf\u00fchren)\r\n      --arch &lt;arch&gt;    Setzt eine alternative Architektur\r\n      --asdeps         Installiert Pakete als nicht-ausdr\u00fccklich installiert\r\n      --asexplicit     Installiert Pakete als ausdr\u00fccklich installiert\r\n      --assume-installed &lt;package=version&gt;\r\n                       F\u00fcgt ein virtuelles Paket hinzu, um Abh\u00e4ngigkeiten zu erf\u00fcllen\r\n      --cachedir &lt;Verzeichnis&gt;  Setzt einen anderen Ort f\u00fcr den Paketpuffer\r\n      --color &lt;wann&gt;   Ausgabe farbig darstellen\r\n      --config &lt;Pfad&gt;  Setzt eine alternative Konfigurationsdatei\r\n      --confirm        Immer nach einer Best\u00e4tigung fragen\r\n      --dbonly         Ver\u00e4ndert nur Datenbank-Eintr\u00e4ge, keine Paketdateien\r\n      --debug          Zeigt Debug-Meldungen an\r\n      --force          Installation erzwingen, Dateikonflikte \u00fcberschreiben\r\n      --gpgdir &lt;path&gt;  Setzt alternatives Konfigurationsverzeichnis f\u00fcr GnuPG\r\n--hookdir &lt;dir&gt; setze ein anderes Hook-Verzeichnis\r\n      --ignore &lt;pkg&gt;   Ignoriert ein neues Paket (kann mehrfach genutzt werden)\r\n      --ignoregroup &lt;grp&gt;\r\n                       Ignoriert Upgrade einer Gruppe (kann mehrfach genutzt werden)\r\n      --logfile &lt;Pfad&gt; Setzt eine alternative Log-Datei\r\n      --needed         Installiert aktuelle Pakete nicht erneut\r\n      --noconfirm      Niemals nach einer Best\u00e4tigung fragen\r\n      --noprogressbar  Keine Fortschrittsanzeige anzeigen, wenn Dateien heruntergeladen werden\r\n      --noscriptlet    Installationsskript nicht ausf\u00fchren, falls vorhanden\r\n      --print-format &lt;string&gt;\r\n                       Legt fest, wie die Ziele ausgegeben werden sollen\r\n\r\n<\/pre>\n<h3>C:\\msys64\\msys2_shell.bat&#8217; is not recognized as an internal or external command<\/h3>\n<p><a href=\"https:\/\/github.com\/Alexpux\/MSYS2-packages\/issues\/633\">Current installer\/installation instructions are broken<\/a><br \/>\n==> update links. Don&#8217;t use msys2_shell.bat but msys2_shell.cmd<\/p>\n<h3>Install Python NumPy<\/h3>\n<p><a href=\"http:\/\/practicalcomputing.org\/setup\">Practical Computing for Biologists &#8211; Setting up Windows and Linux<\/a><\/p>\n<pre class=\"brush: plain; title: Doesn&#039;t work! PIP can&#039;t install numpy; notranslate\" title=\"Doesn&#039;t work! PIP can&#039;t install numpy\">\r\n# download MSYS2 (Arch Linux)\r\nhttps:\/\/msys2.github.io\/\r\n# Choose the version that says x86_64, not i686\r\n \r\n# Update system\r\npacman --needed -Sy bash pacman pacman-mirrors msys2-runtime\r\n \r\n# Restart MSYS \r\n# (Close all windows and reopen from start menu)\r\n# All Programs &gt; MSYS2 64-bit &gt; MSYS Shell\r\n \r\npacman -Su\r\n \r\n# You might get some errors. If so, just run the command again and it should pick up the slack.\r\n \r\n#install python and other utilities\r\n# REQUIRED\r\npacman --noconfirm -S  gcc python2 man nano sqlite vim git bc tar \r\n \r\n# This can take a while to download\r\n \r\n# Note: To search for other package locations, use\r\n \r\n    pacman -Ss &lt;package_name&gt;\r\n \r\nThen to install, copy the name (before the version number) after a pacman -Sy command...\r\n \r\n \r\n# issues: sudo and screen not there in default pacman...\r\n \r\n# NEXT you should do these commands:\r\ncd \/usr\/bin\r\nln -sf python2 python\r\ncd\r\n \r\n# Then install pip using these steps:\r\n \r\nmkdir ~\/scripts\r\ncd ~\/scripts\r\ncurl -O 'https:\/\/bootstrap.pypa.io\/get-pip.py'\r\n.\/get-pip.py\r\n \r\n# If that succeeds (which pip should now find something)\r\nthen..\r\n \r\n  rm get-pip.py\r\n \r\n# Now to use the installer for grabbing python packages like numpy, Biopython, and beautifulSoup:\r\n \r\n   pip install numpy\r\n \r\n##########################\r\nWorking in MSYS2\r\n \r\nYour 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.\r\n \r\n# MSYS2 starts with an annoying multi-line prompt, so edit your .bash_profile using this command\r\n \r\n    nano ~\/.bash_profile\r\n \r\n# Note that &lt;ctrl&gt;C will not work for copying in the terminal, because it has another function.\r\n# Right click to copy\/paste from the pop-up menu\r\n \r\n# Add the following four lines to your .bash_profile\r\n \r\nPS1='\\&#x5B;\\e&#x5B;1;32m\\]\\u:\\&#x5B;\\e&#x5B;1;36m\\]\\w \\$ \\e&#x5B;0m'\r\nexport PATH=$PATH:$HOME\/scripts\r\nexport EDITOR=\/usr\/bin\/nano\r\nset -o noclobber\r\n \r\n################################\r\n \r\nNext, in Windows, install the GUI\r\nInstall &lt;a href=&quot;http:\/\/www.sublimetext.com\/3&quot;&gt;Sublime Text 3&lt;\/a&gt;\r\n \r\nAfter installation, Change color scheme to iPlastic\r\n \r\nTo 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.\r\n##############################\r\n<\/pre>\n<p><a href=\"https:\/\/github.com\/Alexpux\/MINGW-packages\/issues\/470\">Difference between native python and mingw-w64 python.<\/a><br \/>\n<a href=\"https:\/\/github.com\/numpy\/numpy\/wiki\/Mingw-w64-faq\">Numpy Mingw w64 FAQ<\/a><br \/>\n<a href=\"https:\/\/www.continuum.io\/downloads\">Anaconda &#8211; open data science platform<\/a><br \/>\n<a href=\"http:\/\/conda.pydata.org\/docs\/\">Conda &#8211; open source package management system<\/a><\/p>\n<h3>Install mingw-w64-x86_64 packages<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ pacman -S mingw-w64-x86_64-python3\r\n&#x5B;...]\r\n(24\/24) checking for file conflicts                                                                                 &#x5B;####################################################################] 100%\r\nerror: failed to commit transaction (conflicting files)\r\nmingw-w64-x86_64-gmp: \/mingw64 exists in filesystem\r\n&#x5B;...]\r\n<\/pre>\n<p><a href=\"https:\/\/sourceforge.net\/p\/msys2\/mailman\/message\/35398330\/\">Msys2 + Windows 10 + pacman errors <\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ mkdir \/mingw64\r\n<\/pre>\n<h3>Change language<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ export LC_ALL=en_US.UTF-8\r\n<\/pre>\n<h3>No C Compiler installed<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ python3 setup.py install\r\nrunning install\r\nrunning build\r\nrunning build_py\r\ncreating build\r\ncreating build\/lib.mingw-3.5\r\ncreating build\/lib.mingw-3.5\/bigfloat\r\ncopying bigfloat\/context.py -&gt; build\/lib.mingw-3.5\/bigfloat\r\ncopying bigfloat\/core.py -&gt; build\/lib.mingw-3.5\/bigfloat\r\ncopying bigfloat\/ieee.py -&gt; build\/lib.mingw-3.5\/bigfloat\r\ncopying bigfloat\/rounding_mode.py -&gt; build\/lib.mingw-3.5\/bigfloat\r\ncopying bigfloat\/__init__.py -&gt; build\/lib.mingw-3.5\/bigfloat\r\ncreating build\/lib.mingw-3.5\/bigfloat\/test\r\ncopying bigfloat\/test\/test_bigfloat.py -&gt; build\/lib.mingw-3.5\/bigfloat\/test\r\ncopying bigfloat\/test\/test_context.py -&gt; build\/lib.mingw-3.5\/bigfloat\/test\r\ncopying bigfloat\/test\/test_mpfr.py -&gt; build\/lib.mingw-3.5\/bigfloat\/test\r\ncopying bigfloat\/test\/test_rounding_mode.py -&gt; build\/lib.mingw-3.5\/bigfloat\/test\r\ncopying bigfloat\/test\/test___all__.py -&gt; build\/lib.mingw-3.5\/bigfloat\/test\r\ncopying bigfloat\/test\/__init__.py -&gt; build\/lib.mingw-3.5\/bigfloat\/test\r\nrunning build_ext\r\nTraceback (most recent call last):\r\n  File &quot;setup.py&quot;, line 267, in &lt;module&gt;\r\n    'bigfloat.test',\r\n  File &quot;C:\/msys64\/mingw64\/lib\/python3.5\\distutils\\core.py&quot;, line 148, in setup\r\n    dist.run_commands()\r\n  &#x5B;...]\r\n  File &quot;C:\/msys64\/mingw64\/lib\/python3.5\\distutils\\ccompiler.py&quot;, line 1033, in new_compiler\r\n    return klass(None, dry_run, force)\r\n  File &quot;C:\/msys64\/mingw64\/lib\/python3.5\\distutils\\cygwinccompiler.py&quot;, line 288, in __init__\r\n    CygwinCCompiler.__init__ (self, verbose, dry_run, force)\r\n  File &quot;C:\/msys64\/mingw64\/lib\/python3.5\\distutils\\cygwinccompiler.py&quot;, line 127, in __init__\r\n    if self.ld_version &gt;= &quot;2.10.90&quot;:\r\nTypeError: unorderable types: NoneType() &gt;= str()\r\n\r\n$ pacman -S mingw-w64-x86_64-gcc\r\n\r\n$ python3 setup.py install\r\nrunning install\r\nrunning build\r\nrunning build_py\r\nrunning build_ext\r\nbuilding 'mpfr' extension\r\ncreating build\/temp.mingw-3.5\r\nC:\\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\r\n&#x5B;...]\r\nWriting C:\/msys64\/mingw64\/lib\/python3.5\/site-packages\/bigfloat-0.3.0-py3.5.egg-info\r\n\r\n<\/pre>\n<h3>pacman install build system for mingw-w64-x86_64<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ pacman -S mingw-w64-x86_64-gcc\r\n$ pacman -S mingw-w64-x86_64-gdb\r\n<\/pre>\n<h3>pacman query<\/h3>\n<p><a href=\"https:\/\/www.quora.com\/How-can-I-show-the-list-of-all-installed-packages-in-Arch-Linux-pacman-packet-manager\">How can I show the list of all installed packages in Arch Linux (pacman packet manager)?<\/a><\/p>\n<pre class=\"brush: plain; title: query; notranslate\" title=\"query\">\r\n       -Q, --query\r\n           Query the package database.\r\n           This operation allows you to view installed packages\r\n           and their files, as well as meta-information about\r\n           individual packages\r\n       -i, --info\r\n           Display information on a given package. \r\n       -s, --search &lt;regexp&gt;\r\n           Search each locally-installed package for names or\r\n           descriptions that match regexp.\r\n<\/pre>\n<pre class=\"brush: plain; title: query installed package; notranslate\" title=\"query installed package\">\r\n$ pacman -Qi mingw-w64-x86_64-python3\r\nName                     : mingw-w64-x86_64-python3\r\nVersion                  : 3.5.2-2\r\n\r\n$ pacman -Qs python\r\nlocal\/mingw-w64-x86_64-python3 3.5.2-2\r\n    A high-level scripting language (mingw-w64)\r\nlocal\/mingw-w64-x86_64-python3-cairo 1.10.0-5\r\n    Python2 bindings for the cairo graphics library (mingw-w64)\r\nlocal\/mingw-w64-x86_64-python3-cycler 0.9.0-1\r\n    Composable style cycles\r\n\r\n&#x5B;...]\r\n<\/pre>\n<pre class=\"brush: plain; title: query available packages; notranslate\" title=\"query available packages\">\r\n$ pacman -Ss xpdf\r\nmingw32\/mingw-w64-i686-poppler 0.76.1-1\r\n    PDF rendering library based on xpdf 3.0 (mingw-w64)\r\nmingw32\/mingw-w64-i686-xpdf 4.00-1\r\n    Utilities for PDF files (mingw-w64)\r\nmingw64\/mingw-w64-x86_64-poppler 0.76.1-1\r\n    PDF rendering library based on xpdf 3.0 (mingw-w64)\r\nmingw64\/mingw-w64-x86_64-xpdf 4.00-1\r\n    Utilities for PDF files (mingw-w64)\r\n&#x5B;...]\r\n<\/pre>\n<pre class=\"brush: plain; title: query remote package; notranslate\" title=\"query remote package\">\r\n$ pacsearch python2\r\n<\/pre>\n<pre class=\"brush: plain; title: Remove package; notranslate\" title=\"Remove package\">\r\n$ pacman -R mingw-w64-x86_64-arm-none-eabi-binutils\r\n<\/pre>\n<h1>MSYS2 Shell vs MinGW-w64 Shell<\/h1>\n<p><a href=\"https:\/\/sourceforge.net\/p\/msys2\/discussion\/general\/thread\/dcf8f4d3\/\">MSYS2 Shell or MinGW-w64 Shell<\/a><br \/>\n<a href=\"https:\/\/www.msys2.org\/wiki\/MSYS2-introduction\/\">MSYS2-Introduction<\/a><br \/>\n<a href=\"https:\/\/www.msys2.org\/wiki\/How-does-MSYS2-differ-from-Cygwin\/\">How does MSYS2 differ from Cygwin?<\/a><\/p>\n<h3>MSYS2<\/h3>\n<p>MSYS2 is based on Cygwin and knows how to understand POSIX conventions like paths (<code>\/usr\/bin\/<\/code>, <code>\/etc<\/code>) as well as special devices like <code>\/dev\/null<\/code>, <code>\/dev\/clipboard<\/code>, etc and many other things. MSYS2 comes with a GCC toolchain who will produce native binaries that are always tied to <code>msys-2.0.dll<\/code>. It&#8217;s that DLL that does all the magic of interoperability between POSIX conventions and Windows. It&#8217;s because of it that it&#8217;s possible to use a Unix like path <code>\/home\/joe\/<\/code> and pass it to a Windows and it still works.<\/p>\n<p>Indeed, (I&#8217;m not sure of the exact details) but when when <code>msys-2.0.dll<\/code><br \/>\nsees you are calling a native Windows executables (one that does not<br \/>\ndepends on <code>msys-2.0.dll<\/code>), it will convert the path <code>\/home\/joe\/<\/code> to a<br \/>\nWindows path like <code>C:\\Users\\joe<\/code> that the native Windows program receives<br \/>\nand knows how to understand. Without this translation, the Windows program<br \/>\nwould receive <code>\/home\/joe\/<\/code> and wouldn&#8217;t understand how to treat it<br \/>\ncorrectly. All this paths translations applies also to environment<br \/>\nvariables.<\/p>\n<p>This process (and all the POSIX emulation layer) incurs a performance<br \/>\npenalty that can be significant for heavy file-centric software. Git is a<br \/>\ngood example and that&#8217;s why the MSYS2 git package (<code>msys\/git<\/code>) is slower<br \/>\nthan a native git client like the one provided by Git For Windows<br \/>\n(<code>git-for-windows\/mingw-w64-x86_64-git<\/code>). That&#8217;s why a native program (read<br \/>\na MINGW one) is usually &#8220;better&#8221; than an MSYS2 one. Don&#8217;t be afraid of<br \/>\nusing pure MSYS2 program, in most cases (I would say 90%), the difference<br \/>\nis not significant because bottleneck is not the filesystem (CPU, network,<br \/>\nother).<\/p>\n<p>That&#8217;s why you will often read that MSYS2 is only a way to make it easier<br \/>\nto build and deploy MINGW native executables. In my personal opinion and<br \/>\nthe way I use it, it&#8217;s much much more than that as I use and build little<br \/>\nMINGW tools. MSYS2 is a full subsystem dealing with way more than just a<br \/>\ntoolchain as it deals with filesystem, users, permissions (to an extent)<br \/>\nand much more. I use it mainly because it has the same toolset as the one<br \/>\nI&#8217;m used on Linux (console-based of course :)).<\/p>\n<p>Because MSYS2 understands POSIX and has a pretty good emulation layer, it<br \/>\nis often very easy to port a package originally built on Linux to it,<br \/>\nbecause almost no code work is needed.<\/p>\n<h3>MINGW<\/h3>\n<p>MINGW (either 32 or 64) is a set of toolchain to build native Windows<br \/>\nprogram. Those program do not depends on <code>msys-2.0.dll<\/code> and depends rather<br \/>\non MSVC runtime. Those don&#8217;t understand POSIX paths, so if you pass<br \/>\n<code>\/home\/joe<\/code> outside of an MSYS2 shells (from pure cmd for example), it will<br \/>\nnot understand it. Indeed, in pure <code>cmd <\/code>(and via many interactions from<br \/>\nother programs), no translation of paths is performed.<\/p>\n<p>MINGW toolchains are based on mingw-w64 which<br \/>\nprovides the ground work to compile them. They are available in pacman for<br \/>\ninstallation and they also contains GCC et related tools (binutils, ld).<br \/>\nWhen invoked, GCC produces pure native executable. So, when working with a<br \/>\nMINGW program, remember that it&#8217;s like a native Window program that knows<br \/>\nnothing about MSYS2.<\/p>\n<p>MSYS2 happens to actual provides those toolchains directly to you<br \/>\npre-compiled via pacman. Note however, that it&#8217;s possible to download the<br \/>\nmingw-w64 toolchains in standalone, put them somewhere and invoke them<br \/>\nafterward in MSYS2 (by proprely configuring PATH and other variables<br \/>\nyourself). They can also be invoked via <code>cmd <\/code>directly because they do not<br \/>\ndepend on MSYS2 at all.<\/p>\n<h3>Shells<\/h3>\n<p>When you start any of the MSYS2 shells, they all start an MSYS2 <code>bash<\/code><br \/>\nprogram. Since it&#8217;s a MSYS2 <code>bash<\/code>, it understands Unix paths and will do<br \/>\ntranslation when calling native Windows executables.<\/p>\n<p>That being said, what is the difference between all the shells? It all<br \/>\nabout the tweaking some environment variables to change default programs<br \/>\npicked when calling them. It&#8217;s mainly about the PATH environment variable<br \/>\nbut it also involves MSYSTEM PKG_CONFIG_PATH ACLOCAL_PATH MANPATH like Ray<br \/>\nsaid earlier. Checkout <code>\/etc\/profile<\/code> around line 28 to see the conditional<br \/>\nthat sets all this.<\/p>\n<p>Let&#8217;s assume you have installed three toolchains:<br \/>\n* MSYS2 (package group <code>msys2-devel<\/code>) to compile MSYS2 tools which<br \/>\ninstalls gcc in <code>\/usr\/bin<\/code>.<br \/>\n* MINGW32 (package group <code>mingw-w64-i686-toolchain<\/code>) to compile Windows<br \/>\nnative 32 bits executable which installs gcc in <code>\/mingw32\/bin<\/code>.<br \/>\n* MINGW64 (package group <code>mingw-w64-x86_64-toolchain<\/code>) to compile<br \/>\nWindows native 64 bits executable which installs gcc in <code>\/mingw64\/bin<\/code>.<\/p>\n<p>For msys2_shell, PATH is roughly only <code>\/usr\/local\/bin:\/usr\/bin:\/bin<\/code>. This<br \/>\nmeans that when running <code>gcc<\/code>, you will get <code>\/usr\/bin\/gcc<\/code>.<\/p>\n<p>For mingw32_shell, PATH is roughly<br \/>\n<code>\/mingw32\/bin:\/usr\/local\/bin:\/usr\/bin:\/bin<\/code>. This means that now, running<br \/>\n<code>gcc <\/code>you will get instead <code>\/mingw32\/bin\/gcc<\/code>.<\/p>\n<p>For mingw64_shell, PATH is roughly<br \/>\n<code>\/mingw64\/bin:\/usr\/local\/bin:\/usr\/bin:\/bin<\/code> and as you have guessed,<br \/>\nrunning <code>gcc <\/code>you will get instead <code>\/mingw64\/bin\/gcc<\/code>.<\/p>\n<p>This means that all three shells have the same capabilities, but because of<br \/>\nthe different orders, tools that will be picked are different. So, if you<br \/>\nwant to compile something, use the appropriate shell for what you want to<br \/>\ndo (MSYS2 program, Windows native 32 bits or Windows native 64 bits).<\/p>\n<p>If you are not compiling anything, then it depends. Usually, msys2_shell is<br \/>\nrecommended. However, on a bare installation, <code>\/mingw64\/bin<\/code> is not added<br \/>\nanywhere when using <code>msys2_shell<\/code>, problem it can causes is that if you had<br \/>\ninstalled mingw64 packages, they are not available in the shell. In my<br \/>\ncase, I have tweaked by <code>.bash_profile<\/code> to correctly add <code>\/mingw64\/bin<\/code><br \/>\nafter PATH (like <code>\/usr\/local\/bin:\/usr\/bin:\/bin:\/mingw64\/bin<\/code>). This<br \/>\nalways favor MSYS2 tools but will pick <code>\/mingw64\/bin<\/code> when they don&#8217;t exist<br \/>\nin MSYS2 <code>\/usr\/bin<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MSYS2 introduction MSYS2 Wiki MSYS2 vs. MinGw64 MSYS vs. MinGW: internal environment variables $ uname MSYS_NT-10.0 $ uname MINGW64_NT-10.0 Package Manager $ pacman -Q &lt;list all packages&gt; $ pacman -Qi &lt;package&gt; &lt;info about a single package&gt; $ pacman -Ql &lt;package&gt; &lt;files of a single package&gt; Pin to Taskbar $ pacman -S msys2-launcher $ pacman -Qi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5035","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/5035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5035"}],"version-history":[{"count":33,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/5035\/revisions"}],"predecessor-version":[{"id":12176,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/5035\/revisions\/12176"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}