Building on MacOS in 2024

I went through the exercise of building from source on a new machine once again.

“Building SWI-Prolog on MacOSX” is a bit outdated. Not even sure if it should say “X” at the end.

I used Homebrew. This is on the website:

brew install \
     cmake \
     ninja \
     gmp \
     openssl \
     libarchive \
     readline \
     ossp-uuid \
     libyaml \
     unixodbc \
     berkeley-db \
     pcre \
     jpeg

At least:

  • You can and maybe should (?) skip gmp and readline
  • You probably want pcre2 instead of pcre

XQuartz is not mentioned at all in the Homebrew section, and I guess this is fine. It is available in Homebrew but the installation was somehow botched for me. I downloaded it from https://www.xquartz.org/.

Altogether, the Homebrew section of this page could use an update. I can try to do it but I am certainly not a MacOS expert. Please comment so that I know what to write there :smiley:

[EDIT] With the cmake version installed by homebrew, I get a whole lot of warnings. They look like this:

CMake Warning (dev) at cmake/QLF.cmake:75 (install):
  Policy CMP0177 is not set: install() DESTINATION paths are normalized.  Run
  "cmake --help-policy CMP0177" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  packages/xpce/CMakeLists.txt:174 (add_swipl_target)
This warning is for project developers.  Use -Wno-dev to suppress it.

and also like this:

CMake Deprecation Warning at CMakeLists.txt:5 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

I am just reporting this, it looks benign and I don’t know what to do about it.