Compiling with MSYS2

Dear list, dear Jan,

I tried to compile SWI-Prolog with MSYS2 on Windows (to be more precise, MinGW64 by MSYS2). The process hangs during cmake, complaining that zlib*.dll is not found. It’s strange, since it is there:

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ ls /bin/zlib1.dll
/bin/zlib1.dll

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ rm -rf *

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ cmake -G "MSYS Makefiles" ..
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Check for working C compiler: C:/msys2/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/msys2/mingw64/bin/gcc.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/msys2/mingw64/bin/g++.exe
-- Check for working CXX compiler: C:/msys2/mingw64/bin/g++.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'RelWithDebInfo' as none was specified.
-- Configuring SWI-Prolog-8.3.23
-- Finding required external DLLs
   -- zlib*.dll:
CMake Error at cmake/port/Windows.cmake:36 (message):
  Cannot file /bin/zlib*.dll
Call Stack (most recent call first):
  cmake/port/Windows.cmake:59 (find_file_from_pattern)
  cmake/port/Windows.cmake:68 (find_windows_dlls)
  cmake/Ports.cmake:4 (include)
  CMakeLists.txt:71 (include)


-- Configuring incomplete, errors occurred!
See also "C:/msys2/home/Matthias/swipl-devel/build/CMakeFiles/CMakeOutput.log".

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$

The use case will actually be RTools, the compiler environment for the R system, so that R packages can connect to swipl.

Best wishes,

Matthias

Its clear what is going wrong (can’t find zlib*.dll). I have little clue why though. I understood building the core has worked for some people on Windows. All I can advice is to put some additional message() calls in e.g. function find_file_from_pattern in Windows.cmake. Note that typically just running cmake .. is enough to test with the changes.

I guess it is no option for R, but building from source is a nightmare on Windows due to the large number of dependencies. That is why there is GitHub - SWI-Prolog/docker-swipl-build-mingw: Docker to cross-compile SWI-Prolog for Windows

MINGW_ROOT does not seem to be defined under MSYS2/MinGW64. Hence, this:

cmake -DMINGW_ROOT=/mingw64 -DINSTALL_DOCUMENTATION=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -G “MSYS Makefiles” …

I had to do three more things to make „make“ work, as well as „make install“.

  • Some problem occurred during „make“ with pldoc (see the -DINSTALL_DOCUMENTATION=OFF). Not so important.
  • Error message during xpce (so I removed the folder packages/xpce). Not so important either.
  • I added -DCMAKE_INSTALL_PREFIX:PATH=/usr/local so that swipl is not installed into „C:\Program Files\swipl“ and so on.
  • And there’s no prompt :blush:, see below. [If you type “start swipl” instead of just swipl, the prompt is there]

Thank you! Great system, and no nightmare (anymore).

Best wishes,

Matthias

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/demo
$ start swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 8.3.24-3-g32f8079a1-DIRTY)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
consult(likes).
true.
likes(sam, X).
X = dahl ;
X = tandoori ;
X = kurma ;
X = chow_mein ;
X = chop_suey ;
X = sweet_and_sour ;
X = pizza ;
X = spaghetti ;
X = chips.
1 Like

OK, here’s the MSYS2 installation:

  • install msys2 from msys2.org
  • pacman -Syu
  • 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
  • ftp: download libuuid-1.6.2.tar.gz from ftp (dot) ossp (dot) org/pkg/lib/uuid/, configure --prefix=/usr/local, make, make install, ignore the error relating to strip.exe
  • git clone https://github.com/SWI-Prolog/swipl-devel.git
  • cd swipl-devel
  • git submodule update --init
  • 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” …
  • only dot dot in the previous line, and avoid “typographic” quotation marks
  • make
  • make install
  • start swipl

@Jan, please consider removing the description from the webpage (with mingw under windows)

https://www.swi-prolog.org/build/MinGW.txt

Since this is now really outdated.

1 Like

