			  INTALLING XPCE with
		      SWI-prolog or SICStus Prolog

			     Jan Wielemaker
			          SWI
			 University of Amsterdam
			     Roetersstraat 15 
			    1018 WB  Amsterdam
			      The Netherlands
			E-mail: jan@swi.psy.uva.nl


** Last updated for version 4.6.4, December 1993
** This installation procedure is for XPCE, running under SWI-Prolog or
   SICStus Prolog

For BINARY ONLY installation, see the file BININSTALL


** Required before starting xpce installation

SWI-Prolog

	* SWI-Prolog 1.8.6 or later completely installed.

	  The runtime environment must be installed.  If not, type
	  the following.
	  
	  	% cd ../pl/<arch>	(sun4, rs6000, sgi, linux)
		% make runtime

	  Note that the installation directory of SWI-Prolog is
	  supposed to be ../pl (relative from here).  If this is
	  not true, make a symbolic link to establish this relation.


SICStus Prolog

	* SICStus Prolog 2.1 #7 or later installed with the runtime
	  environment. 
	

SUN SPARC STATION

	* A SUN SPARC station running SunOs 4.1.  Possibly SunOs 4.0.1
	  or later will do.  SunOs 3.x or 4.0.0 certainly won't!
	  Solaris 2.2 (SunOs 5.2) is probably fine too.

	* The GNU C-compiler gcc, installed as `gcc'.  If you are not
	  sure, type

		% gcc -v

	  wich should  print the  gcc version number.  PCE is compiled
	  with version 2.5.4. PCE does not  compile with version 2.0 due
	  to some  bugs  in this release.   Versions 2.5.[0123] fail to
	  compile SWI-Prolog.  We do not know with what other versions
	  the installation will succeed.

	  PCE does not compile using SunOS 4.x.x cc as it is written in
	  ANSI-C.

	* MIT X11R4 or X11R5 release of X-windows.  XPCE also runs
	  under Sun OpenWindows 2 and OpenWindows 3. 
	  
IBM RS6000

	* An IBM RISC System/6000 running AIX 3.2
	  When using AIX 3.1, edit the file xpce/src/md-rs6000.h and
	  remove the comments from `typedef char * XtPointer;'.

	* The GNU C-compiler gcc (see comments above).

	* The normal AIX 3.2 XMotif library.

Silicon Graphics

        * Tested with GCC 2.4.5 and MIT X11R5


** Extracting

The tar file xpce-VERSION.tar.Z contains a tar (1) image of XPCE.  The
tar   file  contains   one directory,   called   ./xpce.  When   using
SWI-Prolog,  this directory should be extracted  next  to ./pl because
the   interface sources refer   to  SWI-Prolog  using  relative  paths
(../pl/...).


** Preparation

The PCE installation  depends on  a  couple of  environment variables.
When you have to repeat the installation often,  we advice to create a
shell script.  The variables are:

	* PCENAME
	  Name of  the resulting  XPCE/SWI-Prolog executable.  If  not
	  set, `xpce' is used as a default value.

	* PCESICS
	  Name of the resulting  XPCE/SICStus executable.  If  not set
	  `pcesicstus' will be used.

	* SICSHOME
	  Base directory of the SICStus system.

	* PCEBINDIR
	  Name of the directory to put the resulting executable in.  If
	  not set, /usr/local/bin is used.

	* PCEHOME
	  Absolute pathname to the base directory of PCE (that is, the
	  directory this file is  in).  If  not set, the  installation
	  script  uses `pwd`  to   get the   default value.   Set this
	  variable if `pwd` does not yield  the desired path-name, for
	  example if this directory is on an automount filesystem.

	* PCEXBASE
	  Absolute  path pointing to a  common directory from which to
	  find the  X11 include  files  and  compiled  libraries.  The
	  include files are supposed to be in

		  $PCEXBASE/include/X11
		  
	  The libraries are supposed to be in

		  $PCEXBASE/lib

	  The  default value is  /usr.     For  using the  OpenWindows
	  libraries, normally /usr/openwin should do.


** Installation

After the variables described above have been set, just type

	% ./build

To install XPCE/SWI-Prolog as $PCEBINDIR/$PCENAME. Or type

	% ./build sics

To install XPCE/SICStus as $PCEBINDIR/$PCESICS.


** Reinstalling after changing the sources

After  the   sources (in  ./src)  have  changed,  PCE  can   simply be
reinstalled using the  normal  installation procedure.    After  major
changes, various automatically generated files need to be recreated in
the source directory.  To do this, type:

	% cd src
	% ./make clean
	% cd ..
	% ./build

** Testing

Be sure to run under the X-window environment with a proper setting of
the DISPLAY variable and type:

	% rehash
	% xpce		# or, $PCENAME if you changed the name
	PCE Release 4.6.0, November 1993 for Sun4 running SunOs and X11R5
	Copyright 1993, University of Amsterdam.  All rights reserved.
	The host-language is SWI-Prolog version 1.8.4, October 1993
	~/.xpcerc compiled, 0.02 sec, 1,252 bytes.
	~/.plrc compiled, 0.02 sec, 796 bytes.

	For HELP, please invoke the predicate `manpce'.

	1 ?- manpce.

Provided you are  lucky, a small window will  appear in  the  top-left
corner of  the   display.   Play   around with the   manual to  see if
everything seems to be alright.


** Problems

SUN

Various versions  of Xwindows are around.   We currently develop using
MIT X11R5 libraries and the twm window manager.  Notably make sure you
the  X11 header  files  used to  compile   xpce are compatible to  the
actually loaded  libraries.   When   in  doubt, recompile  xpce   from
scratch.

There  are repaint problems with   text when using the SUN-OpenWindows
X-server.  One can never be sure, but regarding the fact that  this is
the  only server of the at  least 8   other X-implementations xpce has
been   connected  with  that shows  this   problem,   we  assume   the
SUN-OpenWindows X-server to be broken.


IBM

The SICStus interface is not tested on this machine.

The SWI-Prolog saved-state mechanism is broken.  As a consequence, the
installation needs to  be  repeated each time   the  machine has  been
rebooted.   To do so,  delete the PCE executable and   type ./build in
this directory.

Silicon Graphics

The SICStus interface is not tested on this machine.

Not tested very extensively.
