Using SWI-Prolog on Linux on a Windows machine

  1. Have you tried using WSL 2?
    With WSL 2 you install a version of Ubuntu and then install SWI-Prolog (PPA) on top of that. I have done this many times and had no problems.

  2. Currently I am learning how to build my own WSL Distro of SWI-Prolog. (ref)

  3. Install Docker Desktop for Windows and use SWI-Prolog from Docker Hub. Note this is currently at version 8.2.2 which is not the latest build of SWI-Prolog.

Note: For any of the three options above, if you want to use a SWI-Prolog GUI tool such as gtrace/0 then you will also need to install an X Windows server (VcXsrv).

If you are a developer then take a look at also using Windows Terminal and Visual Studio Code with the remote extensions.

HTH

Dear Eric
You are right about wsl, but I have a desktop and a laptop running win10 and a whole set of data and tools. Swi+real (before 8.2) worked well with R and it would be a lot of work to move everything to wsl or Ubuntu.
Swi 8.2 + real works well with R 4.03 on a fresh pc under win10.
I can’t believe that an update over previously installed version doesn’t work.
I just try to make it work on my laptop without buying a new one…

Please help
Thank you in advance

Jab
pja@a2m2.ch
[ mobile ]

I have not tried this.

Instead of using WSL 2 with Ubuntu, you might be able to pull down a Windows Image from Docker Hub and build SWI-Prolog and R on top of that.

HTH


EDIT

You might have to use the Windows image with in a Windows container as opposed to a WSL 2 mode or Linux container in Hyper-V mode. (ref).

In other words, if you try to run a Windows image on an Ubuntu base machine it would fail, but with a Windows image on a Windows machine, the Windows image is using the license of Windows on the base machine and so allowed.

I can confirm that Real under Windows is no joy (tried it about 1 year ago), so I ended up with the “linux” swipl under WSL2, plus R support from package rserve_client.

1 Like