Skip to content

Commit

Permalink
[New] A usage guide for MSYS2 was initially committed: it was separat…
Browse files Browse the repository at this point in the history
…ed from mingw_usage_guide.txt.

[Update] The usage of commands for pacman was updated.
  • Loading branch information
sangwook236 committed Jan 15, 2025
1 parent b5869db commit dd33458
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 49 deletions.
15 changes: 15 additions & 0 deletions resource/computer_system/package_management/pacman_usage_guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
https://wiki.archlinux.org/index.php/pacman

[-] Usage.
- Help.
pacman --help
pacman -S --help
pacman -R --help
pacman -Q --help

- Query.
pacman -Q -e
pacman -Q -i

- Update.
pacman -Sy pacman
pacman -Syu
Expand All @@ -17,3 +27,8 @@
- Install package.
pacman -S mingw32/mingw-w64-i686-cmake
pacman -S --force mingw64/mingw-w64-x86_64-cmake
pacman -S --needed base-devel mingw-w64-x86_64-toolchain

- Remove package.
pacman -Rc mingw-w64-x86_64-cmake
pacman -Rs mingw-w64-ucrt-x86_64-cmake
58 changes: 9 additions & 49 deletions resource/computer_system/platform_emulator/mingw_usage_guide.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[-] General.
- Reference.
${GDT_HOME}/MinGW-Usage-Guide.md
${SWDT_HOME}/MinGW-Usage-Guide.md

- Site.
MinGW:
Expand Down Expand Up @@ -46,7 +46,7 @@

[-] Usage.
- Reference.
${GDT_HOME}/sw_dev/cpp/rnd/src/probabilistic_graphical_model/mocapy/mocapy_build_guide.txt
${SWDT_HOME}/sw_dev/cpp/rnd/src/probabilistic_graphical_model/mocapy/mocapy_build_guide.txt

[-] Package Management.
- MinGW.
Expand All @@ -55,20 +55,15 @@
e.g.)
mingw-get install lib-package-name
mingw-get update
- MSYS2.
REF [file] >> pacman_usage_guide.txt

Search package:
pacman -Ss cmake
Install package:
pacman -S mingw32/mingw-w64-i686-cmake
pacman -S --force mingw64/mingw-w64-x86_64-cmake
- MSYS.
For packages which are not installed by mingw-get.exe, find them in the sites below.
http://sourceforge.net/projects/mingw/files/MSYS/Extension/
http://sourceforge.net/projects/mingw/files/MSYS/Base/
Copy, uncompress, and copy downloaded files to ${MSYS_HOME}/bin.

- MSYS2.
Refer to msys_usage_guide.txt.

[-] Toolchain (MinGW-w64).
- Site.
Expand Down Expand Up @@ -103,41 +98,6 @@
${MINGW_HOME}/lib/gcc/i686-w64-mingw32
${MINGW_HOME}/lib/gcc/x86_64-w64-mingw32

[-] MSYS.
- Install.
MSYS2 (Windows):
REF [site] >> https://sourceforge.net/p/msys2/wiki/MSYS2%20installation/
==> Install only one of two installation files below.
msys2-i686-yyyymmdd.exe
msys2-x86_64-yyyymmdd.exe
==> Terminals below are installed.
MSYS2 MinGW 32-bit
MSYS2 MinGW 64-bit
MSYS2 MSYS
- Uninstall.
MSYS2 (Windows):
Use Control Panel.

- Update package database.
MSYS2:
REF [site] >> http://msys2.github.io/

pacman -Sy pacman
pacman -Syu
pacman -Su

- Mount MinGW directory.
mount D:/util/mingw /mingw
For MSYS:
mount D:/util/mingw-w64/i686-5.3.0-posix-dwarf-rt_v4-rev0/mingw32 /mingw
For MSYS2 MinGW 32-bit:
mount D:/util/mingw-w64/i686-6.2.0-posix-dwarf-rt_v5-rev1/mingw32 /mingw32
For MSYS2 MinGW 64-bit:
mount D:/util/mingw-w64/x86_64-6.2.0-release-posix-seh-rt_v5-rev1/mingw64 /mingw64
Add into ${MSYS_HOME}/etc/fstab.
D:/util/mingw-w64/i686-6.2.0-posix-dwarf-rt_v5-rev1/mingw32 /mingw32
D:/util/mingw-w64/x86_64-6.2.0-release-posix-seh-rt_v5-rev1/mingw64 /mingw64

