Next: , Up: Runtime Systems on Target Machines   [Contents][Index]


6.7.2.1 Runtime Systems on UNIX Target Machines

In order to build a runtime system for distribution on a target machine, the option --moveable must be passed to spld. This option prevents spld from hardcoding any (absolute) paths into the executable. As of release 4.2, --moveable is the default on most platforms, including Linux, Mac OS X and Solaris.

Next, in order for SICStus to be able to locate all relevant files, the following directory structure should be used.

myapp.exe
sp-4.6.0/
+--- libsprt4-6-0.so
+--- sicstus-4.6.0/
     +--- bin/
     |    +--- sprt.sav
     +--- library/
          +--- <files from $SP_PATH/library>

If support for multiple SICStus instances is needed, then the runtimes named e.g. libsprt4-6-0_instance_01_.so need to be available as well, in the same place as libsprt4-6-0.so.

If SICStus Prolog is installed on the target machine, then a symbolic link named sp-4.6.0 can be used, in which case it should point to the directory of the SICStus installation that contains the libsprt4-6-0.so (or equivalent).

If the runtime system needs to be debugged, then the above file system layout should be complemented as follows: The file spds.sav from the development system should be copied and placed in the same folder as sprt.sav and the license information must be made available. See Debugging Runtime Systems for details.

myapp.exe is typically created by a call to spld:

% spld --main=user --moveable […] -o ./myapp.exe

On most platforms, the above directory layout will enable the executable to find the SICStus runtime (e.q., libsprt4-6-0.so) as well as the boot file sprt.sav (spre.sav). In addition, application specific files, e.g. a .sav file, can be found using the automatically set system properties SP_APP_DIR or SP_RT_DIR. On some platforms a wrapper script, generated by spld, is needed to ensure that the files are found.

Unless the --static option is passed to spld, it might also be necessary to set LD_LIBRARY_PATH (or equivalent) to /home/joe/lib (in the example above) in order for the dynamic linker to find libsprt4-6-0.so. If the --static option is used, then this is not necessary. Setting LD_LIBRARY_PATH is not recommended unless it is really needed.

When a runtime system is redistributed to third parties, only the following files may be included in the distribution. All filenames are relative to <prefix>/lib/sicstus-4.6.0:

../*.{a,so,sl,dylib}
bin/sprt.sav
bin/spre.sav
bin/jasper.jar
bin/prologbeans.jar
library/*.{tcl,po,pl}

Except license.pl!

library/*/*.{s.o,so,sl,dylib}
library/*/*.{po,pl}
sp_platform

(Located with InstallSICStus)

Please note: you cannot redistribute spds.sav or license.pl.



Send feedback on this subject.