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 …
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
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')
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
Make clean first at every switch
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