SWI-Prolog -- Installation on Unix

Installing SWI-Prolog from the sources (Unix)

Doing it all in one

On well supported platforms such as Linux and MacOS, the following procedure normally does the trick, installing the Prolog compiler with threading enabled and all `standard' packages in /usr/local/

% gzip -d < pl-<version>.tar.gz | tar xvfB -
% cd pl-<version>
% ./configure --with-world
% make
% [su root]
% make install

If the above fails or you do not want everything, follow the instructions below.

Doing it in multiple steps

The configuration on Unix is based on GNU-Autoconf, a set of scripts that automatically extract system characteristics and creates the Makefile and C config header config.h. The generated Makefile only works with GNU-Make.

The installation requires an ANSI-C compiler. Configure prefers the GNU-project C-compiler gcc, but many other compilers work fine too.

The first step, building SWI-Prolog lite, is outlined below.

% gzip -d < pl-<version>.tar.gz | tar xvfB -
% cd pl-<version>/src
% ./configure --enable-mt	# see bellow
% make
% [su root]			# for public installation
% make install

The second step, building all tools, is only supported for machines on which building and loading shared libraries is supported. Configuration of this step works fine on machines with gcc and ELF-based binary format. Linux and Solaris are popular examples of such machines. It works on various other machines too, but sometimes requires some playing with link-flags in the generated makefiles.

The packages are built and installed from the packages directory in the main distribution directory. The file README there contains additional information on building the packages. The basic procedure is:

% cd pl-<version>/packages
% ./configure
% make
% [su root]			# for public installation
% make install

configure is a Bourne Shell script doing the actual configuration for your computer. The most important options of confure are:

--help
Print a list of all available options. See the files INSTALL and INSTALL.notes in the distribution for additional information.
--enable-mt
Build for multi-threaded execution. This is the default for the binary releases. It must be specified explicitely as it may not work on all systems. In general it should work on systems with POSIX threads and signal handling.
--prefix=prefix
Set the base directory for the installation. The executables are stored in prefix/bin/, the library in prefix/lib/pl-5.3.0/ and the include files in prefix/include. For public installation (by root), /usr/local is the default. For private installation it is normal to specify $HOME
--exec_prefix=prefix
Overrides the directory for installing the executables to exec_prefix/bin/, normally used on heterogeneous networks.

After succesfull installation, the compilation directory may be removed.

bugreport In case of trouble ...

The file INSTALL in the source directory contains the generic documentation about installing autoconf-based programs. The file INSTALL.notes in the same directory contains additional SWI-Prolog related hints.

If configure fails, try using bash configure. If make fails, try using GNU-make and gcc.

If all fails, have a look at the bugreport page.


Home This page is maintained using the chpp macro language