Compiling with MSYS2

Notes:



For those following the instructions (ref) be aware that Microsoft Defender or any antivirus software might be slowing down the process considerably. For more details see this.


Think of MSYS2 as a Bash shell that runs on Windows.

An easy way to start MSYS2 is

  1. Click on the Windows search icon image
  2. Enter MSYS2
  3. Select MSYS2 MinGW x64

which should start up a Bash shell.


For

ftp: download libuuid-1.6.2.tar.gz from ftp (dot) ossp (dot) org/pkg/lib/uuid/

use

$ wget -r --no-passive ftp://ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz

Windows did prompt with a firewall request which I granted.

Details (Click triangle to expand)
Groot@Galaxy MSYS ~
$ wget -r --no-passive ftp://ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
--2022-08-02 04:53:31--  ftp://ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
           => ‘ftp.ossp.org/pkg/lib/uuid/.listing’
Resolving ftp.ossp.org (ftp.ossp.org)... 148.251.206.37
Connecting to ftp.ossp.org (ftp.ossp.org)|148.251.206.37|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /pkg/lib/uuid ... done.
==> PORT ... done.    ==> LIST ... done.

ftp.ossp.org/pkg/lib/uuid/.listing                                      [ <=>                                                                                                                                                               ]   2.21K  --.-KB/s    in 0.001s

2022-08-02 04:53:33 (3.00 MB/s) - ‘ftp.ossp.org/pkg/lib/uuid/.listing’ saved [2263]

Removed ‘ftp.ossp.org/pkg/lib/uuid/.listing’.
--2022-08-02 04:53:33--  ftp://ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
           => ‘ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz’
==> CWD not required.
==> PORT ... done.    ==> RETR uuid-1.6.2.tar.gz ... done.
Length: 397048 (388K)

ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz                         100%[==================================================================================================================================================================>] 387.74K   391KB/s    in 1.0s

2022-08-02 04:53:35 (391 KB/s) - ‘ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz’ saved [397048]

FINISHED --2022-08-02 04:53:35--
Total wall clock time: 3.1s
Downloaded: 1 files, 388K in 1.0s (390 KB/s)

Groot@Galaxy MSYS ~
$ ls -a ~/ftp.ossp.org/pkg/lib/uuid
.  ..  uuid-1.6.2.tar.gz

For configure: error: no acceptable C compiler found in $PATH
Do not use the MSYS2 MSYS app, use the MSYS2 MinGW x64 app.



EDIT (09/03/2022)

Example steps (Click triangle to expand)

While these instructions will not build everything that one can get by installing a stable release they are more detailed than the current instructions.

Using MSYS2 MinGW x64

$ cd ~
$ pwd
$ git --version
$ curl --version
$ tar --version
$ cmake --version
$ make --version
$ pacman --version
Note: Repeat next command until everything is up to date
$ pacman -Syu
$ pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake git make mingw-w64-x86_64-libjpeg mingw-w64-x86_64-xpm-nox mingw-w64-x86_64-libyaml mingw-w64-x86_64-diffutils mingw-w64-x86_64-pcre mingw-w64-x86_64-db libdb-devel
$ curl ftp://ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz -o uuid-1.6.2.tar.gz
$ tar -xvzf uuid-1.6.2.tar.gz
$ cd uuid-1.6.2
$ ./configure --prefix=/usr/local
$ make
$ make install
$ cd ..
$ rm -rf swipl-devel
$ git clone https://github.com/SWI-Prolog/swipl-devel.git
$ cd swipl-devel
$ git checkout tags/V8.5.15
$ git status
$ git submodule update --init
$ git submodule status
$ mkdir build
$ cd build
$ cmake -DMINGW_ROOT=/mingw64 -DLIBUUID_INCLUDE_DIR=/usr/local/include -DUUID_LIBRARY=/usr/local/lib/libuuid.a -DBDB_LIBRARY=/mingw64/bin/libdb-6.0.dll -DINSTALL_DOCUMENTATION=OFF -DSWIPL_PACKAGES_X=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -G "MSYS Makefiles" ..
$ make
$ make install

Note: The next two commands were skipped as the files were installed from an earlier run and I don't want to uninstall MSYS2 and start from fresh install of MSYS2 to verify the command.
$ cd /usr/local/bin
$ cp `ldd libarchive-13.dll |grep -o "/mingw64/bin/.*\\.dll"` .

Using Windows File Explorer
Double click on C:\msys64\usr\local\bin\swipl-win.exe