[-] Setting.
- Compiler, linker, & make to use for building library.
Use executables in ${MINGW_HOME}/bin.
Expand All @@ -147,15 +107,15 @@
Use mingw32-make.exe.
make.exe (X) ==> mingw32-make.exe (O)
- Set the GNU runtime directory in PATH.
set PATH=${MINGW_HOME}/bin;${MSYS_ROOT}/bin;%PATH%
set PATH=${MINGW_HOME}/bin;${MSYS_HOME}/bin;%PATH%
set PATH=${MINGW_HOME}/bin;${CYGWIN_HOME}/bin;%PATH%
set PATH=${MINGW_HOME}/bin;${GNUWIN32_HOME}/bin;%PATH%

- Set environment.
a) When using MSYS terminal.
Run MSYS terminal.
(Optional) mount MinGW directory.
==> Refer to "MSYS".
==> Refer to msys_usage_guide.txt.
(Optional) Set the MinGW directory in PATH.
Use 'export PATH'.
export PATH=${MINGW_HOME}/bin:$PATH
Expand All @@ -180,8 +140,8 @@
Therefore, use the following directory as an installation prefix.
--prefix=${MINGW_HOME}
Then installed files are added to the following directories.
${MINGW_HOME}/include or ${MSYS_ROOT}/include
${MINGW_HOME}/lib or ${MSYS_ROOT}/lib
${MINGW_HOME}/include or ${MSYS_HOME}/include
${MINGW_HOME}/lib or ${MSYS_HOME}/lib

[-] Building (Terminal).
- Set environment.
Expand Down Expand Up @@ -213,7 +173,7 @@
- Configure and generate.
> When an error occurs about 'sh', re-run 'Configure'.
<error> sh.exe was found in your PATH.
==> Set CMAKE_SH to ${MSYS_ROOT}/bin/sh.exe.
==> Set CMAKE_SH to ${MSYS_HOME}/bin/sh.exe.
> When an error occurs about C/C++ compiler.
<error> The C compiler "${MINGW_HOME}/bin/gcc.exe" is not able to compile a simple test program.
==> Set CMAKE_MAKE_PROGRAM to ${MINGW_HOME}/bin/mingw32-make.exe.
Expand Down
139 changes: 139 additions & 0 deletions resource/computer_system/platform_emulator/msys_usage_guide.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
[-] General.
- Site.
MSYS2:
https://www.msys2.org/
https://github.com/msys2

https://sourceforge.net/p/msys2/wiki/Packages/
https://sourceforge.net/projects/msys2/files/Base/

https://github.com/Alexpux/MSYS2-packages

MSYS:
For 32-bit:
http://www.mingw.org/wiki/MSYS
For 64-bit:
https://sourceforge.net/p/mingw-w64/wiki2/MSYS/
https://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20%28Win64%20hosted%29/MSYS%20%2832-bit%29/

http://sourceforge.net/projects/mingw/files/MSYS/Base/
http://sourceforge.net/projects/mingw/files/MSYS/Extension/
wget
http://sourceforge.net/projects/mingw/files/MSYS/Contributed/

[-] Usage.
https://www.msys2.org/

- Environments (MSYSTEM).
https://www.msys2.org/docs/environments/

MSYS:
${MSYS2_HOME}/usr
UCRT64:
Universal C Runtime (UCRT).
https://learn.microsoft.com/en-us/cpp/windows/universal-crt-deployment
${MSYS2_HOME}/ucrt64
CLANG64:
${MSYS2_HOME}/clang64
CLANGARM64:
${MSYS2_HOME}/clangarm64
MINGW64:
${MSYS2_HOME}/mingw64

