JPL - [FATAL ERROR: at Sun Apr 22 03:02:12 2018 Could not find system resources]

306 views
Skip to first unread message

dagobi

unread,
Apr 22, 2018, 4:59:11 AM4/22/18
to SWI-Prolog
Hello,

I built and installed SWI Prolog from source (SWI-Prolog source for 7.6.4) on an amazon-linux-ami. Please see my system info below just in case.

Command line swipl works just fine (see below). But I got "[FATAL ERROR: at Sun Apr 22 03:02:12 2018 Could not find system resources]" with JPL. For example,

String prologVersion = ((Term) (new Query("jpl_pl_lib_version(V)")).oneSolution().get("V")).name();

I checked out http://www.swi-prolog.org/FAQ/FindResources.txt but am not sure what specifically I need to do to resolve this problem as SWI_HOME_DIR is set and command line swipl works fine.

Any help will be greatly appreciated.

--------------------------------------------------------------------------
Here are my system and environment info.

$ uname -a
Linux dev.xyz.com 1.2.3.4.amzn1.x86_64 #1 SMP Mon Mar 5 19:00:48 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ java -version
openjdk version "1.8.0_161"
OpenJDK Runtime Environment (build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)
$ swipl --version
SWI-Prolog version 7.6.4 for x86_64-linux

PATH=/home/xyz/swipl/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin
LD_LIBRARY_PATH=/home/xyz/swipl/lib/swipl-7.6.4/lib/x86_64-linux:/usr/lib/jvm/java/jre/lib/amd64:/usr/lib/jvm/java/jre/lib/amd64/server
SWI_HOME_DIR=/home/xyz/swipl

----------------------------------- Command line swipl ------------------------------------------
$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 7.6.4)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

1 ?- current_prolog_flag(home, Home).
Home = '/home/xyz/swipl/lib/swipl-7.6.4'.

2 ?- jpl_pl_lib_version(V).
V = '7.4.0-alpha'.
--------------------------------------


Regards,
Dagobi

Paul Singleton

unread,
Apr 22, 2018, 7:16:25 AM4/22/18
to SWI-Prolog
I believe that FATAL ERROR occurred in the SWI Prolog runtime library when it was initialised by JPL but couldn’t locate essential files to boot Prolog.

It may look for these files relative to where it found libswipl.so rather than use a defn of SWI_HOME_DIR - this is documented online somewhere.

Is this the only SWIPL installation ever in this machine? Have you moved any installed files?

NB your test of JPL in command line SWIPL

jpl_pl_lib_version(V)

doesn’t start JPL; try e.g.

jpl_new(‘java.util.Date’, [], X)

which should return a jref; but this is irrelevant to your issue starting embedded SWIPL, which I suspect you would also get if you tried to start it via FLI from a C program.

Paul Singleton

Jan Wielemaker

unread,
Apr 22, 2018, 11:38:22 AM4/22/18
to dagobi, SWI-Prolog
On 22/04/18 01:59, dagobi wrote:
> Hello,
>
> I built and installed SWI Prolog from source (SWI-Prolog source for
> *7.6.4*
> <http://www.swi-prolog.org/download/stable/src/swipl-7.6.4.tar.gz>) on
You set SWI_HOME_DIR=/home/xyz/swipl, while Prolog claims its home is
/home/xyz/swipl/lib/swipl-7.6.4. Prolog needs to find boot64.prc.
The manual says where it looks. One of the places is in the
Prolog home dir. It normally deduces that from the executable,
but that fails when you embed Prolog.

Cheers --- Jan

P.s. Paul: on Windows it indeed also tries the location of
libswipl.dll. On Unix systems there is no way to find
the file location of loaded shared objects.

>
>
> Regards,
> Dagobi
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> <mailto:swi-prolog+...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/swi-prolog.
> For more options, visit https://groups.google.com/d/optout.

dagobi

unread,
Apr 22, 2018, 1:25:49 PM4/22/18
to SWI-Prolog
Sweet, unsetting SWI_HOME_DIR or setting it to /home/xyz/swipl/lib/swipl-7.6.4 resolves the problem!!

Thank you very much Jan and Paul!

Just in case, I was able to run command line swipl before because I did not set SWI_HOME_DIR (to /home/xyz/swipl) - I only set it when I run Java/JPL programs via a shell script. With SWI_HOME_DIR set to /home/xyz/swipl, swipl would not even start, giving the same fatal error.
Reply all
Reply to author
Forward
0 new messages