Why not update? Before doing so, how complete is the resulting system? I don’t see any of the dependencies mentioned except for libjpeg mingw-w64-x86_64-xpm-nox, both of which are needed for building xpce, but that is omitted from the build. What do you get from

?- check_installation.

I added a few packages and compiler switches, four issues left. And I agree, it is still a nightmare with the dependencies.

% Checking your SWI-Prolog kit for common issues ...
%
% Version: ............. 8.3.24-29-g24cbf084b-DIRTY
% Address bits: ........ 64
% Architecture: ........ x64-win64
% Installed at: ........ c:/msys64/usr/local
% Cores: ............... 4
%
% Checking tcmalloc ............................ not present
Warning: See http://www.swi-prolog.org/build/issues/tcmalloc.html
% Checking gmp ................................. ok
% Loading library(archive) ..................... FAILED
c:/msys64/usr/local/library/archive.pl:96:       Initialization goal raised exception:
Warning: Das angegebene Modul wurde nicht gefunden.
Warning: In:
Warning:   [61] throw(error(shared_object(open,'Das angegebene Modul wurde nicht gefunden.\r   \n'),context(...,_4132)))
Warning:   [59] <meta call>
Warning:   [58]    with_mutex('$foreign',load_foreign_library(foreign(archive4pl),archive,default(install))) <foreign>
Warning:   [55] '$run_init_goal'(shlib:load_foreign_library(...)) at c:/msys64/usr/local/boot/init.pl:796
Warning:   [54] catch(system:'$run_init_goal'(...),_4288,system:'$initialization_error'(_4310,...,...)) at c:/msys64/usr/local/boot/init.pl:546
Warning:   [53]    catch_with_backtrace(system:'$run_init_goal'(...),_4356,system:'$initialization_error'(_4378,...,...)) at    c:/msys64/usr/local/boot/init.pl:614
Warning:
Warning: Note: some frames are missing due to last-call optimization.
Warning: Re-run your program in debug mode (:- debug.) to get more detail.
Warning: Exported procedure archive:archive_set_header_property/2 is not defined
Warning: Exported procedure archive:archive_open_entry/2 is not defined
Warning: Exported procedure archive:archive_next_header/2 is not defined
Warning: Exported procedure archive:archive_close/1 is not defined
Warning: Warning: See http://www.swi-prolog.org/build/issues/archive.html
% Loading library(cgi) ......................... ok
% Loading library(crypt) ....................... ok
% Loading library(bdb) ......................... ok
% Loading library(double_metaphone) ............ ok
% Loading library(filesex) ..................... ok
% Loading library(http/http_stream) ............ ok
% Loading library(http/json) ................... ok
% Loading library(http/jquery) ................. ok
%   jQuery from c:/msys64/usr/local/library/http/web/js/jquery-1.11.3.min.js
% Loading library(isub) ........................ ok
Warning: library(jpl) .......................... NOT FOUND
Warning: See http://www.swi-prolog.org/build/issues/jpl.html
% Loading library(memfile) ..................... ok
% Loading library(odbc) ........................ ok
Warning: library(pce) .......................... NOT FOUND
Warning: See http://www.swi-prolog.org/build/issues/xpce.html
% Loading library(pcre) ........................ ok
% Loading library(pdt_console) ................. ok
% Loading library(porter_stem) ................. ok
% Loading library(process) ..................... ok
% Loading library(protobufs) ................... ok
% Loading library(readutil) .................... ok
% Loading library(semweb/rdf_db) ............... ok
% Loading library(semweb/rdf_ntriples) ......... ok
% Loading library(semweb/turtle) ............... ok
% Loading library(sgml) ........................ ok
% Loading library(sha) ......................... ok
% Loading library(snowball) .................... ok
% Loading library(socket) ...................... ok
% Loading library(ssl) ......................... ok
% Loading library(crypto) ...................... ok
% Loading library(table) ....................... ok
% Loading library(time) ........................ ok
% Loading library(unicode) ..................... ok
% Loading library(uri) ......................... ok
% Loading library(uuid) ........................ ok
% Loading library(zlib) ........................ ok
% Loading library(yaml) ........................ ok
Warning: Found 4 issues.
true.

