SICStus on Debian 8.0 install notes

In my main research, I’m working with the SICStus Prolog development system. Installing this on Debian 8.0 wasn’t a totally smooth ride — the docs outline how to install it on RedHat or CentOS, and I get the sense that the install script assumes you’re running one of those as well — so I thought I’d make some notes here. As a prerequisite for this, you do need a license: a 30-day evaluation license is available if you just want to test it out.

SICStus includes modules for Tcl/Tk, Berkeley DB, PrologBeans, Jasper and ODBC, and the installer script will prompt you to install/disregard the Tcl/Tk, Berkeley DB, Jasper and ODBC modules (it doesn’t seem to prompt me about PrologBeans, and I don’t need it). Of these, Berkeley DB might present difficulties: the current install script seems to expect the presence of 6.0.30, which AFAIK isn’t available through Debian packages. It should be feasible to build Berkeley DB from source; I experimented with doing this on wheezy, with inconclusive results, but I ultimately aborted since I’m not convinced that I need it.

The support packages to fetch from apt-get are moderately straightforward:

openjdk-7-jdk openjdk-7-jre unixodbc unixodbc-dev tk tk-dev tcl tcl-dev

Where this appeared to get a little tricky is that the .so files get placed in /usr/lib/x86_64-linux-gnu/, and the SICStus installer script assumes they reside in a directory named lib (it doesn’t care where lib is, but it will look for a directory called lib at whatever path you provide and fail if it doesn’t find one). There are various overrides that you can pass when you invoke the script, but I wasn’t able to use these satisfactorily: the script still barked warnings at me. This was my hackish workaround:

mkdir ~/hack
cd ~/hack
ln -s /usr/lib/x86_64-linux-gnu lib

This was sufficient to appease the installer script when it came to locating and test linking to the Tcl/Tk libraries. It pays to be vigilant when prompted for the location of the JDK – in a related situation, the script is looking for bin/javac, not merely javac, so in my case the path to provide was /usr/lib/jvm/java-7-openjdk-amd64. Naturally you also have to add the final install destination to your PATH variable.

If you have a better suggestion for how to do this, please let me know in a comment – while this did the job for me, it doesn’t wholly sit right, and I’d be grateful to hear a more experienced take.