JPL is a bi-directional Java/Prolog interface for SWI-Prolog, which I hope to be able to use for integrating Blipkit into Bioclipse, so I'm happy to have got it up running tonight. Below are some notes from the installation procedure.
NOTE: These are still rather incomplete notes about how to get this to work. Hope to make it into a verified tutorial later (I unfortunately haven't documented each and every step I took to get it working :( , so I might need to redo the install on a virtual machine to be sure)
JPL is not included in the Ubuntu repositories :( (only available for ubuntu 8.10 i think), so I had to install SWI-Prolog from source, which went Ok. I happened to install, among others, the following packages, which seemed like they were neede (though that is not verified):
The XPCE package still can't be built though. (Says that it is missing "-lXpm")
EDIT: I found out (with the help of this thread) that I needed to install libxt-dev, which is available in the Ubuntu repos!
Then I copied
I also made symlinks in /usb/bin, like so:
/usr/bin/libjava.so -> /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/libjava.so /usr/bin/libjpl.so -> /home/samuel/install/swi-prolog/pl-5.6.64/packages/jpl/libjpl.so
Had to add the libjava.so to my PATH, by means of:
For the prolog demo to work, I had to do:
(This discussion was very helpful for this.)
Now it works! I fire up swi-prolog with "pl" (If you have installed SWI-Prolog as an ubuntu package, you might need to use "swipl" or "swi-prolog"), and, standing in
~/install/swi-prolog/pl-5.6.64/packages/jpl/examples/prolog, I can now write (inside the prolog console):
?- [jpl_versions_demo]. % library(error) compiled into error 0.01 sec, 9,676 bytes % library(lists) compiled into lists 0.01 sec, 23,424 bytes % library(jpl) compiled into jpl 0.07 sec, 287,052 bytes prolog library version: 3.1.4-alpha java library version: 3.1.4-alpha c library version: 3.1.4-alpha BINGO! you appear to have the same version of each library installed % jpl_versions_demo compiled 0.13 sec, 304,240 bytes true. ?-
The Java examples in examples/java/* work as well. cd:ing into
JPL demo: Family % family.pl compiled 0.00 sec, 2,632 bytes consult('family.pl') succeeded child_of(joe, ralf) is provable descendent_of(steve, ralf) is provable first solution of descendent_of(X, ralf): X = joe all solutions of descendent_of(X, ralf) X = joe X = mary X = steve each solution of descendent_of(X, ralf) X = joe X = mary X = steve each solution of descendent_of(X,Y) X = joe, Y = ralf X = mary, Y = joe X = steve, Y = joe X = mary, Y = ralf X = steve, Y = ralf
(If this is not working next time I log in / reboot, I guess I'll have to add the LD_LIBRARY_PATHs in a more permanent way. Have to figure out how...).