Library does not exist while setting up my Pengines server?

#1

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 run.pl file found in the Pengines code directory and modifying it. The new file is named run-tsll.pro. 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/run-tsll.pl:14:
        source_sink `library(tsll)' does not exist
Warning: c:/users/robert/documents/github/me/pengines/run-tsll.pl:14:

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 tsll.pro source file. I can even execute consult(tsll) from the SWI-Prolog REPL window and it loads fine.

Here is the code for run-tsll.pro:

% 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.
	pengine_application(the_soul_leaves_last).

:-
	% 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,
	consult(tsll),
	use_module(the_soul_leaves_last:library(tsll)),
	!.
#2

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