---+ INSTRUCTIONS

Make sure you have at least SWI-Prolog 5.7.13. This is necessary for
non-deterministic C++ predicates.

Install spatialindex. (Use spatialindex release >= 1.3.3 or the current
source in the Trac repository at
http://trac.gispython.org/spatialindex.) Install GEOS. The space package
has been tested with version 3.1.1.

If you install spatialindex or geos with a prefix (with ./configure
--prefix=$PREFIX), make sure that the directory where the spatialindex
library or geos library was installed, e.g. /usr/local/lib, is in the
environment variables LD_LIBRARY_PATH and LIBRARY_PATH. Make sure that
the directory where the spatialindex header files were installed, e.g.
/usr/local/include, is in the environment variable CPLUS_INCLUDE_PATH.

On unixlike systems using bash, for example, you could add this to your
.bashrc or .bash_profile before running ./configure --prefix=$PREFIX:

  ==
  export PREFIX=/home/yourself
  export CPLUS_INCLUDE_PATH=$PREFIX/include
  export LIBRARY_PATH=$PREFIX/lib
  export LD_LIBRARY_PATH=$PREFIX/lib
  ==

An outline of the installation procedure (please let me know where it
fails with your setup) is listed below:

---++ Install GEOS

  ==
  $ svn checkout http://svn.osgeo.org/geos/trunk geos-svn
  $ ./autogen.sh
  $ ./configure --prefix=[...]
  $ make
  $ make install
  ==

---++ Install spatialindex

  ==
  $ svn checkout http://svn.gispython.org/svn/spatialindex/spatialindex trunk
  $ autogen.sh
  $ ./configure --prefix=[...]
  $ make
  $ make install
  ==

---++ Download the development version of SWI-Prolog

  ==
  $ git clone git://www.swi-prolog.org/home/pl/git/pl-devel.git
  ==

---++ Install SWI-Prolog and the space package

  ==
  $ cp build.templ build
  [add space to variable EXTRA_PKGS]
  $ ./prepare
  $ ./build
  ==

---++ run the tests and the demo

  ==
  $ cd packages/space
  $ make check
  $ pl -s demo_space.pl
  ==

---++ Mac OS X

On Mac OS X you might have to help ./configure a bit by telling it how
to call the preprocessor. This should work:

  ==
  CXXCPP="g++ -E" ./configure
  ==

Also, since 'pl' is a reserved command, Prolog should be called with
'swipl'.

If the compilation finished without errors the demo script will prompt
you with instructions.

If it does not work, please contact me.

Willem Robert van Hage <wrvhage@few.vu.nl>

---++ Ubuntu/Debian

This explains getting the prerequisites on Ubuntu/Debian. Tested on
Ubuntu Jaunty (9.04, 64-bits). Install the following packages (in
addition to what you need to build SWI-Prolog in the first place):

	sudo apt-get install libtool subversion libgeos-dev

Fetch and install spatialindex using the instructions above.

