Did you know ... | Search Documentation: |
Building SWI-Prolog on MacOSX |
Last updated: Oct 31, 2018, homebrew
Building SWI-Prolog for MacOS requires Macports. In general, the Portfiles are kept nicely up-to-date thanks to Paulo Moura. If you are a Macport user, SWI-Prolog can be installed simply using one of the commands below. The first installs the `stable' version and the second the `development' version. Note that most of the time developers are better of using the development version.
port install swi-prolog port install swi-prolog-devel
If you like to keep nice and lean system (i.e., if you do not want Macports copies of X11, ODBC, etc), you still need to install several prerequisites. First:
Next, you must install the following Macport libraries for a complete build.
port install cmake ninja gmp jpeg libarchive libiconv libmcrypt ncurses \ openssl ossp-uuid pkgconfig readline zlib pcre db62 libedit \ fontconfig libyaml unixODBC openjdk17 junit hamcrest-core
Notes
Next, you can download SWI-Prolog as a source archive or using GIT. After installing all dependencies SWI-Prolog can be build according to the generic instructions using cmake that can be found here
Homebrew provides an alternative to Macports. The command below installs the latest stable version of SWI-Prolog:
brew install swi-prolog
The latest git version of SWI-Prolog can be installed with this command:
brew install swi-prolog --HEAD
(contributed by Rinke Hoekstra)
As of version 7.7.21 the SWI-Prolog sources are fully compatible for building with dependencies provided by Homebrew. The dependencies can be installed using
brew install \ cmake \ ninja \ gmp \ openssl \ libarchive \ readline \ ossp-uuid \ libyaml \ unixodbc \ berkeley-db \ pcre \ jpeg
Brew does not provide junit.jar
which is needed to run the JPL (Java
interface) tests. If you want to test this get junit.jar
as described
in https://github.com/junit-team/junit4/wiki/download-and-install and
install in /usr/local/share/java/junit.jar
.
After installing all dependencies SWI-Prolog can be build according to the generic instructions using cmake that can be found here