swi-prolog-jpl: library jpl fails to load

Bug #597619 reported by Martin Günther
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
swi-prolog (Debian)
New
Unknown
swi-prolog (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: swi-prolog

I am using Ubuntu Lucid Lynx (10.04). Trying to load the jpl library fails with:

ERROR: /usr/lib/swi-prolog/library/jpl.pl:4638:
 Exported procedure jpl:jpl_c_lib_version/1 is not defined

Note that calling Prolog from Java works (packages/jpl/examples/java), but not the other way around (packages/jpl/examples/prolog). Same result with both java-6-openjdk and java-6-sun, which is not surprising giving that Google thinks that this error message has something to do with Prolog having a problem with libjpl.so.

However, when I use swi-prolog 5.11.1 built from source, everything works as advertised. I have 5.8.0 installed from the official Ubuntu packages, and 5.11.1 from source (at /usr/local/...). Uninstalling either doesn't change the behaviour.

Here is the output, along with the appropriate environment variables:

== using 5.8.0 official ubuntu package: ==
LD_LIBRARY_PATH=/usr/lib/swi-prolog/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/server/
SWI_HOME_DIR=/usr/lib/swi-prolog
PATH=/home/martin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/martin/bin
CLASSPATH=.:/usr/lib/swi-prolog/lib/jpl.jar
JAVA_HOME=/usr/lib/jvm/java-6-sun/

Using LD_PRELOAD=/usr/lib/swi-prolog/lib/amd64/libjpl.so

% library(swi_hooks) compiled into pce_swi_hooks 0.00 sec, 3,616 bytes
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 5.8.0)
Copyright (c) 1990-2009 University of Amsterdam.
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.

For help, use ?- help(Topic). or ?- apropos(Word).

?- [library(jpl)].
% library(error) compiled into error 0.01 sec, 17,688 bytes
% library(lists) compiled into lists 0.01 sec, 42,616 bytes
ERROR: /usr/lib/swi-prolog/library/jpl.pl:4638:
 Exported procedure jpl:jpl_c_lib_version/1 is not defined
% library(jpl) compiled into jpl 0.03 sec, 662,512 bytes
true.

== using pl-5.11.1 built from source: ==
LD_LIBRARY_PATH=/usr/local/lib/swipl-5.11.1/lib/x86_64-linux:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/server/
SWI_HOME_DIR=/usr/local/lib/swipl-5.11.1
PATH=/home/martin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/martin/bin
CLASSPATH=.:/usr/local/lib/swipl-5.11.1/lib/jpl.jar
JAVA_HOME=/usr/lib/jvm/java-6-sun/

Using LD_PRELOAD=/usr/local/lib/swipl-5.11.1/lib/x86_64-linux/libjpl.so

% library(swi_hooks) compiled into pce_swi_hooks 0.00 sec, 3,856 bytes
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 5.11.1)
Copyright (c) 1990-2010 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.

For help, use ?- help(Topic). or ?- apropos(Word).

?- [library(jpl)].
% library(error) compiled into error 0.00 sec, 18,224 bytes
% library(lists) compiled into lists 0.00 sec, 44,688 bytes
% library(jpl) compiled into jpl 0.03 sec, 697,576 bytes
true.

Revision history for this message
Martin Günther (launchpad-domain-the-phoenix) wrote :

BTW, I am on a AMD64 system.

Linux caprica 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010 x86_64 GNU/Linux

Revision history for this message
Kilian Evang (kevang) wrote :

Unless I'm mistaken, the current version of jpl.pl tries to add jpl.jar to the classpath automatically as soon as jpl.pl is loaded. It expects to find jpl.jar in $SWI_HOME/lib.

The package should be updated to put jpl.jar there.

Revision history for this message
Martin Günther (launchpad-domain-the-phoenix) wrote :

I don't believe it has anything to do with jpl.jar, but instead with libjpl.so. Anyhow, this package seems not to be maintained any more.

Revision history for this message
Kilian Evang (kevang) wrote :

You're right, I was mistaken, the issue I mentioned was different, maybe nonexistent (I can't reproduce it now).

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in swi-prolog (Ubuntu):
status: New → Confirmed
Revision history for this message
NoBugs! (luke32j) wrote :

Same happens in the latest Ubuntu version, apparently it wasn't compiled with the right library settings?

I had to compile the software as described here, to make a working installable package.
https://code.google.com/p/javanaproche/wiki/HowToJPL

Changed in swi-prolog (Debian):
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.