I am a total beginner and I am trying to connect Python and Prolog using PySWIP on a Raspberry Pi 3, Model B. There seems to be an issue since I have installed SWI-Prolog 32 bits, version 7.2.3, whereas Python version 2.7.13 is 64 bits, and these should both be either 32 or 62 bits versions.
I have searched for solutions on whether it is possible to download a newer version of SWI-Prolog (64 bits) on the Raspberry Pi 3, and if so, how to do it.
Yes, Raspberry 3, Model B, thanks! Yes, I have seen this (and many other articles), but have not managed to understand what is going on. The Raspberry has Linux 9 (Stretch), which should have GCC 6.3.0. When I try to update Prolog I receive the message that I have the newest version (7.2.3+dfsg-6) 32 bits.
Again I have not done this but my understanding is
I agree that both Python and SWI-Prolog both need to be at same bit-ness for this to work, either both 64-bit or both 32-bit.
You should be on newer versions of the software. Python 2.x is no longer supported and SWI-Prolog 7.x is so old that everyone will tell you to upgrade to 8.3.x.
You will have to build SWI-Prolog for use with Raspberry Pi. There are no ready to download builds of SWI-Prolog for Raspberry Pi. That is because Raspberry Pi uses ARM processors and there is not a great demand for this variation of SWI-Prolog it is not a standard part of the build and distribute process.
You can just compile the whole system on any Pi. Just follow the normal download and build instructions for Linux, taking the Debian dependency list. On a model 3 it takes quite a while for the whole system
Thanks! I have (I think) followed the instructions and have a now installed version 8.3.28-27-g284ce5073. It says however, that this too is a 32 bits version and not the 64 bits I am looking for.
The are two other things I do not understand,
I cannot open the program with the swipl command in terminal (did not find command), but I can open it in terminal by clicking on shortcut icon in the pi/bin folder.
When open (by clicking on the shortcut and open in terminal), it does not anymore query the .pl files in the pi folder.
If anyone has the patience to further guide me I’d be much obliged.
I’m not entirely up to date with Raspbian wrt 32/64 bit. For a long time it was just a 32-bit Linux system. If it is now hybrid, is it possible that its default compiler toolchain still produces 32-bit binaries?
You should either edit ~/.bashrc to include $HOME/bin in $PATH or install to e.g. /usr/local/bin rather than in the user’s home. Again, I don’t have a pi right here, so I cannot give the exact instructions. Hopefully someone can help …
Note that it should also work to start as ~/bin/swipl ....
I hate to say this but I think the total number of users here who have done what you seek is zero. That does not mean we will not try and help but that you will probably get no responses to that request. At this point your guesses are as good as mine but I will note that before the SWI-Prolog forum moved to Discourse it was on Google Groups (SWI-Prolog on Google Groups) and there are some related messages there. Also many of the users there did transition to this forum but are not that active here. I would note them by name but in this case I don’t think they have anything more to offer than what is posted.