Funny enough, the trouble with libarchive disappeared with debug.

debug.
check_installation.
% Checking your SWI-Prolog kit for common issues ...
%
% Version: ............. 8.3.24-29-g24cbf084b-DIRTY
% Address bits: ........ 64
% Architecture: ........ x64-win64
% Installed at: ........ c:/msys64/usr/local
% Cores: ............... 4
%
% Checking tcmalloc ............................ not present
Warning: See http://www.swi-prolog.org/build/issues/tcmalloc.html
% Checking gmp ................................. ok
% Loading library(archive) ..................... ok
%   Supported filters: bzip2, compress, gzip, grzip, lrzip, lzip, lzma, lzop, none, rpm, uu, xz
%   Supported formats: 7zip, ar, cab, cpio, empty, gnutar, iso9660, lha, mtree, rar, raw, tar, xar, zip
% Loading library(cgi) ......................... ok

etc., the other messages stay the same.

1 Like

Thanks. No real clue about why debug should make a difference wrt loading libarchive!? Updated the page, copying the above and referring to this post. Note that you can propose changes to the static pages of the website using PRs on GitHub - SWI-Prolog/plweb-www: Submodule of plweb.git that contains the (wiki) web-pages

Did the same with MSYS2/mingw32: works fine, no changes except for i686 in the pacman package names instead of x86_64.

Ok, I found the problem with libarchive, the dlls for the different compression formats were not found. If I copy them into the installation folder /usr/local/bin, check_installation works.

cd /usr/local/bin
cp `ldd libarchive-13.dll |grep -o "/mingw64/bin/.*\\.dll"` .

If someone knows a better way to fix this problem, please let me know.
check_installation complains about 3 more issues, these are related to tcmalloc, xpce, java—none of them are found on a msys2/mingw64 system, so this is expected behavior.

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

FYI

Note:
   Started by clicking on C:\msys64\usr\local\bin\swipl-win.exe.
   Did not start by entering swipl from MSYS2 terminal.

check_installation results (click triangle to expand)
Welcome to SWI-Prolog (threaded, 64 bits, version 8.5.15-6-gfa8844c84)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- check_installation.
% Checking your SWI-Prolog kit for common issues ...
% 
% Version: ............. 8.5.15-6-gfa8844c84
% Address bits: ........ 64
% Architecture: ........ x64-win64
% Installed at: ........ c:/msys64/usr/local
% Cores: ............... 4
% 
% Checking tcmalloc ............................ not present
Warning: See http://www.swi-prolog.org/build/issues/tcmalloc.html
% Checking gmp ................................. ok
% Loading library(archive) ..................... ok
%   Supported filters: bzip2, compress, gzip, grzip, lrzip, lzip, lzma, lzop, none, rpm, uu, xz
%   Supported formats: 7zip, ar, cab, cpio, empty, gnutar, iso9660, lha, mtree, rar, raw, tar, xar, zip
% Loading library(cgi) ......................... ok
% Loading library(crypt) ....................... ok
% Loading library(bdb) ......................... ok
% Loading library(double_metaphone) ............ ok
% Loading library(filesex) ..................... ok
% Loading library(http/http_stream) ............ ok
% Loading library(http/json) ................... ok
% Loading library(http/jquery) ................. ok
%   jQuery from c:/msys64/usr/local/library/http/web/js/jquery-3.6.0.min.js
% Loading library(isub) ........................ ok
% Loading library(jpl) ...
% Extended DLL search path with
%   'c:/Program Files/Java/jdk-12/bin/server'
%   'c:/Program Files/Java/jdk-12/bin'
................................................ ok
% Loading library(memfile) ..................... ok
% Loading library(odbc) ........................ ok
Warning: library(pce) .......................... NOT FOUND
Warning: See http://www.swi-prolog.org/build/issues/xpce.html
% Loading library(pcre) ........................ ok
% Loading library(pdt_console) ................. ok
% Loading library(porter_stem) ................. ok
% Loading library(process) ..................... ok
% Loading library(protobufs) ................... ok
% Loading library(readutil) .................... ok
% Loading library(semweb/rdf_db) ............... ok
% Loading library(semweb/rdf_ntriples) ......... ok
% Loading library(semweb/turtle) ............... ok
% Loading library(sgml) ........................ ok
% Loading library(sha) ......................... ok
% Loading library(snowball) .................... ok
% Loading library(socket) ...................... ok
% Loading library(ssl) ......................... ok
% Loading library(crypto) ...................... ok
% Loading library(table) ....................... ok
% Loading library(time) ........................ ok
% Loading library(unicode) ..................... ok
% Loading library(uri) ......................... ok
% Loading library(uuid) ........................ ok
% Loading library(zlib) ........................ ok
% Loading library(yaml) ........................ ok
Warning: Found 2 issues.
true.

