Installing XPCE Prolog in Ubuntu

One of my current coding projects at UBC right now is designing a program to help someone play the board game Clue (aka. Cluedo). I can't give away any of the implementation details because part of our grade will depend on how well our program helps us play against the other teams, but I just wanted to share how I got XPCE (the graphical user interface library for Prolog) to work under Ubuntu as it doesn't by default. I did find some help online but it took me a while to understand what this guy meant when he explained the fix. Hopefully I can clear up how to do it.

Here's what he said:
Some of these intallations rename the pl executable. SWI-Prolog however loads a system init file called .rc in the Prolog home dir (typically /usr/lib/pl-). After renaming pl this file needs to be renamed accordingly. And, of course, you need to be running X11 ...
 This is what it means:

The command that starts the Prolog command line interpreter gets renamed by installing XPCE. And XPCE looks for a .rc file that has the same name as the new command. The old .rc file however doesn't get renamed by the install and so the whole thing doesn't work.

The easy fix is just to go to the directory that contains all the Prolog and XPCE libraries (mine is /usr/lib/swi-prolog) and rename the *.rc file to the new command (the new command for me happened to be prolog).

When I looked in my Prolog library directory I found 2 .rc files, swipl.rc and xpce.rc. It's confusing but except for the name they we're exactly the same (how to diff). Because of all the duplication and the searching for wrong file names I didn't feel like changing either of their names in case some other package needed either of them and just created a prolog.rc symlink to swipl.rc. Problem solved.

I have no idea why someone hasn't fixed this for Ubuntu as the equivalent packages under Arch Linux work out of the box but I hope this helps.

0 comments:

Post a Comment