Cross compiling for M1?

Iain Duncan's icon

Hi external authors, has anyone here tried cross-compiling for M1 from an intel mac? And if so, how did it go? I realize I will need to test the binary on another machine, but right now that is somewhat doable for me while developing on M1 is not. thanks!

Rob Ramirez's icon

you can cross compile for arm64, or make Fat binaries, from an Intel Mac with Xcode 12 and up (not sure what minor version needed, maybe .3 or .4).

if you run into any issues give a shout. and make sure you check out the info presented here on generating project files with the Max 8.2 SDK - https://github.com/Cycling74/max-sdk/blob/main/README-8.2-update.md

Iain Duncan's icon

Thanks Rob, I shall try this after end of semester. Can I ask, while I have you in a thread, is the expectation that things in the package manager should now have M1 builds? I feel Scheme for Max is now ready for the package manager (as of 0.3), but haven't tackled M1 builds yet, so if that needs to come first, that's cool.

Isabel Kaspriskie's icon

Hi Iain,

Yes, in general new package submissions should be Fat (Intel + M1) builds for Mac.

Iain Duncan's icon

Thanks Isabel, that makes sense. l'll hold off on submitting for a package until we've got M1 builds sorted.

11OLSEN's icon

Hi, I have a strange problem with Xcode. Yesterday I succeded generating the project files with cmake. I opened one of the projects in Xcode and was happy that I saw "Any Mac (Intel, Arm64)" as a target in the sheme selection dropdown.
Today I was about to actually start some work but after opening any of the projects I noticed that the Arm64 disappeared in the sheme selection.

I haven't changed anything. Even repeating the whole process of cloning sdk and building the projects with cmake does not bring the Arm64 option back to the sheme menu. The build settings are correct

but it's not reflected in the sheme selection. Any idea?
It's Xcode 12.1 on OSX 10.15.7

11OLSEN's icon

I think this is a problem with the macosx sdk. I'm going to download xcode 12.4 and see if that helps

11OLSEN's icon

https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary

Xcode 12.2 and later is a requirement for building universal binaries. Earlier versions of Xcode don’t contain the support needed to build and test universal versions of your macOS code.

💡