wiki:InstallQType

Installing Kahina for QType

Installing a version 6 Java Development Kit (JDK)

If you don't have it already, you need to install a version 6 Java Development Kit.

Installing SICStus Prolog 3 with Jasper

If you have not already done so, you need to buy and install SICStus Prolog 3 (SP3), with support for the Prolog-Java interface Jasper, set up with your version 6 Java Development Kit (JDK). Under Linux, a successful run of the installation script looks something like this:

ke@apis:~/install/sp-3.12.10patch1-x86-linux-glibc2.3$ ./InstallSICStus --all-questions
				   
		      SICStus Prolog Release 3
		      ========================
				   
		      http://www.sics.se/sicstus/
				   
	       ---------------------------------------
	       Binary Distribution Installation Script
	       ---------------------------------------

This script will install SICStus Prolog 3.12.10patch1 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

	     http://www.sics.se/sicstus/docs/

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 www.cpan.org. Typically Perl is already
      installed.

Report bugs and other problems to SICStus Support using

	 http://www.sics.se/sicstus/bugreport/bugreport.html


Install SICStus Prolog 3.12.10patch1 [yes] ? 

Checking installation cache... install.cache

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

The target directory seems to already contain a SICStus installation. You can
choose between cancelling the installation ('cancel'), overwriting the
installation entirely ('overwrite'), or skip copying the files but
(re-)do the dump and link steps ('link'). 

Note: if you use the 'link' option, no new uninstall-script will be created.

Overwrite existing installation [overwrite] ? 

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

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

Sitename [Kilian Evang on Linux] ? 
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) [/home/ke/opt/jdk1.6.0_22] ? 

(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.,
libjvm.so) without setting LD_LIBRARY_PATH. See the release
notes.

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) ? 

sicstus.tar.compress.crypt seems to have been unpacked already. Unpack anyway [no] ? 

***************************************************************
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.3.
This systems uses Glibc 2.11.
 
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...

Copying files to /home/ke/opt/sicstus. This may take a few minutes...  Installing documentation into /home/ke/opt/sicstus/lib/sicstus-3.12.10patch1
done.

Creating development system symlinks...

Creating development system binary...
done.

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

Creating spdet and spxref...
done.

Creating save-dumps...
done.

Compiling license file...

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

Completing uninstall info...

Cleaning up... 

Installation complete.

The SICStus development system has been installed as:
   /home/ke/opt/sicstus/bin/sicstus

The documentation can be accessed locally by opening the URL:

   file:/home/ke/opt/sicstus/lib/sicstus-3.12.10patch1/doc/html/

or on the SICStus website:

   http://www.sics.se/sicstus/docs/

Uninstall by running /home/ke/install/sp-3.12.10patch1-x86-linux-glibc2.3/UnInstallSICStus

Obtaining and Installing Kahina

There are two possibilities:

1) The pre-release version packaged as a JAR

You received or downloaded the pre-release Kahina for QType as a JAR file. You can put this file anywhere you like. Under Linux, a default choice is $HOME/opt/kahina where $HOME stands for the path to your home directory. Under Windows, uh, how about C:\Program Files? In order for Prolog to find Kahina, the JAR file must be added to the environment variable called CLASSPATH. Under Linux, this is most typically done by adding the following line to the file named .bashrc in your home folder (adapt the path to match your setup):

export CLASSPATH=/home/ke/opt/kahina/kahina-qtype.jar:$CLASSPATH

Note that you need to start a new shell before this takes effect. If you want to use SP with Kahina from a GUI, e.g. from SPIDER, you might want to log out and back in to be sure.

For other operating systems, please refer to the documentation on how to set environment variables.

2) The most recent version from the repository

If you want to have the newest version, you will need to check it out from the code repository. This process will create a directory named kahina, which you can again put anywhere you like. You need a Subversion client and Ant installed. With the former, you donwload Kahina's source code and with the latter, you compile it. For example, if you are on Linux and want your Kahina installation to reside in $HOME/opt/kahina, you do the following in a shell:

cd ~/opt
svn checkout https://github.com/texttheater/kahina kahina
cd kahina
ant

In order for Prolog to find Kahina, the bin subdirectory of the checked-out kahina directory as well as certain JAR files in the lib subdirectory must be added to the environment variable called CLASSPATH. Under Linux, this is most typically done by adding the following line to the file named .bashrc in your home folder (adapt the paths to match your setup):

export CLASSPATH=/home/ke/opt/kahina/bin:/home/ke/opt/kahina/lib/jedit-textArea.jar:$CLASSPATH 

Note that you need to start a new shell before this takes effect. If you want to use SP with Kahina from a GUI, e.g. from SPIDER, you might want to log out and back in to be sure.

For other operating systems, please refer to the documentation on how to set environment variables.

Setting up QType

QType is not publicly available, so if you find yourself reading this, you probably have it already. Note that only recent versions of QType non-monotonic, modified by us, have the features needed to interoperate with Kahina. You have probably received such a version on a CD-ROM or via e-mail. Alternatively, if you have an account there, you can check out the most recent revision (as of this writing: 64) of QType from http://kahina.org/svn/qtype/trunk. The non-monotonic version that is modified to work with Kahina is in the subdirectory non-monotonic. Assuming that SP3 and Kahina have been installed as described above, no further setup is required. You can simply start QType from the non-monotonic directory as follows:

sicstus -l kqtype.pl

kqtype.pl differs from the classic qtype.pl only by setting SP3's source_info flag to on before compilation in order to be able to show QType source code locations during the tracing process. If you don't need this, you can use qtype.pl for better performance. However, at least for getting familiar with Kahina for QType, using kqtype.pl is strongly recommended.

The changes in this modified version of QType non-monotonic that are visible to the user consist in the addition of three new commands: trace, notrace and gui. Their use will be explained in the tutorial, see below.

First steps

See QTypeTutorial1 for an introduction into the use of Kahina for QType.

Last modified 2 years ago Last modified on Feb 24, 2017, 2:09:27 PM