1# Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
2# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
3#
4# This file is free software; as a special exception the author gives
5# unlimited permission to copy and/or distribute it, with or without
6# modifications, as long as this notice is preserved.
7#
8# This program is distributed in the hope that it will be useful, but
9# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11# PURPOSE.
12
13The GNU Prolog interface to the Parma Polyhedra Library (PPL)
14is available both as a PPL-enhanced GNU Prolog interpreter and as a
15library that can be linked to GNU Prolog programs.  Only GNU Prolog
16version 1.3.2(20100322) and later versions are supported.
17
18So that it can be used with the GNU Prolog PPL interface (and, for
19that matter, with any foreign code), the GNU Prolog installation must
20be configured with the `--disable-regs' option.
21
22
23Configuring the PPL for Building the GNU Prolog Interface
24---------------------------------------------------------
25
26To build and install the GNU Prolog interface, you will need to set
27the environment variable CPPFLAGS with the path to the GNU Prolog
28include directory: this is the directory containing the file
29`gprolog.h'.  Thus you need to configure the PPL with a command like
30
31  CPPFLAGS=-I/path/to/gprolog/include /path/to/ppl-x.y/configure \
32     --interfaces = "gnu-prolog ..." ...
33
34
35The `ppl_gprolog' Executable
36----------------------------
37
38The `ppl_gprolog' executable is simply the GNU Prolog interpreter with
39the PPL statically linked.  The only thing you should do to use the
40library is to call `ppl_initialize/0' before any other PPL predicate
41and to call `ppl_finalize/0' when you are done with the library.
42
43
44Linking the Library To GNU Prolog Programs
45------------------------------------------
46
47In order to allow linking GNU Prolog programs to the PPL, the
48following files are installed in the directory `<prefix>/lib/ppl',
49where <prefix> is the root of your installation (`/usr' or
50`/usr/local' in most cases): `ppl_gprolog.pl' contains the required
51foreign declarations; `libppl_gprolog.*' contain the executable code
52for the GNU Prolog interface in various formats (static library,
53shared library, libtool library).  If your GNU Prolog program is
54constituted by, say, `source1.pl' and `source2.pl' and you want to
55create the executable `myprog', your compilation command may look like
56
57    gplc -o myprog <prefix>/lib/ppl/ppl_gprolog.pl source1.pl source2.pl \
58      -L '-Wl,-rpath=<prefix>/lib/ppl -L<prefix>/lib/ppl -lppl_gprolog \
59          -L<prefix>/lib -lppl -lgmpxx -lgmp -lstdc++'
60