I’m hoping to be able to install PTB using Octave under MacOS on an M1 chip for development purposes (real experiments run on Linux), but I get an aborted installation error that I’m not sure how to solve.
Octave: 7.2.0 (installed via homebrew)
MacOS: 12.5.1, M1 chip
(note to run DownloadPsychtoolbox I had to add the brew installed subversion path with addpath('/opt/homebrew/bin/')).
Download proceeds as expected, then I receive the following:
Running post-install routine...
warning: savepath: current path saved to ~/.octaverc
Octave major version 7 detected. Will prepend the following folder to your Octave path:
/Applications/Psychtoolbox/PsychBasic/Octave6OSXFiles64 ...
warning: savepath: current path saved to ~/.octaverc
ERROR: WaitSecs-MEX does not work, most likely other MEX files will not work either.
ERROR: One reason might be that your version 7.2.0 of Octave is incompatible.
ERROR: Another conceivable reason would be missing or incompatible required system libraries on your system.
ERROR: After fixing the problem, restart this installation/update routine.
Installation aborted. Fix the reported problem and retry.
I could try an earlier octave version but I’m not sure how to / if this is available from homebrew. I couldn’t find instruction for this on homebrew; only 7.2.0 and HEAD seem to be available.
Octave 7.2 for Intel Mac was tested yesterday with PTB 3.0.18.12 the first time. PTB’s mex files for Octave 6.4 seem to work on Octave 7.1/7.2 due to some trickery. Graphics ran slowly though, skipping many frames, don’t know what new kinds of macOS or Octave bugs are at play there…
Our mex files and other dependencies / dylibs are currently only built for 64-Bit Intel architecture, not for 64-Bit ARM, as used by Apple Silicon M1/M2/…
So you need to have a 64-Bit Intel version of Octave, and then presumably the Rosetta2 translation would kick in and run Octave and PTB’s mex files/libs under that emulation, translating Intel → ARM as needed.
HomeBrew decided against shipping universal binaries with both ARM and Intel afaik, so your Homebrew and Octave is likely 64-Bit ARM native and 64-Bit Intel ptb mex files won’t load.
So you’d need to install Homebrew for Intel Mac’s on your ARM Mac, and that might work. I think people have PTB + Matlab for 64-Bit Intel running on M1, so in principle the emulation seems to work. Ofc. only usable for stuff that doesn’t require any timing precision or other forms of precise control. PTB doesn’t support macOS 11/12/… or ARM Macs officially and isn’t tested with them. Given the depressing utter lack of financial support from over 99% of our users, and nobody else paying anything for Mac support, I doubt any of this will change, at least not for the better. macOS support is just an especially big time and money sink whenever I touch it.
As a potential hack, a quick Google shows this link which seems to contain instructions for how to get Homebrew for Intel installed on a ARM Mac:
Thanks for the suggestion Mario, and sorry for the delay.
I’ve installed an x86 version of brew as per those instructions and it seems to work. Unfortunately the octave installation fails, which seems to be a problem installing subversion:
==> Installing octave dependency: subversion
==> Patching
==> Applying configure-big_sur.diff
patching file configure
Hunk #1 succeeded at 10798 (offset 2065 lines).
==> scons PREFIX=/usr/local/homebrew/Cellar/subversion/1.14.2/libexec/serf GSSAPI=/usr CC=/usr/bin/clang CFLAGS=-Os -w -pipe -ma
Last 15 lines from /Users/tsawallis/Library/Logs/Homebrew/subversion/01.scons:
2022-09-03 16:49:19 +0000
scons
PREFIX=/usr/local/homebrew/Cellar/subversion/1.14.2/libexec/serf
GSSAPI=/usr
CC=/usr/bin/clang
CFLAGS=-Os -w -pipe -march=nehalem -mmacosx-version-min=12 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
LINKFLAGS=-L/usr/local/homebrew/opt/apr-util/lib -L/usr/local/homebrew/opt/openssl@1.1/lib -L/usr/local/homebrew/opt/apr/lib -L/usr/local/homebrew/lib -F/usr/local/homebrew/Frameworks -Wl,-headerpad_max_install_names -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
OPENSSL=/usr/local/homebrew/opt/openssl@1.1
APR=/usr/local/homebrew/opt/apr
APU=/usr/local/homebrew/opt/apr-util
Do not report this issue to Homebrew/brew or Homebrew/core!
I get the same error if I try to install subversion directly under the x86 brew alias (with axbrew install subversion). It’s installed under the arm64 brew version with no issue. I also tried uninstalling the arm64 version and installing from x86 again in case something was causing a conflict, but that didn’t help.
Given the last line of the output, I’m also not sure where I should report the issue.
Anyway, happy for any suggestions but this is not a PTB issue.
Ok, I think I’ve solved this by going for a package installation (via octave-app.org) rather than using homebrew. Octave-app’s latest release at time of writing is Octave 6.2.0, and only seems to be compiled for x86. This can be installed on an M1 Mac with no issues (and is presumably running Rosetta emulation by default). Psychtoolbox installs and runs (albeit with severe timing warnings as anticipated).
Thanks for the suggestions! Hopefully octave-app continue to make it straightforward to install x86 versions.
Yes, that app would run under Rosetta. I’m surprised it works, as there were some incompatible changes between Octave 6.2 and 6.3, but if it works, it works.
That it is still version 6.2 when meanwhile there were 6.3, 6.4, 7.1, and 7.2 releases, doesn’t bode well for them still investing in that. But a test with the latest PTB built against HomeBrew’s 7.2 suggests it might continue to work with Octave.app 6.2 at least for the next major PTB release, so you might get lucky for a while longer.
Btw. if you feel playful, i’d love to get a data point about how our Vulkan display backend behaves on M1. help PsychHDR gives instructions on how to install the latest MoltenVK. After that, SimpleHDRDemo might run. Or VBLSyncTest / PerceptualVBLSyncTest with the optional ‘usevulkan’ parameter flag set to 1. Would be curious to hear if you get an animation, instead of just a black screen (until end of demo with a long key press) and tons or PTB error and warning messages, which is all I now get on a Intel MacBookPro 2017 with AMD graphics, after “upgrading” from 10.15.7 Catalina where this worked to macOS 12.6 Monterey.