Library does not exist while setting up my Pengines server?


I’m trying to create a Pengines environment that supports my Prolog application. I have created a module that exports the necessary predicates. I have created my own launch code by copying the original file found in the Pengines code directory and modifying it. The new file is named I have created an application named the_soul_leaves_last that I want tied to the module I have created to service the app. However, when I try to execute the relevant use_module() statement the operation fails with the following error message:

Old directory - c:/users/robert/documents/github/me/pengines/
New directory - c:/users/robert/documents/prolog/ME/

ERROR: c:/users/robert/documents/github/me/pengines/
        source_sink `library(tsll)' does not exist
Warning: c:/users/robert/documents/github/me/pengines/

What have I done wrong? As you can see in the code below, after Pengines loads I explicitly switch to the directory that contains the source file. I can even execute consult(tsll) from the SWI-Prolog REPL window and it loads fine.

Here is the code for

% Main file to run the pengines demo. 
% Loads the demo and starts a server
% on the default port: 3030

:- [load].

:- server(3030).

	% Tell Pengines to load our application.

	% Now change to the TSLL directory.
	NewDir_2 = 'c:/users/robert/documents/prolog/ME/',
	working_directory(OldCwd_2, NewDir_2),
	write('Old directory - '), write(OldCwd_2), nl,
	write('New directory - '), write(NewDir_2), nl,

library(X), is used to reference modules located in SWI-Prolog’s library directory. Since your module isn’t part of the library, you can just use use_module(the_soul_leaves_last:tsll)

1 Like