Ann: SWI-Prolog 10.1.5

Dear SWI-Prolog user,

SWI-Prolog 10.1.5 is ready for download. This version comes with
various enhancements to the development tools. It also fixes some
minor bugs and portability issues. Highlights:

  • Fixed XPCE scroll sensitivity when using trackpads (notably on
    Macbooks).

  • Added library(tableutil), providing the tabling inspection
    and statistic utilities that used to be in my private library.

  • Add a class property to threads. This is used to control
    debugging a group of threads, including new threads that are
    created in this group. For example, ?- tdebug(http). now
    reliably enabled debug mode on HTTP worker threads, including
    lazily created threads. Classes are shown by threads/0 and
    the GUI tool for monitoring threads.

  • Extend completion on the commandline to variable names and
    $Var references to saved bindings.

  • Fixed bug in PceEmacs dabbrev_expand, causing the editor to loop
    and be unresponsive.

  • Added Spy menu option to PceEmacs context popup on heads and
    goals.

  • @EricGT enabled PGO compilation for MSVC (producing way slower
    code than GCC in debug mode …). Also fixed an issue in LibBF
    based random number generation.

  • @Peter.Ludemann fixed some issues in the Google Protobufs.

    Enjoy --- Jan
    

SWI-Prolog Changelog since version 10.1.4

  • ENHANCED: Messages to use DCG Name//Arity when applicable.

  • FIXED: QLF compilation: preserve non_terminal predicate_property/2.

  • ADDED: library(tableutil): toplevel utilities This library provides
    toplevel utilities to dump tables, their relations and statistics.

  • PORT: #1481 Removed RETSIGTYPE configuration The CMake config seems
    broken for gentoo using C23. As there are no systems that use
    int for signal handler return value, there is no need for this
    configuration.

  • FIXED: Make compile again for single threaded and WASM targets.

  • CLEANUP: Prolog flag handling. Cleanup the implementation, mostly
    by splitting too large functions. Clarified documentation with
    respect to thread interaction. Added an option local(true)
    to create_prolog_flag/3 which create a flag only for the calling
    thread. Clarified and fixed default behaviour, which is for
    create_prolog_flag/3 to set the flag globally, i.e., make it
    available with this value for any thread. This now updates both the
    local and global flag table (before it updated only the global table).

  • DOC: Use PlDoc for the documentation of library(threadutil)

  • CLEANUP: Move thread_alias/2 to library(thread_util). The core
    functionality is now provided by set_thread/2.

  • ADDED: thread_property/2: debug_mode(-Boolean) property

  • ADDED: Assign threads the notion of a class. This is notably
    intended to control debugging. Possibly this can be extended to
    other features such as memory management policies, termination, etc.
    Future versions may also allow for multiple classes. Related changes

    • Add class(Class) to options of thread_create/3
    • Add class(Class) to thread_property/2 and set_thread/2
    • Add thread_class to PL_thread_attributes_t
    • Allow tdebug/1 and tnodebug/1 to address a class of threads
    • Adapt debugging/0 and threads/0.
    • Adapt the GUI thread monitor.
    • Use classes in main system, Epilog and the HTTP server.

    Practical consequence:

    • Use ?- tdebug(http). to activate debugging in HTTP worker
      threads. This reliably activates spy points in the HTTP server.
  • ADDED: PL_current_prolog_flag(): type PL_BOOL

  • MODIFIED: visible/1: default to include cut_call This shows calls
    to ! in the tracer.

  • FIXED: thread_property/2: system_thread_id on Linux Failed to
    initialize this on systems with the getid() function (primarily Linux,
    but possibly other platforms using glibc).

  • FIXED: Make updateAlerted() thread-safe Could lead to race conditions
    when this function is called from multiple threads (usually the target
    and some external thread).

  • ADDED: prolog:complete_input/4: enhanced CLI TAB completion - Complete
    variables in the query using Emacs dabbrev completion - Complete
    in $Var for saved toplevel variables.

  • BUILD: Fixed PGO compilation for non-MSVC

  • TEST: empty file position tests.

  • CMAKE: Add MSVC support for Profile-Guided Optimization

  • ENHANCED: Message when running the toplevel using initialization/1.

  • FIXED: #1478 LibBF mpz_import() emulation for leading zero-bytes.
    Lead to undefined behaviour in random number generation.

  • UBAN: #1478 Avoid undefined arithmetic on NULL pointer (benign).

  • FIXED: predicate_label/2: avoid importing targets into system.

  • PPA: Fixup generating PPAs for both SDL and non-SDL versions.

Package debian

  • PPA: Dropped libedit. Using bundled version.

Package http

  • ADDED: Set class property for created threads.

Package protobufs

  • CLEANUP: remove absolute path from generated _pb.pl, fix typos

  • TEST: fixed typo that prevent interop test from running

Package xpce

  • ENHANCED: Capture main thread messages to current Epilog using
    hyperlinks.

  • ADDED: PceEmacs Prolog mode: set spy point from goal and head popup.

  • PORT: Removed RETSIGTYPE config Outdates as any reasonable still
    alive system uses void.

  • FIXED: Epilog: Possible access to freed object when closing.

  • ENHANCED: Thread monitor Show more of the status of threads and improve
    popup menu actions. Improve disabling popup entries and add an entry
    to toggle debug mode for classes of threads.

  • ENCHANCED: GUI tracer control.

  • ADDED: Epilog: use thread classes.

  • FIXED: PceEmacs: possible infinite loop in dabbrev_expand.
    editor->dabbrev_expand can loop if a secondary or ternary search
    for candidates only results in candidates that are already rejected
    by the user from earlier candidate searches.

  • ENHANCED: Improve scroll wheel handling. Notably get more natural
    scroll speed on MacOS trackpads

  • FIX: Pass image (not surf) to my_cairo_check_surface in
    ws_load_image_file

  • BUILD: Build in headless mode.

2 Likes

Got this error for 10.1.5 building from source on macOS Tahoue 26.3 Silicon macbook pro, and imac intell 2020). Should I wait for fix ?

Erro log

[2088/2561] Building C object packages/x…plugin_pl2xpce.dir/src/ker/conversion.c.
FAILED: [code=1] packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/ker/conversion.c.o
/usr/local/bin/ccache /usr/bin/cc -Dplugin_pl2xpce_EXPORTS -I/Users/cantor/src/swipl-devel/build/packages/xpce -I/Users/cantor/src/swipl-devel/packages/xpce/src -I/Users/cantor/src/swipl-devel/src/os -I/Users/cantor/src/swipl-devel/src -isystem /usr/local/Cellar/cairo/1.18.4/include/cairo -isystem /usr/local/Cellar/fontconfig/2.17.1/include -isystem /usr/local/opt/freetype/include/freetype2 -isystem /usr/local/opt/libpng/include/libpng16 -isystem /usr/local/Cellar/libxext/1.3.7/include -isystem /usr/local/Cellar/xorgproto/2025.1/include -isystem /usr/local/Cellar/libxrender/0.9.12/include -isystem /usr/local/Cellar/libx11/1.8.13/include -isystem /usr/local/Cellar/libxcb/1.17.0/include -isystem /usr/local/Cellar/libxau/1.0.12/include -isystem /usr/local/Cellar/libxdmcp/1.1.5/include -isystem /usr/local/Cellar/pixman/0.46.4/include/pixman-1 -isystem /usr/local/Cellar/pango/1.57.0_2/include/pango-1.0 -isystem /usr/local/Cellar/harfbuzz/13.1.0/include/harfbuzz -isystem /usr/local/Cellar/graphite2/1.3.14/include -isystem /usr/local/Cellar/glib/2.86.4/include -isystem /usr/local/Cellar/glib/2.86.4/include/glib-2.0 -isystem /usr/local/Cellar/glib/2.86.4/lib/glib-2.0/include -isystem /usr/local/opt/gettext/include -isystem /usr/local/Cellar/pcre2/10.47_1/include -isystem /usr/local/Cellar/fribidi/1.0.16/include/fribidi -isystem /usr/local/Cellar/libthai/0.1.30/include -isystem /usr/local/Cellar/libdatrie/0.2.14/include -I/usr/local/include -I/usr/local/opt/libffi/include -I/usr/local/opt/libedit/include -I/usr/local/opt/libarchive/include -O3 -DNDEBUG -std=gnu11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk -fPIC -fvisibility=hidden -Wall -DHAVE_CONFIG_H -DSWI -D__SWI_PROLOG__ -MD -MT packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/ker/conversion.c.o -MF packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/ker/conversion.c.o.d -o packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/ker/conversion.c.o -c /Users/cantor/src/swipl-devel/packages/xpce/src/ker/conversion.c
/Users/cantor/src/swipl-devel/packages/xpce/src/ker/conversion.c:399:8: error: unknown type name ā€˜RETSIGTYPE’
399 | static RETSIGTYPE
| ^
/Users/cantor/src/swipl-devel/packages/xpce/src/ker/conversion.c:404:22: error: type specifier missing, defaults to ā€˜int’; ISO C99 and later do not support implicit int [-Wimplicit-int]
404 | typedef RETSIGTYPE (*handler_t)();
| ^
| int
/Users/cantor/src/swipl-devel/packages/xpce/src/ker/conversion.c:404:9: error: type specifier missing, defaults to ā€˜int’; ISO C99 and later do not support implicit int [-Wimplicit-int]
404 | typedef RETSIGTYPE (*handler_t)();
| ~~~~~~~ ^
| int
/Users/cantor/src/swipl-devel/packages/xpce/src/ker/conversion.c:404:20: error: function cannot return function type ā€˜int ()’
404 | typedef RETSIGTYPE (*handler_t)();
| ^
/Users/cantor/src/swipl-devel/packages/xpce/src/ker/conversion.c:411:25: error: unknown type name ā€˜handler_t’; did you mean ā€˜Handler’?
411 | set_sighandler(int sig, handler_t func, sigsave_t old)
| ^~~~~~~~~
| Handler
/Users/cantor/src/swipl-devel/packages/xpce/src/h/types.h:99:27: note: ā€˜Handler’ declared here
99 | typedef struct handler * Handler;
| ^
/Users/cantor/src/swipl-devel/packages/xpce/src/ker/conversion.c:415:18: warning: incompatible pointer types assigning to 'void (
)(int)’ from ā€˜Handler’ (aka ā€˜struct handler *’) [-Wincompatible-pointer-types]
415 | new.sa_handler = func;
| ^ ~~~~
1 warning and 5 errors generated.
[2103/2561] Building C object packages/x…es/plugin_pl2xpce.dir/src/ker/goodies.c.
ninja: build stopped: subcommand failed.
%

Seems you did not update the submodules after pulling. Run

git submodule update --recursive

You should always do that after a git pull

1 Like

Thanks for quick quick response. I have inserted the line git submodule update --recursive
into my full build script for SWIPL. It works both for intel mac and silicon macs.

I am getting the following error when building 10.1.5 on arch linux

CMake Error in CMakeLists.txt:
IMPORTED_LOCATION or IMPORTED_IMPLIB not set for imported target
ā€œSDL3::SDL3-sharedā€ configuration ā€œPGOā€.

CMake Error in packages/xpce/CMakeLists.txt:
IMPORTED_LOCATION or IMPORTED_IMPLIB not set for imported target
ā€œSDL3_image::SDL3_image-sharedā€ configuration ā€œPGOā€.

Previous version had no issues building.

Which is the previous version? Did you upgrade arch in the meanwhile? Did you install SDL3 and SDL3_Image packages (development versions)?

Previous version was 10.1.4, and I do have the SDL3 and SDL3_Image packages installed. However, I did update arch. I am going to reboot and try building again. Will update in a few minutes.

Ok. Nothing related changed to SWI-Prolog’s build process. After an OS upgrade it is typically wise to do build and configure from scratch because previous detected dependencies now have different paths due to version upgrades.

Still getting the same issue. Usually I let the aur package handle the updates. Now I tried building from source manually, and I am seeing the exact same error.

Weird. I’m a bit surprised about the configuration ā€œPGOā€ in the error. I do not recall that. Maybe something new in CMake? Which version? Could you try building without PGO enabled?

Without PGO enabled, I am able to build without any issues!

At least that is good. I suspect a CMake change. Which version is installed on your system (cmake --version)? My dev machine (Fedora 43) has 3.31.10.

1 Like

I am using the 4.2.3 version of CMake. That might be the issue!

1 Like

Yes. Commit b9f48137e7b4f8fa87aef141ba34b022de44202f works around this, although I’m afraid I don’t really understand why. I don’t understand the documentation and it seems I’m not the only one … At least for me it now builds on the latest Arch Linux (in a Docker container from archlinux:base-devel)

Same here, on Debian 6.12.74+deb13+1-amd64 CMake 3.31.6. This is with a fresh git clone so there’s nothing left over from previous versions.

CMake Error in CMakeLists.txt:
  IMPORTED_LOCATION or IMPORTED_IMPLIB not set for imported target
  "SDL3::SDL3-shared" configuration "PGO".


CMake Error in packages/xpce/CMakeLists.txt:
  IMPORTED_LOCATION or IMPORTED_IMPLIB not set for imported target
  "SDL3_image::SDL3_image-shared" configuration "PGO".


CMake Error in CMakeLists.txt:
  IMPORTED_LOCATION or IMPORTED_IMPLIB not set for imported target
  "SDL3::SDL3-shared" configuration "PGO".


CMake Error in packages/xpce/CMakeLists.txt:
  IMPORTED_LOCATION or IMPORTED_IMPLIB not set for imported target
  "SDL3_image::SDL3_image-shared" configuration "PGO".


-- Generating done (0.3s)
CMake Generate step failed.  Build files cannot be regenerated correctly.

Is this completely up-to-date? I.e., are you at commit b9f48137e7b4f8fa87aef141ba34b022de44202f? That patch fixed this issue for Arch Linux.

There is no need for fresh clones. The build does not write outside the directory in which you are building (except if you install as well of course). So, just delete the build directory and all is clean again.

I’ve tried this but it fails elsewhere, in something SDL-related. Debian 6.12.74+deb13+1

libsdl-image1.2/stable,now 1.2.12-14 amd64 [installed]
libsdl-ttf2.0-0/stable,now 2.0.11-6+b2 amd64 [installed]
libsdl1.2debian/stable,now 1.2.68-3 amd64 [installed,automatic]
libsdl2-2.0-0/stable,now 2.32.4+dfsg-1 amd64 [installed]
libsdl3-0/stable,now 3.2.10+ds-1 amd64 [installed,automatic]
libsdl3-dev/stable,now 3.2.10+ds-1 amd64 [installed]
libsdl3-image-dev/stable,now 3.2.4+ds-1 amd64 [installed]
libsdl3-image0/stable,now 3.2.4+ds-1 amd64 [installed,automatic]
[2234/2600] Building C object packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/sdl/sdlevent.c.o
FAILED: packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/sdl/sdlevent.c.o 
/bin/cc -Dplugin_pl2xpce_EXPORTS -I/data2/tmp/swipl-devel-10.1.5/build/packages/xpce -I/data2/tmp/swipl-devel-10.1.5/packages/xpce/src -I/data2/tmp/swipl-devel-10.1.5/src/os -I/data2/tmp/swipl-devel-10.1.5/src -isystem /usr/include/cairo -isystem /usr/include/libpng16 -isystem /usr/include/freetype2 -isystem /usr/include/pixman-1 -isystem /usr/include/pango-1.0 -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /usr/include/sysprof-6 -isystem /usr/include/harfbuzz -isystem /usr/include/libmount -isystem /usr/include/blkid -isystem /usr/include/fribidi -O3 -gdwarf-2 -g3 -std=gnu11 -fPIC -fvisibility=hidden -Wall -DHAVE_CONFIG_H -DSWI -D__SWI_PROLOG__ -pthread -MD -MT packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/sdl/sdlevent.c.o -MF packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/sdl/sdlevent.c.o.d -o packages/xpce/CMakeFiles/plugin_pl2xpce.dir/src/sdl/sdlevent.c.o -c /data2/tmp/swipl-devel-10.1.5/packages/xpce/src/sdl/sdlevent.c
/data2/tmp/swipl-devel-10.1.5/packages/xpce/src/sdl/sdlevent.c: In function ā€˜CtoEvent’:
/data2/tmp/swipl-devel-10.1.5/packages/xpce/src/sdl/sdlevent.c:374:28: error: ā€˜SDL_MouseWheelEvent’ has no member named ā€˜integer_y’
  374 |       int dy = event->wheel.integer_y;
      |                            ^
In file included from /data2/tmp/swipl-devel-10.1.5/packages/xpce/src/sdl/sdlevent.c:36:
/data2/tmp/swipl-devel-10.1.5/packages/xpce/src/sdl/sdlevent.c:378:49: error: ā€˜SDL_MouseWheelEvent’ has no member named ā€˜integer_y’
  378 |                     event->wheel.y, event->wheel.integer_y, time-last_time,
      |                                                 ^
/data2/tmp/swipl-devel-10.1.5/packages/xpce/src/h/kernel.h:1848:37: note: in definition of macro ā€˜DEBUG’
 1848 |                                   { goal; \
      |                                     ^~~~
[2247/2600] Building CXX object packages/cpp/CMakeFiles/plugin_test_cpp.dir/test_cpp.cpp.o
ninja: build stopped: subcommand failed.

I’m working my way through the thread :wink: I’ve rebuilt with that commit, but (cmake version 3.31.6):

CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.

CMake Error: The source directory "/data2/tmp/swipl-devel-HEAD/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

I updated Debian yesterday, I’ll try what was a previously successful build of 10.1.3 to make sure that’s not due to the upgrade.

Yeah I know, but I don’t keep the tree between builds anyway, so it’s always a fresh clone.

:frowning: event->wheel.integer_y is introduced in SDL 3.2.12. That patch was needed to make trackpad scrolling behave properly. Pushed a new version where we emulate this. Not perfect, but hopefully good enough. Version 1a00ab1213592f52dba8702dcf8969dc33cc2a3

1 Like

Bingo - clean build :smiling_face:

FYI, I checked previous release builds, the last one that worked for me was 10.1.3.

2 Likes