Application must contain such piece of code
:-initialization(Goal).
Then executable file can be built with
gplc --min-size PrologFile.plTo decrease size of resulted file just use upx utlity
upx --all-methods exeFile
SWI-Prolog
Add some main goal into Prolog application
main :- Goal, Goal, Goal.Compile with string
swipl -O --foreign=save --toplevel=halt --goal=main --stand_alone=true -o exeFile -c PrologFile.plCheck usage of system libraries with
ldd exeFileIt will show something like
linux-vdso.so.1 => (0x00007ffcdc3f8000)libswipl.so.X.X is used by the executable file and must be bundled together with compiled file
libswipl.so.7.2 => /usr/lib/libswipl.so.7.2 (0x00007febe1ec8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007febe1cab000)
No comments:
Post a Comment