please help with pack install rebuild

32 views
Skip to first unread message

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

unread,
Nov 9, 2018, 11:20:53 AM11/9/18
to SWI-Prolog
Dear SWI-Prolog Google Group,

I am trying to install the mqtt pack for SWI Prolog without success. I would be immensely grateful if anyone can help me solve one or more of the issues I am running into.

It looks like the initial problem I had (see https://groups.google.com/forum/#!topic/swi-prolog/qbG4gerZ-Zs) has been resolved by the author on the git, but the new version was not correctly uploaded.
I managed to manually download to new version 1.0.7 from the git (https://github.com/olsky/swi-mqtt-pack) and copy-pasted it over my files and then I ran the pack_rebuild(mqtt). command.
Now I get the following error instead of the 'SWI-Stream.h: No such file or directory' error:

?- pack_rebuild(mqtt).
% rm -f c/mqtt.o
% rm -f lib/x86_64-linux/mqtt.so
% c/mqtt.c: In Funktion »c_mqtt_pub«:
% c/mqtt.c:675:21: Warnung: Variable »mosq« gesetzt, aber nicht verwendet [-Wunused-but-set-variable]
%    struct mosquitto *mosq;
%                      ^~~~
% c/mqtt.c: In Funktion »c_mqtt_sub«:
% c/mqtt.c:1114:21: Warnung: Variable »mosq« gesetzt, aber nicht verwendet [-Wunused-but-set-variable]
%    struct mosquitto *mosq;
%                      ^~~~
% c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lrt
% c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lpthread
% c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lswipl
% c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lmosquitto
% c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lpthread
% collect2.exe: Fehler: ld gab 1 als Ende-Status zurück
% make: *** [Makefile:24: lib/x86_64-linux/mqtt.so] Error 1
% gcc -O2 -g -Wall -fno-strict-aliasing -pthread -fPIC -std=c99  -I. -Iext/include   -I"c:/program files/swipl/include"   -c -o c/mqtt.o c/mqtt.c
% mkdir -p lib/x86_64-linux
% gcc -shared -O2 -g -Lext -pthread -Wl,-rpath=ext -Lext -lrt -lm -lpthread    -o lib/x86_64-linux/mqtt.so -lswipl c/mqtt.o -lmosquitto
ERROR: Process "process(path(make),[all])": exit status: 2
ERROR: In:
ERROR:   [14] throw(error(process_error(...,...),_24838))
ERROR:   [12] '$apply':forall(prolog_pack:member(all,...),prolog_pack:run_process(...,...,...)) at c:/program files/swipl/boot/apply.pl:51
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.

1. Can someone help resolve this problem or at least explain what the error is about?

To get the pack running I also got a second PC and installed Ubuntu on it as OS.
First I tryied to install SWI-Prolog like it is described on http://www.swi-prolog.org/build/unix.html.
But when I execute the make command I get the following error:

...
[ 88%] Generating tests/test_certs/generated
/bin/sh: 1: cd: can't cd to /home/peter/swipl-devel/build/packages/ssl/tests
packages/ssl/CMakeFiles/test_certificates.dir/build.make:60: recipe for target 'packages/ssl/tests/test_certs/generated' failed
make[2]: *** [packages/ssl/tests/test_certs/generated] Error 2
CMakeFiles/Makefile2:10393: recipe for target 'packages/ssl/CMakeFiles/test_certificates.dir/all' failed
make[1]: *** [packages/ssl/CMakeFiles/test_certificates.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

2. How can I fix this?

Then I installed SWI-Prolog as shown in http://www.swi-prolog.org/build/PPA.html which worked fine.

3. Is there a difference between the different install approaches? And if yes, is it relevant to installing packs?

The Problem is I can't install the new version 1.0.7 on this system, because Prolog does not recognise the pack as installed.

?- pack_rebuild(mqtt).
ERROR: pack `mqtt' does not exist

I also spotted that after starting Prolog with the swipl command in the terminal it prints an additional line with says:

Warning: Package mqtt: no binary for architecture amd64

even if it doesn't recognise the pack as installed.

4. Can someone explain this warning to me or is it displayed only because the pack is not installed properly.

I have written an email to the author of the pack but never got an answer. It would be very helpful if the new version 1.0.7 can be downloaded via pack_install instead of the old version 1.0.5.

5. If someone could try to install the pack on your System and post here if the installation was successful on which OS and with which prolog and pack versions etc., that would mean a lot to me.

Even better if someone could contact the author to ask him on which System the pack was tested.

Many thanks in advance to anyone who can help me with one or more of these questions/issues!


Anne Ogborn

unread,
Nov 9, 2018, 2:11:29 PM11/9/18
to peter....@stud.uni-due.de, SWI-Prolog
You need to install the dependency mosquito first

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

unread,
Nov 11, 2018, 12:07:01 PM11/11/18
to SWI-Prolog
On my Windows System eclipse mosquitto was already installed. I installed it on the Linux now too. Nothing changed. Do I have to configure mosquitto in any way?

Reply all
Reply to author
Forward
0 new messages