# knowrob json_prolog problems

I have got the following errors when I use knowrob/json_prolog.

I tried the examples as in the tutorial:

$rosrun json_prolog json_prolog package_name(tried several) ERROR: /usr/lib/swi-prolog/library/process.pl:47: '$open_shared_object'/3: /usr/lib/swi-prolog/lib/i386/process.so: undefined symbol: Sfilefunctions Warning: /usr/lib/swi-prolog/library/process.pl:47: Goal (directive) failed: process:use_foreign_library(foreign(process)) ERROR: /usr/lib/swi-prolog/library/process.pl:334: Exported procedure process:process_wait/3 is not defined ERROR: /usr/lib/swi-prolog/library/process.pl:334: Exported procedure process:process_kill/2 is not defined

I am using Ubuntu 11.04, Ros electric, installed using apt from the online repository.

Is there any compatibility issue of the swi-prolog with json_prolog/jpl etc?

Thanks.

edit retag close merge delete

Sort by » oldest newest most voted

Hi,

this has been a problem with the SWI Prolog libraries: They are regularly renamed from libpl.so to libswipl.so and back...

It should be fixed in the svn version, can you please verify that it works for you? Then I'll start the release as .deb packages.

Thanks Moritz

more

Following the above question, it seems the problem comes from swi-prolog...

As the error is from /usr/lib/swi-prolog/library/process.pl, I changed it a bit as:

:- module(process,
[ process_create/3,       % +Exe, +Args, +Options
process_wait/2,     % +PID, -Status
process_id/1,       % -PID
process_id/2,       % +Process, -PID
is_process/1,       % +PID
process_release/1,      % +PID
process_kill/1      % +PID
]).
:- use_module(library(shlib)).
:- use_module(library(lists)).
:- use_module(library(option)).
:- use_module(library(process)).
%:- use_foreign_library(foreign(process)).


Some functions are removed from the process list: process_create/2, process_kill/2, etc. Also, use_foreign_library(foreign(process)) caused other errors, so I also commented it out. I am not sure if this makes sense.

But I can get rid of some of the errors. But certainly this is not the ideal way, as other programs also require some missing functions, such as process_create/2, which I removed from the list. I guess this is somehow the problem of the ubuntu version of the swi-prolog, where the process.pl is incompatible.. But as I am not familiar with Prolog, could anyone help?

Many thanks.

more

The problem is not that things have been removed from process.pl, it's rather that you need to have LD_PRELOAD=libswipl.so set. This is being done automatically in the rosjava wrapper script bin/json_prolog, which is generated based on the information in CMakeLists.txt
( 2011-10-18 22:15:30 -0500 )edit
2
Please remove this since it's not an answer. Any important information to the problem should be moved to the original question.
( 2011-11-30 04:07:40 -0500 )edit

Thanks a lot for your quick response. Yes, all the errors are gone now with the svn version.

Ze

more

2
( 2011-11-30 04:07:25 -0500 )edit