Reply
Thread Tools
Posts: 3 | Thanked: 4 times | Joined on Apr 2010 @ Indonesia
#1
Maemo 5 comes with the swi-prolog bin pre-installed (swipl), but the installation seems to a minimal one, probably only to provide lib support to other apps. If you run swipl from the commadline, you get:

Code:
[FATAL ERROR:
    Could not find system resources]
After reading the appropriate FAQ at http://www.swi-prolog.org/FAQ/FindResources.html, I've tried setting $SWI_HOME_DIR, adding a boot and more complete library dir to /usr/lib/swipl-5.6.50. The problem may be a lack of boot32.prc.

Has anyone managed to get swipl to work as a standalone app, or do we need to rebuild from scratch?

Thanks,

Cam
 
Posts: 121 | Thanked: 53 times | Joined on Aug 2006 @ Alexandria, VA, USA
#2
You may find the man page instructive. It tells how to create boot32.prc.

Code:
cd /usr/lib/pl-5.6.47
bin/i386-linux-gnu/pl -O -o boot32.prc -b boot/init.pl
I have not tried this. I don't know if it works or not.
 

The Following User Says Thank You to talmage For This Useful Post:
Posts: 3 | Thanked: 4 times | Joined on Apr 2010 @ Indonesia
#3
Thanks for the idea. Unfortunately, the executable is still not finding something it needs. Running (as root):

Code:
bin/armel/swipl -O -o boot32.prc -b boot/init.pl
gives a long output of `syntax_error(operator_expected, ..)' error messages, ending in:

Code:
...
Message: error(syntax_error(operator_expected), file(/usr/lib/swipl-5.6.50/boot/init.pl, 1870, 8, 51443))
[PROLOG SYSTEM ERROR: Thread 1
        Undefined predicate: $load_additional_boot_files/0

PROLOG STACK:
]
It's possible that the boot and library files are incompatible with the executable: I could not find v 5.6.50 for download and am using the nearest: v 5.4.7.
 
Posts: 3 | Thanked: 4 times | Joined on Apr 2010 @ Indonesia
#4
Solved! Info here for any others interested:

1. Get the source of swi-prolog_5.6.50 from http://espejo.freemoe.org/repository...50.orig.tar.gz

2. Extract the library and boot directories

3. Create a pl.rc file (THIS is what was missing). I don't know enough to know what else this should contain, but this works:
Code:
:- style_check(+dollar).

:- initialization op(200, fy,  user:(@)).
:- initialization op(250, yfx, user:(?)).
:- initialization op(990, xfx, user:(:=)).

:- multifile
	user:file_search_path/2.
4. Send library/ boot/ and pl.rc to the /usr/lib/swipl-5.6.50/ dir (replacing the existing library/)

5. In that dir, as root, type
Code:
 swipl -b boot/init.pl -F pl.rc
6. Lots of compilation, which ends with:
Code:
SWI-Prolog boot files loaded
Boot compilation has created /usr/lib/swipl-5.6.50/bin/armel/swipl.prc
7. Done. swipl can be called from anywhere now, and finds the pl.rc automatically.:

Code:
~ $ swipl
Welcome to SWI-Prolog ...
...
1 ?-
 

The Following 4 Users Say Thank You to cwebb For This Useful Post:
Posts: 254 | Thanked: 122 times | Joined on Nov 2009
#5
Yes, swi-prolog on n900 is castrated. It does not include boot32.prc and doesn't contain some useful cammands. One more problem is that it is old, you will not find ready packages for it, so be ready to compile it with your hands. And SDK doesn't contain swi-prolog at all. So I doubt, that autobuilder would compile prolog programs. Unfortunately, if I'm not mistaken, it is not allowed to add to oficial repositories packages, that are alredy on the phone.
So may be something like a bug should be filled.

P.S. Alternatively, you can download et-prolog distribution, it includes needed boot32.prc.
 
Posts: 96 | Thanked: 125 times | Joined on Jul 2012 @ Turkey
#6
Is there anyone who can help me find swi-prolog 5.6.50 file cwebb mentioned 2 messages above to try using on Harmattan? The link he provided is dead and I could not find it on the web. I really appreciate if you can help.
 
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#7
Originally Posted by herdem09 View Post
Is there anyone who can help me find swi-prolog 5.6.50 file cwebb mentioned 2 messages above to try using on Harmattan? The link he provided is dead and I could not find it on the web. I really appreciate if you can help.
Instead of:

http://espejo.freemoe.org/repository...50.orig.tar.gz

Try with the (official, why use a random mirror):

http://repository.maemo.org/pool/mae...3%2b0m5.tar.gz

(I guess the actual contents of the tar.gz file are the same, but I cannot be sure).
 

The Following User Says Thank You to reinob For This Useful Post:
Posts: 96 | Thanked: 125 times | Joined on Jul 2012 @ Turkey
#8
Originally Posted by reinob View Post
Instead of:

http://espejo.freemoe.org/repository...50.orig.tar.gz

Try with the (official, why use a random mirror):

http://repository.maemo.org/pool/mae...3%2b0m5.tar.gz

(I guess the actual contents of the tar.gz file are the same, but I cannot be sure).
Thanks a lot. It works on Harmattan also
 
Posts: 2,153 | Thanked: 8,462 times | Joined on May 2010
#9
How that I missed this thread? Two years ago I played with preinstalled swipl binary a lot but I was not able to start it. Instead I compiled full swipl interpreter from repository.maemo.org source code...
 
Reply


 
Forum Jump


All times are GMT. The time now is 00:09.