|Did you know ...||Search Documentation:|
|Prerequisites for Debian based systems (Ubuntu, Mint, ...)|
The universal way to get dependencies for a package is below. The disadvantage is that the distribution list of dependencies can be outdated.
apt-get build-dep swi-prolog
After building you may wish to run
?- check_installation. in
swipl to check that all components have been built properly.
Use the following commands to obtain all dependencies for a full build
from source. Note that there are no known version dependencies on any of
these packages. If your (debian-based) distribution is lacking any of
these package use
apt search <name> to find an alternative, where
<name> is e.g.,
jdk (i.e., remove version and details). Some remarks:
ninja-buildmay be dropped, building using
makeis fine for a one-time build, but
ninjais advised for developers or people that regularly update using git.
unixodbcfor ODBC connectivity.
libarchive-devis needed for library(archive), which is needed by pack_install/1.
libossp-uuid-devis needed for library(uuid).
libdb-devis needed for library(bdb), the BerkeleyDB embedded database interface.
libedit-devboth provide command line editing for interactive usage. None is strictly needed and one of them suffices.
libedit-devis the preferred command line editor.
libgoogle-perftools-devprovides tcmalloc, which can reduce memory usage a lot on some heavily multithreaded applications.
libpcre2-devis required for library(pcre). SWI-Prolog versions before 8.5.9 require
libpcre3-dev(which is older than
cmakemust be at least version 3.5 See CMAKE.md
sudo apt-get install \ build-essential cmake ninja-build pkg-config \ ncurses-dev libreadline-dev libedit-dev \ libgoogle-perftools-dev \ libgmp-dev \ libssl-dev \ unixodbc-dev \ zlib1g-dev libarchive-dev \ libossp-uuid-dev \ libxext-dev libice-dev libjpeg-dev libxinerama-dev libxft-dev \ libxpm-dev libxt-dev \ libdb-dev \ libpcre2-dev \ libyaml-dev \ default-jdk junit4
Raspbian is fully supported and can be used to build SWI-Prolog including all packages without issues. If you want to reduce resources, the following packages are optional:
Note that including GMP support makes the memory footprint bigger, but mostly if you have no other applications depending on GMP. All the other optional components are only loaded when you use them.
swipl-win executable provides a Qt based console for SWI-Prolog by
Carlo Capelli. This console is used to provide the MacOS app, but can
also be used on Linux. To include it, install the Qt development
sudo apt install qt5-default
qt5-default package is dropped from Ubuntu 21.04 and has never
existed on some other Debian based distributions. In that case, use
the command below.
sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
The HTML documentation is built as part of the default build procedure and only depends on Prolog itself and some of its packages. The dependencies below are needed to build the PDF documentation. Configuring the build to include the PDF docs requires
cmake -DBUILD_PDF_DOCUMENTATION=ON ...
sudo apt-get install \ texlive-latex-extra \ texlive-font-utils \ texlive-fonts-extra \ texlive-fonts-extra-doc \ texlive-fonts-recommended \ texlive-fonts-recommended-doc
Now that after you have installed dependencies, return to Build SWI-Prolog from source to complete installation.