Dear Eric,

this description here is a bit outdated. msys2 actually has now a package swi-prolog that you can normally install with the pacman. It is 8.4.2, and a new version 8.4.3 is currently under review.

Please do also note that swipl-win.exe is not the “SWI-Prolog for Windows” that you normally use under windows. To me it seems to be just a white Window with a prolog prompt.

Best wishes,

Matthias

Now you tell me. :wink:

Actually building SWI-Prolog for Windows on Windows was a warm up task before trying to get the RocksDB pack, which has a build step (Makefile), to build on Windows using either pack_install/1,2 or pack_rebuild/0,1.

Thanks for the instructions I don’t think I could have built SWI-Prolog on Windows without them but as you note they do need some updating.

All right. swipl-8.4.3 is now on msys2. Well, not msys2 in a strict sense, but on the mingw systems:

  • install msys2 from www.msys2.org
  • launch, e.g., the MSYS2 MinGW64 shell
  • then pacman -S mingw-w64-x86_64-swi-prolog
$ swipl
?- check_installation.
?- pack_install(environ).
?- environ(X).

A few patches were needed to make the Windows version compatible with MSYS2. Most importantly, the folder structure needs to be a bit more unix-like. You know, with the exes and dlls living in /mingw/lib/swipl/lib/swipl/lib/swipl/lib/swipl/lib/swipl/lib/amd64-windows/ :slight_smile:

I’ll see which ones are missing and propose the respective patches to be implemented in swipl-devel.

Enjoy! [not yet, the package is still in the “queue”, see here, Pending Package Updates - MSYS2 Packages]

2 Likes

Fast-forward to swipl-devel. I tried to compile under MSYS2 with “the usual steps”,

mkdir build
cd build
cmake -G Ninja -DSWIPL_PACKAGES_X=OFF -DINSTALL_DOCUMENTATION=OFF -DSWIPL_PACKAGES_JAVA=OFF -DCMAKE_INSTALL_PREFIX=/home/Matthias/swipl ..
ninja

Then, I get an error message for INDEX.pl (module not found, I think it is ssl4pl.dll). The error disappears if I run ninja again. Please see my experiments below. I think the problem is that creation of home/library/INDEX.pl actually depends on ssl4pl.dll, which is only build afterwards.

2nd ninja run:

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ ninja
[1/10] Build home/library/unicode/INDEX.pl
[2/10] Build home/library/dcg/INDEX.pl
[3/10] Build home/library/clp/INDEX.pl
[4/10] Build home/library/lynx/INDEX.pl
[5/10] Build home/library/http/INDEX.pl
[6/10] Build home/library/INDEX.pl
[7/10] Build home/library/protobufs/gen_pb/google/protobuf/compiler/INDEX.pl
[8/10] Build home/library/semweb/INDEX.pl
[9/10] Build home/library/protobufs/gen_pb/google/protobuf/INDEX.pl
[10/10] Build home/library/cql/INDEX.pl