- Terminals.
${MSYS2_HOME}/clang32.exe
${MSYS2_HOME}/clang64.exe
${MSYS2_HOME}/clangarm64.exe
${MSYS2_HOME}/mingw32.exe
${MSYS2_HOME}/mingw64.exe
${MSYS2_HOME}/msys2.exe
${MSYS2_HOME}/ucrt64.exe

[-] Installation (MSYS2).
https://www.msys2.org/

- Install.
msys2-x86_64-yyyymmdd.exe
msys2-i686-yyyymmdd.exe

- Uninstall.
Use Control Panel.

- Install packages.
https://packages.msys2.org/
https://packages.msys2.org/packages/
https://packages.msys2.org/basegroups/
https://packages.msys2.org/groups/

REF [file] >> pacman_usage_guide.txt

Search packages:
pacman -Ss mingw-w64-x86_64-gcc
pacman -Ss mingw-w64-x86_64-clang
pacman -Ss mingw-w64-ucrt-x86_64-gcc
pacman -Ss mingw-w64-ucrt-x86_64-clang
pacman -Ss mingw-w64-clang-x86_64-gcc
pacman -Ss mingw-w64-clang-x86_64-clang

Install packages:
pacman -S --needed base-devel mingw-w64-x86_64-toolchain
pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-gtest
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain
pacman -S mingw-w64-ucrt-x86_64-cmake
pacman -S mingw-w64-ucrt-x86_64-gtest
pacman -S --needed base-devel mingw-w64-clang-x86_64-toolchain
pacman -S mingw-w64-clang-x86_64-cmake
pacman -S mingw-w64-clang-x86_64-gtest

pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-x86_64-clang
pacman -S mingw-w64-i686-gcc
pacman -S mingw-w64-i686-clang
pacman -S mingw-w64-ucrt-x86_64-gcc
pacman -S mingw-w64-ucrt-x86_64-clang
pacman -S mingw-w64-clang-x86_64-gcc
pacman -S mingw-w64-clang-x86_64-clang

Update package database:
pacman -Sy pacman
pacman -Syu
pacman -Su

Check:
Optional:
export PATH=/clang32/bin:$PATH
export PATH=/clang64/bin:$PATH
export PATH=/clangarm64/bin:$PATH
export PATH=/mingw32/bin:$PATH
export PATH=/mingw64/bin:$PATH
export PATH=/ucrt64/bin:$PATH

set PATH=/msys64/clang32/bin;%PATH%
set PATH=/msys64/clang64/bin;%PATH%
set PATH=/msys64/clangarm64/bin;%PATH%
set PATH=/msys64/mingw32/bin;%PATH%
set PATH=/msys64/mingw64/bin;%PATH%
set PATH=/msys64/ucrt64/bin;%PATH%

gcc --version
g++ --version
gdb --version
clang --version
clang++ --version
lldb --version

- Mount MinGW directory.
Mount:
For MSYS:
mount ${MINGW_HOME}/mingw32 /mingw
mount D:/util/mingw-w64/i686-5.3.0-posix-dwarf-rt_v4-rev0/mingw32 /mingw
For MSYS2 MinGW 32-bit:
mount ${MINGW_HOME}/mingw32 /mingw32
mount D:/util/mingw-w64/i686-6.2.0-posix-dwarf-rt_v5-rev1/mingw32 /mingw32
For MSYS2 MinGW 64-bit:
mount ${MINGW_HOME}/mingw64 /mingw64
mount D:/util/mingw-w64/x86_64-6.2.0-release-posix-seh-rt_v5-rev1/mingw64 /mingw64
Add into ${MSYS_HOME}/etc/fstab:
D:/util/mingw-w64/i686-6.2.0-posix-dwarf-rt_v5-rev1/mingw32 /mingw32
D:/util/mingw-w64/x86_64-6.2.0-release-posix-seh-rt_v5-rev1/mingw64 /mingw64

0 comments on commit dd33458

Please sign in to comment.