Running Sigrok PulseView on an M1 Arm Mac
As of the time of writing, PulseView[1] has not been cross compiled for arm64
macOS. Installing PulseView with Homebrew and attempting to run it causes the app to crash on startup with the following error (viewable in the console app).
Termination Reason: Namespace DYLD, Code 1 Library missing
Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
Referenced from: /Volumes/VOLUME/*/PulseView.app/Contents/Frameworks/Python.framework/Versions/3.7/Python
Reason: tried: '/usr/local/opt/gettext/lib/libintl.8.dylib' (no such file), '/usr/local/lib/libintl.8.dylib' (no such file), '/usr/lib/libintl.8.dylib' (no such file)
(terminated at launch; ignore backtrace)
Homebrew installs binaries in a different location[2][3] on Apple Silicon. Some threads suggest symlinking[4] the missing binaries as a workaround, but I couldn't get those to work. This seems to be because PulseView attempts to run under x86_64
translation but with linked binaries, specifically gettext
is compiled for arm
Termination Reason: Namespace DYLD, Code 1 Library missing
Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
Referenced from: /Applications/PulseView.app/Contents/Frameworks/Python.framework/Versions/3.7/Python
Reason: tried: '/usr/local/opt/gettext/lib/libintl.8.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libintl.8.dylib' (no such file), '/usr/lib/libintl.8.dylib' (no such file), '/opt/homebrew/Cellar/gettext/0.21/lib/libintl.8.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libintl.8.dylib' (no such file), '/usr/lib/libintl.8.dylib' (no such file)
(terminated at launch; ignore backtrace)
To resolve this, I found that by running Homebrew run under Apple's Rosetta 2 translation layer, it's possible to use Homebrew to download/compile x86_64
apps and dependencies.
We can start by installing Rosetta 2[5] using the using the softwareupdate
CLI installer.
$ softwareupdate --install-rosetta
This allows us to run any process[6] with Rosetta by prefixing it with arch=x86_64
. Next, I installed Homebrew under Rosetta.
$ arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
This should install brew to /usr/local/homebrew
. You can always download and copy[7] the files manually if that doesn't work. With a x86_64
version available you can use it with Rosetta to install apps for Intel.
$ arch -x86_64 /usr/local/homebrew/bin/brew
To make this easier to work with you may choose to create an alias for the command.
alias axbrew='arch -x86_64 /usr/local/homebrew/bin/brew'
Now we can install gettext
for Intel.
$ axbrew install gettext
And finally, symlink it to the directory where PulseView expects it to be
sudo ln -s /usr/local/homebrew/Cellar/gettext/0.21/lib /usr/local/opt/gettext/
Now you should be able to start the PulseView app and be greeted with its familiar GUI.
- Anon., 2022. PulseView - sigrok. [online] Available at: https://sigrok.org/wiki/PulseView [Accessed 18 July 2022].
- GitHub. (n.d.). Discussion: longterm Homebrew prefix on Apple Silicon Macs · Issue #9177 · Homebrew/brew. [online] Available at: https://github.com/Homebrew/brew/issues/9177 [Accessed 18 Jul. 2022].
- Agrawal Ayush., 2022. Using Homebrew on M1 Mac - Earthly Blog. [online] Available at: https://earthly.dev/blog/homebrew-on-m1/ [Accessed 18 July 2022].
- sigrok.org. (n.d.). 1627 – macos 10.14.6 PulseView 0.5.0-git-4788af1. [online] Available at: https://sigrok.org/bugzilla/show_bug.cgi?id=1627#c4 [Accessed 18 Jul. 2022].
- OS X Daily. (2020). How to Install Rosetta 2 on Apple Silicon Macs. [online] Available at: https://osxdaily.com/2020/12/04/how-install-rosetta-2-apple-silicon-mac/ [Accessed 18 Jul. 2022].
- soffes.blog. (n.d.). Homebrew on Apple Silicon — Hi, I’m Sam. [online] Available at: https://soffes.blog/homebrew-on-apple-silicon [Accessed 18 Jul. 2022].
- Okada, S. (2022). How to Install x86_64 Homebrew Packages on Apple M1 MacBook. [online] mkdir Awesome. Available at: https://medium.com/mkdir-awesome/how-to-install-x86-64-homebrew-packages-on-apple-m1-macbook-54ba295230f [Accessed 18 Jul. 2022].