Max SDK compiling for M1 and M4 MacOS

Laurence Hobden's icon

Hi there,

I've been creating some custom max externals with the Max SDK and have run into an issue where an external compiled on an M4 Mac Mini doesn't work on an M1 MacBook Pro. Max recognises the external on the MacBook, but when I add it to the canvas, I get a "wrong architecture" message and the block is yellowed out.

Is there a way to compile an external that works on both? Is there a CMake setting I've missed? Or something I need to manually change in Xcode?

Many thanks for any help on this.

Cheers,

Laurence

Laurence Hobden's icon

OK, update on this. The M1 vs M4 is not the issue.

The issue is that Git doesn't pick up the MacOS folder inside the Contents folder of the mxo file on macOS, therefore, the actual external file itself isn't picked up. So when I built on the Mac Mini and pushed to Git, then pulled on the MacBook, it got all the other files associated with the external which is why it would let me add it to the canvas, but didn't get the external file, which is why it was yellowed out.

If I copy the mxo file/folder structure onto my Windows machine then Git picks it all up fine, but Git on macOS won't pick it up even if I explicitly try to add the folder.

Anyone else had this issue and found a way round it that isn't having to build on Mac then copy back to Windows to push to Git.

JBG's icon

Hi Laurence,

It's generally considered bad practice to push build artifacts to git. If you're using the package templates (min, max) these have github actions set up that you can run in the actions tab to automatically build and package the externals both windows and macos.

With that said, if you still want to push your externals directly to git, you can just delete the corresponding lines from your repo's .gitignore or add them manually with the -f flag (e.g. git add -f <externals/my_external.mxo> )