I’ve had a brief look where we must go with the Mac M1. Its a great piece of hardware. SWI-Prolog runs fine on it and is remarkable fast. You have to build from source though, including builds using Macports or Homebrew. What I figured out is this:
- There exist universal binaries. Those are just binaries that contain both versions and the OS will pick the right one.
- There is a tool (
lipo
) that allows creating, examining and extracting specific architectures from a universal binary. - CMake seems to have a flag that does all the logic to create MacOS universal binaries. See c++ - macOS build universal binary 2 with CMake - Stack Overflow
- We still need the dependencies. See
scripts/macos-deps.sh
. Most are configured using GNU autoconf. - GCC produces almost twice as fast executables than Clang (the gap is rather extreme in SWI-Prolog’s case, but that is what we want to compile).
- GCC cannot produce M1 binaries yet (announced for GCC-12?)
Anyone with experience and suggestions how to start properly supporting the M1 (while keep supporting Intel Macs)?