SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


PDT - Platform Notes

General Note

The PDT should run on any platform that supports Eclipse and SWI-Prolog. It is our expressed goal to make sure reality does not fall to far behind theory. On this page, we keep track on platform specific issues that should arise despite our efforts. If you run into Problems, please don't hesitate to contact us

Locating the SWI-Prolog executable

By default, the PDT-Runtime plugin relies on the platforms ability to search a predefined list of directories for a given executable. Usualy this list is given by an environment variable PATH. To see if PATH is set properly, open a terminal window and try to start Prolog. On Unix (Linux, MacOS, etc.) type

    xpce

On Windows type

   swipl-win

If your path is set-up correctly, SWI-Prolog should start.

Explicitly Locating the Executable

On some platforms, e.g. on the MacOS, the the value of the PATH environment variable seems to be ignored. You can work arround the problem by manually setting the absolute path to the executable in the PDT Preferences.

You need to give the full absolute path to your executable. For example on my linux box at home this would be /usr/local/bin/xpce. On most unix flavours (including MacOS X), you can find out the exact location by typing

    which xpce

in a terminal window, provided that the executable is on PATH.

XPCE

SWI-Prolog comes with a gui toolkit called XPCE. Most of the developer tools integrated in SWI-Prolog, including the (excellent!) graphical debugger and the online manual use this library, so naturally you want it to work on your system.

On Windows systems, this should work out-of-the-box. Most Unix flavours shouldn't pose a problem either, as long as they run an X-Server.

XPCE and and X-Server on MacOS 10.x

Note that Apple's X-Server is not installed by default. If you are running OS 10.3 or better it should however be included on your MacOS Install DVD. For earlier versions of MacOS, you have to download it from somewhere, but it should not be much of a problem either.

Bear in mind that XPCE relies on the DISPLAY environment variable being set (usually to something like :0.0 or :1.0 iirc.). Start the X-Server, open a terminal, and do

    export DISPLAY=:0.0
    xpce -g help
			

If everything works out, you should see the SWI-Prolog online manual pop up.

Foreign Predicates (Prolog Console)

The directory

{eclipse}/plugins/org.cs3.pdt.console_0.1.2/pl

contains the C source and binaries for the shared object stream_decorator (a euphemism :-) ). The stream_decorator library is used by the PDT's Prolog Console to hook into the input stream of the console and check if a particular read request was triggered by a call to the get_single_char/1 build-in. Currently this is just some hacking to solve a simple but annoying problem. (Any suggestions on how to do this more elegantly are highly appreciated!) In most cases, the included binaries should work out-of-the-box. If this does not work for what reasons ever, or if you need to make modifications to the C source, here is a short description of how to rebuild the binaries from source.

On Windows

  • you need nmake and some flavour of msvc. I'm not sure where to get it. Here in the department, everything required is installed on Gorbag (A108) and Palantir (A109).
  • you need to find out the path where swi-prolog is installed.
  • check the file rules.mk. You will have to adapt a couple of path variables to match your system.
  • open a command prompt, change into this directory and do
    	
    nmake -f Makefile.windows clean
    nmake -f Makefile.windows
    This should create (among other garbage) the file stream_decorator.dll.

On Linux

  • you need gnu make (or something equivalent) and some flavour of gcc. (Most Linux distributions ship with it)
  • you need to find out the path where SWI-prolog is installed.
  • check the file Makefile.linux. You will probably have to change the include path (the -I flag somewhere at the bottom) to point to the include directory of your SWI-prolog installation.
  • open a terminal, change into this directory and do
    make -f Makefile.linux clean
    make -f Makefile.linux 
    		
    This should create (among other garbage) the file stream_decorator.so.

On MacOS 10.x

All the tools necessary to build the library are included in the Xcode suite, which I think is shipped together with MacOS X. I do not now whether you have to install the whole suite (seems rather large). Apart of that, the procedure is much like in the Linux-case above. Just use Makefile.macos instead of Makefile.linux.

research/pdt/docs_archive/v0.x/platform_notes.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2025