removing ssl4pl is fine, it’s just being rebuild again:

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ rm src/ssl4pl.dll

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ ninja
[1/11] Build home/library/clp/INDEX.pl
[2/11] Build home/library/lynx/INDEX.pl
[3/11] Build home/library/unicode/INDEX.pl
[4/11] Build home/library/INDEX.pl
[5/11] Build home/library/dcg/INDEX.pl
[6/11] Build home/library/http/INDEX.pl
[7/11] Build home/library/protobufs/gen_pb/google/protobuf/compiler/INDEX.pl
[8/11] Build home/library/protobufs/gen_pb/google/protobuf/INDEX.pl
[9/11] Build home/library/semweb/INDEX.pl
[10/11] Build home/library/cql/INDEX.pl
[11/11] Linking C shared module src\ssl4pl.dll

Removing INDEX.pl is fine, as well, it’s just being rebuild:

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ rm home/library/INDEX.pl

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ ninja
[1/10] Build home/library/clp/INDEX.pl
[2/10] Build home/library/lynx/INDEX.pl
[3/10] Build home/library/dcg/INDEX.pl
[4/10] Build home/library/unicode/INDEX.pl
[5/10] Build home/library/http/INDEX.pl
[6/10] Build home/library/protobufs/gen_pb/google/protobuf/compiler/INDEX.pl
[7/10] Build home/library/protobufs/gen_pb/google/protobuf/INDEX.pl
[8/10] Build home/library/semweb/INDEX.pl
[9/10] Build home/library/cql/INDEX.pl
[10/10] Build home/library/INDEX.pl

Removing ssl4pl as well as INDEX produces the error (and please note that ssl4pl is build after INDEX):

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ rm src/ssl4pl.dll

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ rm home/library/INDEX.pl

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ ninja
[1/11] Build home/library/unicode/INDEX.pl
[2/11] Build home/library/lynx/INDEX.pl
[3/11] Build home/library/clp/INDEX.pl
[4/11] Build home/library/dcg/INDEX.pl
[5/11] Build home/library/http/INDEX.pl
[6/11] Build home/library/protobufs/gen_pb/google/protobuf/INDEX.pl
[7/11] Build home/library/protobufs/gen_pb/google/protobuf/compiler/INDEX.pl
[8/11] Build home/library/semweb/INDEX.pl
[9/11] Build home/library/cql/INDEX.pl
[10/11] Build home/library/INDEX.pl
ERROR: c:/msys64/home/matthias/swipl-devel/build/home/library/ssl.pl:69:
ERROR:    c:/msys64/home/matthias/swipl-devel/build/home/library/ssl.pl:69: Initialization goal raised exception:
ERROR:    '$open_shared_object'/3: Das angegebene Modul wurde nicht gefunden.

[11/11] Linking C shared module src\ssl4pl.dll

I have seen that happening before. It is harmless but a bit ugly :frowning: Must figure out the right dependencies some day …

  1. If you could provide me a hint where to search for it, I am willing to try to fix it myself.
  2. Support for cmake in Prolog packs was added in 8.5.2 already. I guess there was some use case for it. Do you remember the name of a “pack” that used cmake?

The stuff is defined (I think that is the right one) in cmake/LibIndex.cmake. There is a custom target library_index that has dependencies for the various packages. These dependencies should depend, possibly only on the target package, but possibly on all packages. Each package name is a named target (e.g., ssl, chr, etc.) Probably there is a variable with all packages, but I do not remember. The PackageSelection.cmake may tell you.

Too difficult for me. An interim solution is to let ninja build src/ssl4pl.dll first, then the rest

ninja src/ssl4pl.dll
ninja

:frowning: It is not only ssl though. I’ve seen it with others as well, depending on how the concurrent build works out.