Version 16 (modified by ke, 6 years ago) (diff)

additional note about SICStus versions

Installing Kahina for TRALE

Installing SICStus Prolog with Jasper

TRALE requires SICStus Prolog, so you need to buy a license and install it if you have not done so already.

TRALE itself currently supports SICStus Prolog 3 (SP3) and, experimentally, SICStus Prolog 4 (SP4). The Kahina-based graphical debugger that is included with TRALE, however, only supports SP4 in its most recent version. So if you want to use it with SP3, you will need an older version of TRALE. More specifically, you should use revision 260 from TRALE's Subversion repository (see below). To use it with SP4, you will need at least revision 265.

Kahina for TRALE also requires that the existing installation of SICStus Prolog include the Prolog-Java interface Jasper, set up with a version 6 or higher Java Development Kit (JDK).

You may have to modify your LD_LIBRARY_PATH before installation to ensure SICStus Prolog can find Under Ubuntu 13.04, I added this line to my ~/.bashrc:

export LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/client:$LD_LIBRARY_PATH

The successful installation then looked like this (a successful run of the SP4 installation script looks similar):

ke@apis:~/install/sp-3.12.11-x86-linux-glibc2.5$ ./InstallSICStus --all-questions
		      SICStus Prolog Release 3
	       Binary Distribution Installation Script

This script will install SICStus Prolog 3.12.11 on your computer. Before
proceeding, make sure that you have downloaded the correct
distribution and that you have your licensing information at hand, as
you will be prompted for site-name, license code, and expiration date
during the installation.

It is also recommended that you read the Release Notes before installing
SICStus Prolog. The Release Notes can be found online at

During the installation, a cache-file (install.cache) will be created
which will store your answers to be used as defaults if you need to
run the installation script again. You may safely delete this file if
you wish.

The installation script will ask a couple of questions regarding the
installation. Most of these questions have a default alternative in
square brackets ([]). Pressing return will give you the default
answer. If you do not understand the question, the default answer will
usually do what you want.

Note: You must have Perl installed and available in your PATH. Perl is
      available for free from Typically Perl is already

Report bugs and other problems to SICStus Support using

Install SICStus Prolog 3.12.11 [yes] ? 

Checking installation cache... install.cache

Where do you want to install SICStus [/home/ke] ? 

Creating uninstall script...
Decrypt key [xxxxxxxxxxxx] ? 

You should now enter your site-name, license-code, and expiration date.

Sitename [Kilian Personal] ? 
License-code [xxxx-xxxx-xxxx-xxxx-xxxx] ? 
Expiration date [permanent] ? 
Install the pre-built binaries (chose "no" for full installation, or "help") [no] ? 

The script will now ask you for some information about external
software packages. If you leave the answers blank, the script will try
to determine the information automatically.

Do you wish to install the Tcl/Tk interface (library(tcltk)) [no] ? 

Do you wish to install Jasper (the Java interface) [yes] ? 
For the Java interface you should now specify the 'installation path' of
the Java installation. E.g. if the path to the java compiler is
/usr/local/jdk/bin/javac, the 'installation path' is probably /usr/local/jdk.
Note that this is somewhat platform dependent. In case of problems you should
consult the installation instructions for your Java installation to find out
what the 'installation path' is.
Specify JDK installation path, e.g., /usr/jdk1.2.2 (or leave blank) [/usr/jdk1.2.2] ? /usr/lib/jvm/java-7-openjdk-i386

(This information is displayed regardless of the JDK installation path specified.)
NOTE: About JDK 1.3.X and later

Read *important* compatibility information in the release notes
in Section "Supported Java Versions".

NOTE: About Java location.

