Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac M1 CI build #36

Open
adeebshihadeh opened this issue Jan 2, 2022 · 5 comments
Open

Mac M1 CI build #36

adeebshihadeh opened this issue Jan 2, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@adeebshihadeh
Copy link
Collaborator

GitHub Actions doesn't have M1 runners yet (#2187). We can either wait for that or try to have our current Mac CI build a universal build.

@adeebshihadeh adeebshihadeh added the enhancement New feature or request label Jan 2, 2022
@adeebshihadeh
Copy link
Collaborator Author

@tecandrew want to take a stab at a universal build?

@tecandrew
Copy link

sure. i've actually given this a try before putting up the M1 PR, but had little luck. brew installs either arm64 or x86 libs and i didn't find a way to indicate pulling universal2 brew libs (if they exist). Did find a way to pull x86 using Rosetta2 though 😅

I'll give it another whirl. Perhaps xcode+cmake would be the way to go

@adeebshihadeh
Copy link
Collaborator Author

I looked into that briefly too. If there's a way to install the ARM libraries on the x86 runner, then this should be pretty trivial. But nothing came up with a quick google, only for the other way around (x86 libs on M1).

@tecandrew
Copy link

tecandrew commented Jan 3, 2022

few findings:

  • couldn't get -GXcode cmake builder working properly, and pointing cmake in the direction to create for both x86_84;arm64 still complains that a lib isn't it the right architecture during the linking stage

  • i dont know scons enough to know how to cross build for x86_64 on M1 for libcereal. -archs= and -platform= variables don't seem to do anything

however, as a sanity check, I manually linked the binaries myself from the latest plugins releases (Darwin-x86_64 & Darwin-arm64) and it amazingly works with no issue lmao. I've tested the binaries myself both on Darwin x86 and arm64.

universal2-plugins.tar.gz

give them a try? its super hacky, but if you wanna avoid reworking the current codebase maybe a CI machine could just manually create the universal2 plugins using lipo -create -output <lib_nameoflib.dylib> <arm64.dylib> <x86.dylib>

image

@adeebshihadeh
Copy link
Collaborator Author

Ah, I forgot about building our own libraries. That indeed makes things trickier. We have a CI mac mini for agnos builds, but I'm not sure it's worth setting up Jenkins for an automatic PlotJuggler build. Let's see how often the M1 release actually needs to be updated. I'm hoping we either need to update the M1 release rarely or GitHub launches an M1 runner soonish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants