Evaluation binaries for new XPCE+SDL based GUI

This directory has been removed as these features are in SWI-Prolog 9.3.26

I have uploaded preview installers for Apple, MacOS and Linux flatpak to https://www.swi-prolog.org/download/SDL/

Anyone interested in the future of the development tools and GUI is invited to checkout these versions. Primary topics I am primarily interested in are:

  • Does it install?
  • UI functionality of the “app”. Please also check the popup in the terminal. I pruned the menus a lot. Probably too much. Which options should be added?
  • Stability.
  • General impression

Note that the functionality is now pretty much the same on all platforms.

If you prefer building from source:

  • Take the branch sdl from swipl-devel.git
  • Configure using -DEPILOG=ON
  • Dependencies are SDL3, SDL3_image, cairo, pango and libedit. That is in addition to the old dependencies. The X11, jpeg and xpm dependencies are no longer needed.
    • On Debian based systems, these are libcairo2-dev, libpango1.0-dev and libedit-dev while SDL3 and SDL3_image must be build from source on most distros. If you have a very recent one you might have them.
  • The gui executable is swipl-win

The Mac install seems to be missing the GMP library (hard coded path?) . Using console:

$ swipl
dyld: Library not loaded: /Users/jan/deps/lib/libgmp.10.dylib
  Referenced from: /Applications/SWI-Prologsdl9.3.25.app/Contents/Frameworks/libswipl.9.3.25.dylib
  Reason: image not found
Abort trap: 6

Using bundled app:

Process:               SWI-Prolog [95340]
Path:                  /Applications/SWI-Prologsdl9.3.25.app/Contents/MacOS/SWI-Prolog
Identifier:            org.swi-prolog.app
Version:               9.3.25
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           SWI-Prolog [95340]
User ID:               501

Date/Time:             2025-07-17 10:09:56.716 -0400
OS Version:            Mac OS X 10.14.6 (18G9323)
Report Version:        12
Anonymous UUID:        0E64E3EA-0024-1BF1-12FE-14BA575B1E40


Time Awake Since Boot: 2600000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /Users/*/libgmp.10.dylib
  Referenced from: /Applications/SWI-Prologsdl9.3.25.app/Contents/Frameworks/libswipl.9.3.25.dylib
  Reason: image not found
1 Like

Oops. Thanks. I’ll have a look at that.

1 Like

Ok. I can now run the app after moving my deps directory. Please try downloading again. The file is now swipl-9.3.25-sdl-2.fat.dmg (note the 2).

The terminal console version now launches:

$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.3.25-44-gc2ffbe14f-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).

1 ?- [library(editline)].
true.

With this all the old terminal functionality is back (history, tab completion, extended characters) without the -Dno-readline command line option. In fact, if you include the option, it complains when processing init.pl

ERROR:    set_prolog_flag/2: Type error: `bool' expected, found `readline' (an atom)

and

Warning:    Goal (directive) failed: user:set_prolog_flag(readline,readline)

Just an observation; not a problem.

The bundled app still doesn’t work for me but I’m running on an old version of MacOS so my expectations are low:

Process:               SWI-Prolog [96055]
Path:                  /Applications/SWI-Prolog9.3.25sdl2.app/Contents/MacOS/SWI-Prolog
Identifier:            org.swi-prolog.app
Version:               9.3.25
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           SWI-Prolog [96055]
User ID:               501

Date/Time:             2025-07-17 12:11:15.605 -0400
OS Version:            Mac OS X 10.14.6 (18G9323)
Report Version:        12
Anonymous UUID:        0E64E3EA-0024-1BF1-12FE-14BA575B1E40


Time Awake Since Boot: 2600000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [96055]

VM Regions Near 0:
--> 
    __TEXT                 0000000108f59000-0000000108f5a000 [    4K] r-x/r-x SM=COW  /Applications/SWI-Prolog9.3.25sdl2.app/Contents/MacOS/SWI-Prolog

Application Specific Information:
dyld2 mode

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_platform.dylib      	0x00007fff71e2a6f2 _platform_strlen + 18
1   libswipl.9.3.25.dylib         	0x0000000109047393 PL_new_atom + 51
2   libswipl.9.3.25.dylib         	0x000000010903d414 outOfStack + 692
3   libswipl.9.3.25.dylib         	0x000000010903da75 raiseStackOverflow + 117
4   libswipl.9.3.25.dylib         	0x0000000109095851 PL_open_foreign_frame.cold.1 + 33
5   libswipl.9.3.25.dylib         	0x0000000108f617f9 PL_open_foreign_frame___LD + 137
6   libswipl.9.3.25.dylib         	0x000000010908797c checkPrologFlagsAccess + 76
7   libswipl.9.3.25.dylib         	0x000000010900dc8e PL_cleanup + 62
8   libswipl.9.3.25.dylib         	0x0000000109053548 PL_halt + 88
9   org.swi-prolog.app            	0x0000000108f59e52 main + 82
10  libdyld.dylib                 	0x00007fff71c423d5 start + 1

%%% etc.

Note that this is still an improvement (IMO) over the QT version where it wasn’t even recognized by the OS as an executable bundle.

At least for me, you don’t need this. It is loaded automatically.

MacOS 10.14.6 is long out of service … The MACOSX_DEPLOYMENT_TARGET is set to 10.15, though I doubt such old versions will work. The stack seems mostly bogus :frowning:

Nice that the commandline version improved a bit. The app is about the GUI version though.

These seem to be MacOS dependencies (at least, none of them seem to exist for Debian) … what are the corresponding Debian dependencies?

The existing ones (for Debian Bookworm) are libcairo2-dev, libpango1.0-dev and libedit-dev. Debian does not have SDL3. You’ll need to build that. You can deduce the build instructions from the flatpak spec I wrote yesterday and which you can find at org.swi_prolog.swipl/org.swi_prolog.swipl.yml at 40b094d295911aa4ebaa9196f910c6b7f70abbec · JanWielemaker/org.swi_prolog.swipl · GitHub. That gives you the download locations, version and CMake options to configure these packages.

The trouble is that SDL3 is just out and it seems a bad idea to start a new project on SDL2. The functionality is not widely different, but SDL3 revised the entire C API for consistency in naming and types and adopting modern C standards and practices. Something I have been thinking about for SWI-Prolog as well. As we see, such a move has severe consequences on other projects :frowning:

On the other hand, there is a library that lets most SDL2 code run on SDL3, but AFAIK not the other way around …

Agree. (Historical artifact in my local init.pl was causing the problem.)

I might be wrong but I recall the reason for moving the target up to 10.15 was to accommodate an upgrade in Qt, which is a bit ironic given that Qt is being removed. In any case, at that point, I moved to the commandline version and, after a short learning curve, decided that the GUI version wasn’t really providing me with much additional value.

Note that the commandline version has always worked so, at least for that, I don’t share your skepticism that “old versions” of MacOS won’t work, unless there’s something in the new libraries that is incompatible. I won’t get into the reasons I don’t chase Apple’s OS upgrades, but I don’t expect you to support my perhaps idiosyncratic configuration.

Understood. I’m primarily interested in ensuring that the commandline version continues to work as before. I haven’t done a lot of testing but one obvious feature that no longer works is profile/1 since it opens an X-Window (via Quartz). (For now, 9.2.9 seems to be my best option since it also has an optimized version for Intel Macs.)

Something else that doesn’t work in commandline version:

?- sleep(10).
^CAction (h for help) ? abort
ERROR: [Thread main] [Thread 1]: exception handler failed to define pce_principal:send/2
ERROR: [Thread main] [Thread 1]: exception handler failed to define pce_principal:send/2
ERROR: [Thread main] message_hook/3: Unknown procedure: pce_principal:send/2
ERROR: [Thread main]   However, there are definitions for:
ERROR: [Thread main]         pce_principal:send/3
ERROR: [Thread main]         pce_principal:send/4
ERROR: [Thread main]         pce_principal:send/5
ERROR: [Thread main]         pce_principal:send/6
ERROR: [Thread main]         pce_principal:send/7
ERROR: [Thread main]         pce_principal:send/8

True. I left the deployment target as is though. Possibly it can be set to older versions. Building the (fat) dependencies is a lot of work though that requires a lot of manual tweaks and a lot of patience. I’d rather update your Mac for you :slight_smile:

Running the commandline version as swipl --no-pce ... as fix that.

The new GUI versions should also provide some useful stuff, such as clickable errors and warnings :slight_smile: If you have Macports or Homebrew still working, building from source should be feasible.

I’d upgrade myself if I didn’t run the risk of breaking some existing app. That’s why I’ve taken an “If it ain’t broke…” approach. SWIP isn’t sufficiently broke (yet).

This actually also fixes the ERROR hell when you try to profile anything, so that’s a good suggestion. The only issue is that the text only version of show_profile/1 is a (very) pale imitation of what the the X-Window version provides (call chains, full port counts, sampling stats, “browsing” capability to name a few).

Maybe, if I get really desperate (v9.2.9 is just fine for now), but I’ve never built an app bundle before. (To be honest, I’d probably try this before upgrading the OS if I had any assurance that the new libraries were MacOS 10.14 compatible.)

I have just tested the flatpack version it is really nice.
I don’t understand why, but the colorscheme is black in xpce ?


Is this because I am using a dark system theme ?
Because of the dark theme, selections is often invisible, for example in the profiler.

I did not have a single crash in the small amount of testing I have done.

:heart:

Yes, it listens to SDL_GetSystemTheme(). You should be able to add -Dtheme=light and possibly you can use

 :- set_prolog_flag(theme, light).

in init.pl (unsure about the timing).

I’m doing some work on improving the dark theme. It seems to many people use it these days that it is worthwhile to make it good. A list of issues would be great. The work in progress is mostly at the xpce level to make the theme adjustment more fine grained where needed. The actual theme declarations are in library(theme/dark). Note that you can clone the dark theme to your personal library and adjust it. Please share the improvements. My eyes do not like dark theme …

I pushed several patches to make the profiler behave at least mostly fine under the dark theme. Didn’t update the installers, so you have to build from source. I know you can do that :slight_smile: Take the sdl branch for both Prolog and xpce. Using -DEPILOG=ON when configuring. Then src/swipl-win is the same as what the flatpak runs.

I now have MacOS 10.15 on a separate boot volume. Unfortunately it behaves exactly the same as 10.14 (see below).

I guess the open question is what is the minimum version pf MacOS required? (And why?) Is it the same for Intel and Apple silicon?

Process:               SWI-Prolog [1262]
Path:                  /Applications/SWI-Prolog9.3.25sdl2.app/Contents/MacOS/SWI-Prolog
Identifier:            org.swi-prolog.app
Version:               9.3.25
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           SWI-Prolog [1262]
User ID:               502

Date/Time:             2025-07-19 11:16:02.586 -0400
OS Version:            Mac OS X 10.15.7 (19H2026)
Report Version:        12
Anonymous UUID:        C3CD1E1E-AE54-228F-4B72-452C6FCC20D6


Time Awake Since Boot: 890 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [1262]

VM Regions Near 0:
--> 
    __TEXT                 0000000100013000-0000000100014000 [    4K] r-x/r-x SM=COW  /Applications/SWI-Prolog9.3.25sdl2.app/Contents/MacOS/SWI-Prolog

Application Specific Information:
dyld2 mode

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_platform.dylib      	0x00007fff72d79e52 _platform_strlen + 18
1   libswipl.9.3.25.dylib         	0x0000000100107393 PL_new_atom + 51
%% etc.

Good question. I compiled the libraries for Intel on MacOS 14 (15 does not run on Intel Macs). The deployment target is set to 10.15 and all compiled fine. I verified that it runs on an Intel MacOS 14 system as well.

The other obvious question is ok, you do not want to upgrade from 10.14, so you install a new version in a new partition. Why not install the most recent version that can run on your hardware?

Another useful datapoint: SDL version runs on Intel MacOS 14 and Apple MacOS15 (and, I would guess, MacOS 14 as well). That would seem to point to the OS version as the issue (although I suppose the build tools can’t be completely eliminated as a possible cause). If I was more comfortable with building the bundled app from source directly on my config, that would be an interesting experiment to try.

It’s a bit curious, to me anyway, that on my older 10.14 system, the OS could detect incompatibility with the Qt bundle and not even allow you to launch, whereas the SDL version was deemed compatible (in some sense) but crashed after launching. But as noted previously the commandline version seems to work well.

Well in the middle of this discussion I remembered I had an older install of 10.15, which I probably did around the time of the Qt upgrade. I did so to assess how many of my existing apps were broken by the upgrade as well as to test the upgraded version of SWIP at that time.

I believe the latest MacOS version that will run on my hardware is MacOS 12 so a few years old at this point. And I guess I’ve pretty much committed to using the commandline version of SWIP for the foreseeable future, so upgrading further isn’t any further benefit to me that I can see, other than providing another data point for this discussion.

There probably aren’t very many MacOS users who have this issue so I don’t expect any resolution (or additional effort), but it still would be nice to know the minimum MacOS requirement.

Possibly the Info.plist file claimed the requirement of 10.15? That file was populated by the Qt install scripts. The current version is hand crafted and might be lacking of of this stuff. If we would know which version is required, we could consider adding this info. As we do not know, there is not much point …

You could try that …, though MacOS 12 is also EOL :frowning:

You best option would be to compile from source. But, you need C11 and I’m not sure the old version of Xcode supports that …

I’d install Linux on the hardware. Then you get a recent version and it will probably be a lot faster :slight_smile:

Not worth the trouble. I don’t use Xcode for anything else.

Yikes! You must think I only use this machine for SWIP. It really is my only computer.