By default the location of Java is embedded in the SICStus development
system executable (sicstus) or the jasper foreign resource. This makes
it possible for library(jasper) to find the Java libraries (e.g., without setting LD_LIBRARY_PATH. See the release

Embed JDK paths for library(jasper) (recommended) [yes] ? 

Do you wish to install the Berkeley DB module (library(bdb)).  [no] ? 
Specify the path to your C compiler (or leave blank) ? 
Specify the path to your C++ compiler (or leave blank) ? 

The installation will proceed without further user interaction,
unless there are errors.

Configuring system. This may take a few minutes...  done.
Installation package was built for Glibc 2.5.
This systems uses Glibc 2.17.
SICStus is built and distributed for several versions of Glibc.
If there is a version of the SICStus installation package
corresponding to the version of Glibc installed on your machine,
you should use that installation package.
Attempt an installation anyway [no] ? yes
Continuing despite wrong Glibc version...

Decrypting sicstus.tar.compress.crypt... 
Unpacking sicstus.tar... (please wait) ok.

Copying files to /home/ke. This may take a few minutes...  Installing documentation into /home/ke/lib/sicstus-3.12.11

Creating development system symlinks...

Creating development system binary...

Creating copies of SICStus run-time for multiple run-time support

Creating spdet and spxref...

Creating save-dumps...

Compiling license file...

Performing final link step for the Jasper module...
Linking ok.
Linking jasper.s.o... ok.
Creating ok.

Completing uninstall info...

Cleaning up... 

Installation complete.

The SICStus development system has been installed as:

The documentation can be accessed locally by opening the URL:


or on the SICStus website:

Uninstall by running /home/ke/install/sp-3.12.11-x86-linux-glibc2.5/UnInstallSICStus

Obtaining TRALE

Current versions of TRALE contain Kahina as well as the Prolog code to connect TRALE's source-level debugger to Kahina. If you have access to TRALE's Subversion repository, you can obtain the latest version from there. If you need to use the graphical debugger with SICStus Prolog 3, check out revision 260. If SICStus Prolog 4 is available to you, check out revision 265. More recent versions of TRALE are not yet supported (see issue #133). If you do not have access to the repository, ask for an archive of the appropriate revision and unpack it.

Using TRALE with the distributed version of Kahina

Assuming a Unix-like environment (counting Cygwin on Windows), you start TRALE by running the trale script found in the trale directory of the TRALE distribution. Before running it, make sure that the environment variable TRALE_HOME is not set or set to the path of the trale directory that contains the up-to-date version you wish to use.

Using TRALE with a development version of Kahina

To always use the latest and greatest version of Kahina and use new features as soon as they are added, you need a Subversion client and Ant installed. Use the following command to obtain a development version of Kahina:

svn checkout kahina
cd kahina

This will create a directory called kahina in the current directory, containing the Kahina sources, and compile them.

Every time you want to update Kahina to the latest version, run the following from the kahina directory.

svn update

To tell TRALE to use the development version, start it with the environment variable KAHINA_TRUNK set to point to the kahina directory, e.g. like this:

export KAHINA_TRUNK=/home/ke/workspace/kahina

If you always want to work with the development version, you can include the first line in your shell's startup script. To use the version distributed with TRALE again, just unset KAHINA_TRUNK, like this:


First steps

Before starting TRALE, you need to make sure that TRALE will be using SP4. (This is because SP3 is currently still supported by TRALE, but not by its graphical debugger.) To do so, either make sure that the command sicstus will start SP4, or set the environment variable SICSTUS to a command that will start SP4.

After starting TRALE using trale, activate the debugger by setting the debugger flag to on:


You can try if it works by using the predicates dcompile_gram/1 to compile a TRALE grammar and drec/1 to parse a sentence, or (experimentally) dquery/1 to resolve a query in the ALE programming language. Each of these commands should bring up the Kahina GUI (you can read more about their function and usage in the TRALE documentation). Alternatively, you can just ask the following query:


This will start the GUI but make the Prolog prompt inaccessible, in return giving you the possibility to start compilation processes and parsing via the Parse menu in the GUI. Closing the GUI will return you to the Prolog prompt. You can do this at any time while debugging, resulting in the abortion of the current compilation/parsing/query resolution process.

Using TRALE's XEmacs-based debugger

TRALE's Kahina-based source-level debugger is the successor of an older XEmacs-based source-level debugger, which is still available by setting the TRALE_DEBUGGER environment variable to xemacs before starting TRALE, like so:

export TRALE_DEBUGGER=xemacs