Sunday, September 28, 2014

How to install SICStus on Ubuntu

Installing SICStus

In order to download and install SICStus, you will need a license. If you are a student at FEUP, you can use the ones provided to the FEUP community. All the required keys are located in the software repository, so go ahead and connect to VPN-FEUP. If you do not know how to do this, check my previous tutorial.
Afterwards, open following text file:
//software/Publico/Outros/Departamentos/DEI/Sicstus_Prolog/Sicstus_Prolog_4.3/Sictsus_Prolog_Instrucoes_para_download_e _codigos_estudante.txt

Go to SICStus Prolog download page and download the latest version for your system:

When prompted for a user and password, use the ones located on line number 7 from the previously opened text file:

Press CTRL+ALT+T to open the Terminal, navigate to the Downloads folder and extract the downloaded file using the following comand:
cat sp-4.3.0-x86_64-linux-glibc2.5.tar.gz | gzip -cd |tar xf -

Navigate to the extracted folder and run SICStus installer using the command:
sudo ./InstallSICStus

The installer should start. When prompted with the question below, press Enter.

Press Enter again to install SICStus in /usr/local/sicstus4.3.0.

Press Enter again to confirm:

Now you will be prompted to enter some keys. Go to the text file we have previously opened: lines 54 to 57 have the information you need.

Afterwards, since we will not need any extra modules, answer no to the next four questions. In the previous questions, we pressed Enter to answer yes, but to answer no you really need to type no and only then press Enter.

When the installer finishes, it should look something like this:

Installing rlwrap

We are almost done. In order to use the arrow keys and history in SICStus, we will need to install rlwrap: execute the following command on the terminal:
sudo apt-get install rlwrap

Creating a link to SICStus

At this point, in order to run SICStus, we need to open the terminal, navigate to /usr/local/sicstus4.3.0 and only then run sicstus. This is quite exhausting.
At some point, it will be useful to open the terminal and be able to execute SICStus right away just by typing sicstus - this is very easy to achieve.

Open the terminal and type the following command:
sudo ln -s /usr/local/sicstus4.3.0/bin/sicstus /usr/bin/sicstus
After that, you can type sicstus from anywhere and SICStus will start:

To exit SICStus, press CTRL+D.

Running SICStus

You may notice that when you run SICStus, you won't be able to use the arrow keys and weird stuff like ^[[A will start to come up instead:

That's really annoying and that's why we installed rlwrap. The correct way to launch SICStus is to type the following on the terminal:
rlwrap sicstus
That way you will be able to use the arrow keys like expected:


  1. Tutorial 5***** :)
    Thanks Difusal ;D

  2. Thanks a lot. That rlwrap is perfect :)
    to link the sicstus i just moved the sicstus.4.3.0 content to /usr/local/ .

  3. Thankx for the tutorial!