First Apple M1 Pharo Version

This post is now out-dated. The current version is available in Pharo Zero-Conf, and in the future in the Pharo Launcher.
Check https://get.pharo.org/

After receiving the new Apple Mini with the M1 processor, we are producing the first version of the Pharo VM. This version, is a base version that lacks JIT optimizations and requires external libraries (it is not build as a bundle). However, it is a good step forward to have a working version in this new combination of architecture and OS. Also, this VM, even without JIT, has better performance than the VM with JIT using Rosetta 2.

We are going to start soon the final stroke in the development of the new version including the JIT, as mostly of it reuses the one already done for Linux ARM64 and Windows ARM64. The required changes are linked with changes done by Apple in the Operating System API, and some “Security improvements” of the new OS.

Requirements

In this first version, it is required to have installed some libraries with Brew (https://brew.sh/). These requirements will be removed in next versions.

The packages to install are:

  • cairo
  • freetype
  • sdl2
  • libgit2

Linking LibGit2

Pharo 9 is expecting to use LibGit2 1.0.1 or 0.25, but Brew includes the version 1.1.0. To fix this problem we can link the version 1.1.0 as 1.01. This is a temporal hack as the correct version will be shipped in a release of the VM.

For doing so, we need to execute:

cd /opt/homebrew/lib
ln -s libgit2.1.1.0.dylib libgit2.1.0.0.dylib

Downloading the VM

The VM is available in Pharo file server at: http://files.pharo.org/vm/pharo-spur64-headless/Darwin-arm64/PharoVM-9.0.0-ef1fc42b8-Darwin-arm64-bin.tar.gz

You can download and execute it. Watch out, this VM is for Pharo 9 images.

To correctly find the libraries provided by Brew, we need to execute the VM from the terminal with (is a single command):

LD_LIBRARY_PATH=/opt/homebrew/lib ./Pharo.app/Contents/MacOS/Pharo

In case the VM is not open because it has been put in quarantine (as it is not signed), you can allow execution of it doing:

xattr -d com.apple.quarantine Pharo.app

Conclusion

In the following weeks, we are going to provide a complete version of the Pharo VM integrated in the system and running as the one for Intel X64.

Published by Pablo Tesone

I am one of the Pharo Consortium Engineers. I am an enthusiast object-oriented programming and environment!

3 thoughts on “First Apple M1 Pharo Version

  1. Pharo 9’s dependency Libffi7 installation failed: dpkg: error processing archive /var/cache/apt/archives/libffi7_3.3-4_amd64.deb (–unpack):
    trying to overwrite ‘/usr/lib/x86_64-linux-gnu/libffi.so’, which is also in package libffi-dev:amd64 3.2.1-9
    Libffi-dev is a dependency of Lazarus 2/FreePascal. I had to remove the Lazarus IDE for Free Pascal before I could install Pharo with Libffi7.

    Like

  2. Even after installing the Debian 10 package, it didn’t work because the image file was not included. I had to run curl -L https://get.pharo.org/64/ | bash
    to get the image downloaded. Once I did that, it runs fine. I think the Debian 10 package is not ready!

    Like

Leave a comment