Cannot run tests on my clone of packages-jpl

20 views
Skip to first unread message

Benjamin Mathers

unread,
Jan 15, 2017, 5:18:51 PM1/15/17
to SWI-Prolog
I have checked out the packages-jpl project from the SWI-Prolog GitHub page. I want to add some functionality, but first I wanted to make sure I could run the tests. When running TestJUnit, I keep on receiving the following error:

SWI-Prolog: [FATAL ERROR:
Could not open resource database "../../src/swipl.prc": No error]

I see that the path mentioned in the error comes from this declaration:

public static final String startup = 
  (System.getenv("SWIPL_BOOT_FILE") == null ? "../../src/swipl.prc" :
  System.getenv("SWIPL_BOOT_FILE"));

So, the project cannot find swipl.prc. It seems this might be mended by adding a "SWIPL_BOOT_FILE" environment variable, but I don't know what file to point to. I have tried using "swipl-win.exe", but that has not worked. Am I missing something obvious?

Jan Wielemaker

unread,
Jan 16, 2017, 3:05:16 AM1/16/17
to Benjamin Mathers, SWI-Prolog
Dear Benjamin,

I guess the simplest way is to install the whole of SWI-Prolog from git.
Configure, build and test it. Once that works, go to packages/jpl,
do

git checkout master
git pull

and hack away. Once upon a time these packages were independent from
the rest of the tree ...

Cheers --- Jan

P.s. JPL will most likely receive a major update in the next few
days (depending on portability tests).

On 01/15/2017 11:18 PM, Benjamin Mathers wrote:
> I have checked out the packages-jpl project from the SWI-Prolog GitHub
> page. I want to add some functionality, but first I wanted to make sure
> I could run the tests. When running TestJUnit, I keep on receiving the
> following error:
>
> |SWI-Prolog:[FATAL ERROR:Couldnot open resource database
> "../../src/swipl.prc":Noerror]|
>
>
> I see that the path mentioned in the error comes from this declaration:
>
> |publicstaticfinalStringstartup
> =(System.getenv("SWIPL_BOOT_FILE")==null?"../../src/swipl.prc":System.getenv("SWIPL_BOOT_FILE"));|
>
>
> So, the project cannot find swipl.prc. It seems this might be mended by
> adding a "SWIPL_BOOT_FILE" environment variable, but I don't know what
> file to point to. I have tried using "swipl-win.exe", but that has not
> worked. Am I missing something obvious?
>
> --
> 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.

Paul Singleton

unread,
Jan 16, 2017, 5:49:17 AM1/16/17
to SWI-Prolog
If you have an installed SWI Prolog, look in its root dir for boot.prc, boot32.prc or boot64.prc - this is the file you need.

Pass the absolute path as SWIPL_BOOT_FILE


On Sunday, 15 January 2017 22:18:51 UTC, Benjamin Mathers wrote:

So, the project cannot find swipl.prc. It seems this might be mended by adding a "SWIPL_BOOT_FILE" environment variable, but I don't know what file to point to. I have tried using "swipl-win.exe", but that has not worked. Am I missing something obvious?

Paul Singleton

Benjamin Mathers

unread,
Jan 16, 2017, 12:20:51 PM1/16/17
to SWI-Prolog, bmat...@macalester.edu
Hi Jan,

Thanks so much for your response. In your PS you said that JPL would receive a major update soon. Do you know if that update will include adding the new constructors mentioned in the TODO's of the Query class? These are constructors meant to make it easier to deal with Prolog modules through JPL. Because as of now, that is the only functionality I am looking to add.

Thanks,
Ben Mathers

Paul Singleton

unread,
Jan 17, 2017, 7:01:55 AM1/17/17
to swi-p...@googlegroups.com, bmat...@macalester.edu
Benjamin

I cannot find TODOs in any recent Query.java source file, and JPL has
handled module-prefixed goals for a long time now; the JUnit tests cover

Query.hasSolution("call(user:true)")

Query.oneSolution("jpl:jpl_modifier_bit(volatile,I)")
}
Query.hasSolution("user:length([],0)"));

Perhaps you are using a very old JPL?

Are you sure you need additional API to handle modules?

Paul Singleton
Reply all
Reply to author
Forward
0 new messages