Go to the first, previous, next, last section, table of contents.


Release notes and installation guide for UNIX

This chapter assumes that the environment variable PATH includes <prefix>/bin, where <prefix> points to the SICStus installation directory.

Installation

This is described in the file `INSTALL'.

Foreign language interface

How to customize splfr, spmkds and spmkrs

These utility commands are implemented as shell scripts which are generated from templates at installation. The scripts may in some cases need to be changed to adapt to local variations etc. Given the information below, simply identify the compiler, linker and options in the scripts.

How to create dynamic linked foreign resources manually

To compile the glue code file and user code, use the compiler options assigned to INCR_CFLAGS by ./configure. In addition also include -DSPDLL.

The object files are then linked into a dynamic linked foreign resource. For this you will normally use the linker whose name was assigned to SHLD by ./configure and linker options assigned to SHLDFLAGS. The resource will consist of the file ResourceName.Suffix where Suffix is the value assigned to SHSFX by ./configure. The defaults are

SHLD= ld
SHLDFLAGS= -shared
SHSFX= so

E.g. on Sparc/SunOS 5.X:

% cc -c -DSPDLL glue_code.c
% cc -c -DSPDLL mycode.c
% ld -shared glue_code.o mycode.o -o myresource.so

Libraries needed by the resource should normally also be included in the link command line.

Interfacing to C++

Functions in C++ files which should be called from Prolog must be enclosed like e.g:

extern "C" {
void myfun(long i)
{...};
};

To build a dynamic linked foreign resource with C++ code, you may (depending on platform) have to explicitly include certain libraries. E.g. on Sparc/SunOS 5.X using gcc:

% splfr .... +l -L/usr/gnu/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0 -lgcc

The library path is installation dependent.

Limitations

The Tcl/Tk interface is not supported under Irix, HP/UX, and FreeBSD.


Go to the first, previous, next, last section, table of contents.