externals with Apple M1 & Rosetta

sleeplesswaves's icon

Hi all
I'm using vbapan~ & randdist externals with a patch. I'm on a 2020 MacBook Pro 13" running Big Sur 11.6 and the latest version of MaxMSP. When I opened my patch it gave the error: "Could not load due to incorrect architecture" for both those externals. So I went to the info window for the MaxMSP application. I checked the "Rosetta" check box and then everything opened and worked with no problems.

My question is, am I loosing speed / efficiency running this way? If so, does anyone know and easy way to make externals compatible with the M1? Would this be something the creators of the external would have to do?

Many thanks!

Isabel Kaspriskie's icon

Hi @sleeplesswaves,

There is some overhead of the Rosetta emulation which reduces speed/efficiency. (Still, in many cases Rosetta actually runs faster than Intel machines: https://screenrant.com/apple-rosetta-2-explained/)

The external creators would need to recompile to support native M1. If the externals are open source, some folks on the forum might be willing to help compile them for you if you're not comfortable with it yourself. Alternatively, you can share the following info on how to update externals to support M1: https://github.com/Cycling74/max-sdk/blob/main/README-8.2-update.md .

sleeplesswaves's icon

@Isabel

Many thanks for the overview. Okay, I was able to recompile the CICM Tools including ambicube~ ambipan~ and vbapan~ found here: https://github.com/CICM/CicmTools/releases/tag/v2.1
I compiled them in Xcode using the "Any Mac (Apple Silicon, Intel) setting. I tested on my 2020 MacBook Pro M1 and it's working. I'm attaching those in case anyone else needs them.

I'm having trouble compiling randdist from the CNMAT Externals found here: https://github.com/CNMAT/CNMAT-Externs/releases/tag/v1.0.4

I'm having trouble with Xcode finding the max-sdk files. I downloaded those and put them in the project folder. But it's tricky getting Xcode to see them... some of the file paths had "../" in front of the path, which was causing a build error. I changed it in some of the project files but now I'm still getting a build error:

error: Build input file cannot be found: '/Users/username/Desktop/CNMAT_Externals/max-sdk/source/c74support/max-includes/common/commonsyms.c' (in target 'randdist' from project 'CNMAT-Externs')

But when I check the file path it's perfect and the file is there. I thought maybe it was a permissions thing so I did a chmod 777 on all the files in the max-sdk folder. Still nothing. Anybody out there have ideas or can help me compile this? I'd love to get this fixed!!! It's driving me nuts. :-)

Many thanks!

sleeplesswaves's icon

Oops, I forgot the files...

CICM Tools 2021.zip
application/zip 56.16 KB
CICM Tools recompiled in 2021 for Apple Silicon

Isabel Kaspriskie's icon

Nice! Looks like CNMAT is working pretty actively on updating for Apple Silicon on this branch here: https://github.com/CNMAT/CNMAT-Externs/tree/Apple-Silicon

That might be a better place to start if you don't want to wait for an official release :)

sleeplesswaves's icon

Okay... been fooling... Now getting the error:

'gsl/gsl_rng.h' file not found

I've installed GSL via brew here:

/opt/homebrew/Cellar/gsl/2.7

But Xcode still doesn't see it... I think I need to link it but I'm not sure how. I do some programming, but not much with Xcode so I'm floundering on how to get the project to see GSL so I can compile it. blah... :-)

sleeplesswaves's icon

@Isabel
Thanks again for that... I followed those (lengthy) directions and got everything installed.... Then on the final "make" in the CNMAT-Externs directory I get this:

The following build commands failed:

CompileC /Users/username/Desktop/CNMAT/CNMAT-Externs/build/CNMAT-Externs.build/Release/thread.fork.build/Objects-normal/x86_64/thread.fork.o /Users/username/Desktop/CNMAT/CNMAT-Externs/src/thread.fork/thread.fork.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler (in target 'thread.fork' from project 'CNMAT-Externs')

(1 failure)

make: *** [MACOBJECTS] Error 65

I'm so close! If anyone else figures this out throw me a bone. Thanks!

sleeplesswaves's icon

Just following up on this... Never got this to compile, they're still changing things often so my builds would fail. I did find an alternative to "randdist" called "between" in the Real Time Composition Library externals. This works fine on Apple silicon.

The problem after getting my externals compatible with ARM was I turned off the "Rosetta" check for opening Max. When I opened my project I then had problems with VSTs... I got so many errors saying it couldn't open VST2s that worked fine under Rosetta... Also the VSTs that opened were really sluggish and my mouse would freeze up for a few seconds and things like that.. So for now I went back to Rosetta where things are running smoothly. Just wanted to document all this for others who may be bumping around through the maze.

Rob Ramirez's icon

looks like they have a pre-release with arm64 support FWIW - https://github.com/CNMAT/CNMAT-Externs/releases/tag/v1.0.4c

sleeplesswaves's icon

@Rob
Thanks, I did find that release. But the ironic part is they seem to have removed the "randdist" object from these newer releases. Just FYI for anyone else out there that may actually be looking for randdist. Again, the "between" object from the Real Time Composition Library works similarly for my needs.

mzed's icon

I've been told there's an incompatibility between the GSL license and UC Berkeley's license requirment which prevents them from distributing randdist. Maybe contact the author directly?