pack_install make error

48 views
Skip to first unread message

peter....@stud.uni-due.de

unread,
Oct 11, 2018, 6:45:38 AM10/11/18
to SWI-Prolog
Hello Group,

I need help installing packs in SWI-Prolog.
I want to install the mqtt pack but I only get an error while installing.

?- pack_install(mqtt).
% Contacting server at http://www.swi-prolog.org/pack/query ... ok
Install mq...@1.0.5 from https://github.com/olsky/swi-mqtt-pack/releases/download/v1.0.5/mqtt-1.0.5.zip Y/n?
% Contacting server at http://www.swi-prolog.org/pack/query ... ok
% "mqtt-1.0.5.zip" was downloaded 16 times
Package:                mqtt
Title:                  mqtt - pub/sub pack for SWI-Prolog using mosquitto
Installed version:      1.0.5
Author:                 Oleh Lozynskyy <oleh.lozyn...@gmail.com>
Maintainer:             Oleh Lozynskyy <oleh.lozyn...@gmail.com>
Packager:               Oleh Lozynskyy <oleh.lozyn...@gmail.com>
Home page:              https://github.com/olsky/swi-mqtt-pack
Download URL:           https://github.com/olsky/swi-mqtt-pack/releases/download/v1.0.5/mqtt-1.0.5.zip
Install "mqtt-1.0.5.zip" (112,144 bytes) Y/n?
ERROR: c/mqtt.c:14:10: fatal error: SWI-Stream.h: No such file or directory
ERROR:  #include <SWI-Stream.h>
ERROR:           ^~~~~~~~~~~~~~
ERROR: compilation terminated.
ERROR: make: *** [<builtin>: c/mqtt.o] Error 1
% gcc -O2 -g -Wall -fno-strict-aliasing -pthread -fPIC -std=c99  -I. -Iext/include     -c -o c/mqtt.o c/mqtt.c
ERROR: Process "process(path(make),[all])": exit status: 2
ERROR: In:
ERROR:   [19] throw(error(process_error(...,...),_57374))
ERROR:   [17] '$apply':forall(prolog_pack:member(all,...),prolog_pack:run_process(...,...,...)) at c:/program files/swipl/boot/apply.pl:51
ERROR:   [13] prolog_pack:pack_post_install(mqtt,'c:/program files/swipl/pack/mqtt',[inquiry(true),...|...]) at c:/program files/swipl/library/prolog_pack.pl:1008
ERROR:    [7] <user>
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.

If I understand the error correct it fails to find the SWI-Stream.h file. I found the file in my SWI-Prolog installation in the swipl/include folder.
And if I understand the gcc command then the -I parameter adds folders where the make searches for .h files. So i copied the file in swipl/ext/include, but that didn't work either.

I have found a newer Version of the mqtt pack by Sprior (https://github.com/sprior/swi-mqtt-pack) and tried to install that version, but I only get following error:

?- pack_install('https://github.com/sprior/swi-mqtt-pack.git').
ERROR: Domain error: `pack_name' expected, found `'swi-mqtt-pack''
ERROR: In:
ERROR:   [12] throw(error(domain_error(pack_name,'swi-mqtt-pack'),_1192))
ERROR:    [9] prolog_pack:pack_default_options('https://github.com/sprior/swi-mqtt-pack.git','swi-mqtt-pack',[],_1234) at c:/program files/swipl/library/prolog_pack.pl:495
ERROR:    [8] prolog_pack:pack_install('https://github.com/sprior/swi-mqtt-pack.git') at c:/program files/swipl/library/prolog_pack.pl:459
ERROR:    [7] <user>
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.

So I am guessing that either the pack configurations or my System configuration is not correct. Can someone help me with that?

To change the pack files I downloaded them and tried to install the pack from my harddrive but that didnt't work either.
I unzipped the pack in the folder C:\mqtt and have it as a zip in C:\mqtt.zip. So I tried

?- pack_install('file://C:/mqtt').
false.

?- pack_install('file://C:/mqtt.zip').
false.

and as you can see got only false as response. So I am doing something wrong here too.


My System:

Windows x64
SWI-Prolog 7.6.4
swipl --dump-runtime-variables
CC="gcc";
PLBASE="c:/program files/swipl";
PLARCH="x64-win64";
PLLIBS="";
PLLIB="-lswipl";
PLCFLAGS="";
PLLDFLAGS="";
PLSOEXT="dll";
PLSOPATH="PATH";
PLVERSION="70604";
PLSHARED="yes";
PLTHREADS="yes";

Anne Ogborn

unread,
Oct 11, 2018, 2:45:31 PM10/11/18
to peter....@stud.uni-due.de, SWI-Prolog
pack swi-mqtt-pack has an install bug filed now, looks like fix in progress.


peter....@stud.uni-due.de

unread,
Oct 23, 2018, 8:05:41 AM10/23/18
to SWI-Prolog
First of all, I would like to thank you for your quick answer. And I can see that there were changes in the git. But the error is still the same.

In the git (https://github.com/olsky/swi-mqtt-pack/releases) the version was updated to 1.0.7 but when I use pack_install('mqtt') it only offers me the option to download version 1.0.5.

I can download the newest version manually, but SWI-Prolog just prints false when I try to install a file from my hard drive (see first post). Can someone point out what I am doing wrong here.
Reply all
Reply to author
Forward
0 new messages