Cannot load plugin built under Rosetta on M1 mac

If I’m running Rack 2.2.0 Pro on an M1 Mac, what’s the right way to build and run my plugin from source? I’ve tried both arm64 and x64 versions of 2.2.0 SDK for mac, both with rosetta and without rosetta. In all cases, after building and installing my plugin, then launching Rack 2.2.0, my plugin fails to load. I see something like this in Rack’s log.txt:

incompatible architecture (have ‘arm64’, need ‘x86_64’)

Taking one combination of the above factors as an example (build with mac x64 SDK under rosetta) I put this in arch.mk

ARCH_X64 := 1
ARCH_CPU := x64
ARCH_MAC := 1
ARCH_OS := Mac

and run the following commands…

% arch -x86_64 zsh
% RACK_DIR=/path/to/Rack-SDK-2.2.0-mac-x64 make install

which produces this file in my plugins folder…

LilacModules-2.0.1-mac-x64.vcvplugin

When I launch Rack, it prints the log message incompatible architecture (have 'arm64', need 'x86_64')

I don’t really know what I’m doing,

To repeat my question: what is the right way to build a plugin from source for Rack 2.2.0 on an M1 Mac?

I am not completely au fait with this stuff but as I understand it, if you are on an M1 mac and you build your plugin with Terminal running natively, you will get an arm version of your plugin.

If you open Terminal with Rosetta or do the % arch -x86_64 zsh command then you will get the intel version.

It looks like you are building an intel version which should work if you are running the regular version of Rack under Rosetta (not the arm beta)

You may or may find these scripts useful which were made by Paul from Surge for building on an M1 mac

1 Like

I do get a file named LilacModules-2.0.1-mac-arm64.vcvplugin when I build my plugin with Terminal running natively. But when Rack starts up and tries to load it, I see that same log message incompatible architecture (have 'arm64', need 'x86_64')

Which version of Rack are you running though - normal version (under rosetta) or arm beta version?

Switching between arm and x86 is a bit inconvenient

The arch / make combo you listed which built a -x86.vcv plugin looks right to me but only if you built clean. For instance if you built arm then built x86 your plugin.Dylib would not rebuild

The solution is when you switch architectures to

  1. Make clean first at every switch
  2. Blow out your documents / rack2 / plugins / foobaz

And you should be good

There’s various other ways to work like having two sourfe trees or hacking the sdk but for normal use just clean and rebuild when you switch otherwise you can get arm stuff in your x86 plugin

2 Likes

Which version of Rack are you running

I’ve just switched over to the arm beta and now my plugin is building and running.

I didn’t solve my x64 build issue (despite @baconpaul’s suggestion to make clean) but it’s no longer an obstacle, so I’ll forget about it for now.

Thank you!

1 Like