New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure to build standalone executable in v7.6.4 #87
Comments
7.6.4 is very old and |
Just tried on Swipl 8.0.1, and it appears the --traditional option is gone. This is a pain, because I have a large volume of legacy code that would take a lot of work to translate to modern, especially as I want to keep compatibility with GNU-Prolog. Looks like I am going to have to support the armv7l and aarch64 platforms by using older versions of Swipl. |
? A little test shows that basic But, SWI 7 is designed to run 99.9% of ISO code. Only a few things to not work, but for those there are alternative constructs that both work in ISO and SWI 7. You might need
If you think otherwise, please show the code that causes problems without |
OK, I was getting confused by the error message from Swi 8.0.1, which was: jaspert$ swipl --traditional --goal=main --stand_alone=true -o xssimile -c testmain.pl Looks like the error I reported is still there, plus others. |
I think it should be enough to put an |
OK, I was able to put the directive in every module since the module declarations themselves were inserted by term expansion, so I just tweaked that to include the directive as well. Now I have the problem that infix operators in single quotes do not work outside traditional mode (except if the quotes are needed to stop the operator being a variable!). For instance... ?- P = a 'and' b. ?- ?- P = a 'and' b. Is there another declaration to fix this? Happy to take discussion elsewhere if appropriate. |
The rule is, following ECLiPSe, if the operator does not need quotes, quoting it prevents it from being an operator. Otherwise, e.g., So, all you need to do is get rid of the quotes around e.g. The mailinglist/forum is a more appropriate place. I guess we are (almost) done though. |
Testing in an aarch64 machine running Ubuntu Bionic. My testmain.pl is:
main :-
format_to_chars("A ~w can be anything", [1234], Foostr),
write(Foostr), nl.
This file can be consulted from the prompt, and outputs a list of character codes when main() is called. I attempt to build a standalone executable for it by going
swipl --traditional --goal=main --stand_alone=true -o xssimile -c testmain.pl
...and the following messages appear:
ERROR: /usr/lib/swi-prolog/library/qsave.pl:460:7: Syntax error: Operator expected
% autoloading prolog_codewalk:must_be/2 from /usr/lib/swi-prolog/library/error
% autoloading oset:reverse/2 from /usr/lib/swi-prolog/library/lists
% autoloading prolog_debug:backtrace/1 from /usr/lib/swi-prolog/library/prolog_stack
% autoloading qsave:current_foreign_library/2 from /usr/lib/swi-prolog/library/shlib
% autoloading record:member/2 from /usr/lib/swi-prolog/library/lists
% autoloading prolog_codewalk:portray_clause/1 from /usr/lib/swi-prolog/library/listing
% autoloading prolog_codewalk:clause_info/4 from /usr/lib/swi-prolog/library/prolog_clause
% autoloading prolog_codewalk:initialization_layout/4 from /usr/lib/swi-prolog/library/prolog_clause
% autoloading error:assertion/1 from /usr/lib/swi-prolog/library/debug
% autoloading user:format_to_chars/3 from /usr/lib/swi-prolog/library/charsio
% autoloading prolog_codewalk:clause_name/2 from /usr/lib/swi-prolog/library/prolog_clause
% Autoloader: iteration 1 resolved 11 predicates and loaded 11 files in 0.445 seconds. Restarting ...
% Autoloader: loaded 11 files in 2 iterations in 0.614 seconds
ERROR: atomics_to_string/2: Type error:
text' expected, found
[126,119,61]' (a list)No executable is produced. Consulting the file /usr/lib/swi-prolog/library/qsave.pl at the prompt does not produce errors. To produce the atomics_to_string/2 error at the prompt, the 1st arg has to be a list containing the sublist `[126,119,61]' .
The same example works OK producing a good executable in Swipl 6.6.6 on armv7l machine running Debian Jessie, and in Swipl 7.2.3 on an x86-64 machine running Debian Stretch.
The text was updated successfully, but these errors were encountered: