SWI-Prolog on MacOS X (Darwin)

Thanks  to  Jacobo  Myerston   <jacunix@cantv.net>    and   Paulo  Moura
<pmoura@di.ubi.pt> for their help on   assembling  this version. Jacobo
produces binary packages on a regular basis. Please visit the SWI-Prolog
home and download on www.swi-prolog.org.

As of SWI-Prolog 5.0.2, the  SWI-Prolog   sources  have  been adapted to
compile and run flawlessly on MacOS X,   including all packages and XPCE
using X11.

The plld compile/link utility is  capable   of  producing shared objects
from foreign code to  be  loaded  in   SWI-Prolog  as  well  as embedded
executables.


Installing from the source (tiger)
==================================

Building  SWI-Prolog  is  based  on    the  DarwinPorts  project.  These
instructions have been updated for Tiger   (MacOS 10.4.2), October 2005.
Using a plain Mac, proceed as follows.

	* Get and install Mac Xcode (used 2.1). You can find the installer 
	on the /Applications/Installers folder on your disk or on the disks 
	that came with your Macintosh. You may also download the Developper 
	Tools from Apple after subscribing to the developer network.
	* Install the optional MacOS X11 package from the
	  MacOS tiger installation CD.
	* Get DarwinPorts from http://darwinports.opendarwin.org/
	* Update it using

		% sudo port -d selfupdate

	* Install required packages:

		% sudo port install readline
		% sudo port install libmcrypt
		% sudo port install ncurses
		% sudo port install jpeg
		% sudo port install gmp

	* Adjust PATH to

		- Hold /usr/X11R6/bin
		- Hold /opt/local/bin
		- Hold the desired target directory for Prolog if
		  different from above.

	  NOTE: Make sure /usr/X11R6/bin is before /opt/local/bin if
	  you have the DarwinPort fontconfig package installed.

	* Add
		- export LIBRARY_PATH=/opt/local/lib
		- export CPATH=/opt/local/include

Now you can build SWI-Prolog from source   using the normal configure &&
make && make install sequence.   In alternative, you may use DarwinPorts
for the installation by typing:

		% sudo port install swi-prolog-devel

or:

		% sudo port install swi-prolog

depending if you want the latest development release or the latest stable 
release.


Installing the binary
=====================

In order to install SWI-Prolog  you  must   have  the  Mac  optional X11
subsystem installed in your computer (see above).

Once  you  have  installed  XFree86  you   just  have  to  double  click
SWI-Prolog.mpkg.  The  installer  will  ask  you  for  an  administrator
password, and you will have to agree the terms of the license.


Running SWI-Prolog
------------------

The executable of SWI-Prolog is installed as /opt/local/bin/swipl. Using
normal setup, it can be started by typing the command

	swipl

in a terminal window. This may  fail   if  /opt/local/bin is not in your
`PATH'. In that case you can start   SWI-Prolog  by typing the full path
name or you have to modify PATH first.

The    libraries    and    other    resources     are    installed    in
/opt/local/lib/pl-<version>/

