This chapter assumes that the environment variable PATH
includes
%SP_PATH%\bin
, where SP_PATH
points to the SICStus installation
directory.
The development system comes in two flavors:
The distribution is divided in the following files. The .exe
-files are
self-extracting archives/setup programs.
Installed files on a shared drive can be reused for installation on other machines.
SICStus Prolog requires a license code to run. You should have received from SICS your site name, the expiration date and the code. This information is normally entered during installation:
Expiration date: ExpirationDate Site: Site License Code: Code
but it can also be entered later on by executing the following commands at a command prompt:
% splm -i Site % splm -a sicstus3.7 ExpirationDate Code
Linked foreign resources come in two flavors, static and dynamic.
Static linked foreign resources are static libraries on Win32
(.lib
files). These are not portable between different C-compiler
environments. Static linked foreign resources are used for building
statically linked runtime and development systems.
Dynamic linked foreign resources are DLLs on Win32. They are
C-compiler independent but must use the cdecl
calling convention,
i.e. arguments are pushed on the stack; symbols are prepended with a
`_'.
Linked foreign resources may be created using the command
splfr
as described in the manual. This command invokes the
C-compiler, linker and library manager through the scripts
`spcc.bat' and `spld.bat'. These scripts are
configured by default for MS Visual C++ 5.0.
The distribution includes alternative scripts:
If you are using e.g. Watcom, do:
% cd %SP_PATH%\bin % copy spcc.msc spcc.bat % copy spld.msc spld.bat
Runtime systems and customized development systems may be created
using the commands spmkrs
and spmkds
respectively. These commands also use the scripts
`spcc.bat' and `spld.bat'.
Runtime systems require
`%SP_PATH%\..\sprt37.dll' (at runtime) and an import library for
`sprt37.dll' at build time.
Customized development systems also require `%SP_PATH%\..\spds37.dll' (at runtime) and an import library for `spds37.dll' at build time:
Only `rtimpmsc.lib' is distributed with SICStus. `rtimpbc.lib' can be made with the command:
% implib rtimpbc.lib sprt37.dll
Please contact SICStus support at
sicstus-support@sics.se
if you need `rtimpwat.lib'.
The names of these .lib
s are assumed in respective spld
.
The directory `samples' contains detailed examples on building resources and a runtime system.
As MSVC does not export/import symbols with a leading underscore, like Borland or Watcom, the SICStus header files defines the interface functions with an extra leading underscore when included by MSVC. This enables the runtime DLL compiled with Watcom to be imported to programs compiled with MSVC (or vice versa).
The file name arguments to splfr
, spmkds
and spmkrs
should not have embedded spaces. The reason for this is that not all
C-compilers/linkers seem to support quoting of file name arguments.
A runtime system will need to load the `sprt37.dll'. It will also
need to load the Runtime Library,
`sp37\bin\sprt.sav'. `sprt37.dll' will be looked up by
Windows' normal search for DLLs. `sp37\bin\sprt.sav' is looked up
in the directory containing `sprt37.dll'. Furthermore, the initial
library_directory/1
fact will initially be set to the same
directory with sp37/library
appended. This altogether makes it
easy to organize the files of an application, e.g:
myapp.exe sprt37.dll sp37\ bin\ sprt.sav library\ <whatever files from %SP_PATH%\library needed>
The sp*
files can also be put somewhere else in order to be shared by
several applications provided the `sprt37.dll' can be located by the DLL
search.
The 37 in the file names above is derived from SICStus' major version
number and patch level, i.e. currently 3 and 7. Naming the files with
version number enables applications using different sicstus versions
to install the sp*
files in the same directory.
As an alternative to using spmkrs
to create runtime
systems, there is a ready made runtime system provided:
`%SP_PATH%\library\sprt.exe'. This is particularly useful if you
don't have a C-compiler available. It will, after loading the runtime
DLL and runtime library, try to restore the file `main.sav' from its own
directory and, if successful, call the predicate main/0
. Command line
arguments will be available for the prolog program. The `sprt.exe' is
a console based executable, suitable for applications which read/write
on the stdio
streams. There is also a winmain
executable
provided with otherwise the same properties:
`%SP_PATH%\library\sprtw.exe'.
Command line editing supporting Emacs-like commands and IBMPC arrow keys is provided: in the character based executable. The following commands are provided:
Options may be specified in the file `%HOME%\spcmd.ini' as:
Option Value
on separate lines. Recognized options are:
lines
save
The command line editing is switched off by giving the option `-nocmd' when starting SICStus. Command line editing will be automatically turned off if SICStus is run with piped input (e.g. from Emacs).
The console used for the windowed executable is public domain, kindly
provided by Jan Wielemaker <jan@swi.psy.uva.nl>
.
The stream-based console window is a completely separate library,
using its own configuration info. It will look at the environment
variable CONSOLE
which should contain a string of the form
name:value{,name:value} where name is
one of:
sl
rows
cols
x
CW_USEDEFAULT
.
y
CW_USEDEFAULT
.
You will normally specify this in your `autoexec.bat' file. Here is what an example:
% set CONSOLE=sl:600,x:400,y:400
The interface is compiled with Tcl/Tk version 8.0.3 DLLs. Note that Tcl/Tk itself is not included in the SICStus distribution. It must be installed in order to use the interface. See section Tcl/Tk notes.
The Tcl/Tk interface includes an undocumented predicate:
tk_terminal(Interp, TextWidget, InStream, OutStream, ErrStream)
.top.myterm
, this predicate opens three
prolog streams for which the text widget acts as a terminal.
There is also a library(tkconsol)
, making use of
tk_terminal/5
, which switches the Prolog top level to a Tk
window. This is done by simply loading the library module.
The described features are still experimental, comments are appreciated.
Choosing EOF from menu seems to generate an eternal EOF which is not useful for e.g. escaping a break level. Instead a C-d can be generated by typing C-q C-d.
LoadLibrary()
cannot handle paths with periods in them.
character_escapes
is set to off
.
absolute_file_name/2
etc.
HOME
or HOMEDRIVE
and HOMEPATH
. The form ~username/
is not expanded. The form $VAR/
is expanded using the value of the
environment variable VAR.
The form %VAR%/ is not recognized.
user_error
stream is line buffered.
http://www.cs.washington.edu/homes/voelker/ntemacs.html
). See
above.
top_level_events
option to
tk_new/2
is not supported.
stream_select/3
is not supported.
stream_interrupt/3
is not supported.
library(timeout)
is not supported.
library(sockets)
: The AF_UNIX
address family is (unsurprisingly)
not supported; socket_select/5-6
support only socket streams for
arg 4(5).
library(system)
: popen/3
is not supported.
kill/2
attempts to terminate the requested
process irrespectively of the 2nd arg.
Go to the first, previous, next, last section, table of contents.