higra / Higra

Hierarchical Graph Analysis
Other
96 stars 18 forks source link

Add binaries for Mac Silicon #249

Open PerretB opened 1 year ago

PerretB commented 1 year ago

Probably need to cross compile with CiBuildWheel

PerretB commented 1 year ago

Need extra env for cibuildwheel https://cibuildwheel.readthedocs.io/en/stable/faq/#apple-silicon

Cmake must be instructed to cross-compile https://github.com/pypa/cibuildwheel/issues/1345#issuecomment-1322568086

If activated TBB should also be cross-compiled... not sure if this is worth supporting, maybe wait until mac silicon is natively available in Azure agents https://github.com/higra/Higra/blob/f58a30152638b7f8399538677ffc9d6aa20d4414/tools/cibuildwheel_osx.sh#L14

JoOkuma commented 1 year ago

Hi @PerretB, are you planning to add an Apple silicon binary?

Some collaborators are compiling from source to use on their laptops.

I really like using higra, thanks a lot for this package.

cc: @ilan-francisco

PerretB commented 1 year ago

Hi Jordão,

thank you for your feedback, it's a pleasure to know that Higra is useful to you.

It's great news that your colleagues have been able to compile from source and use it on ARM because I never tested it :)

I plan to add Mac ARM support, but I'm a bit stuck as free CI/CD pipelines don't currently offer such hardware. I can try to cross compile it from an x86 Mac, but then I don't know how to test the result, and I am very reluctant to publish non-tested wheels on Pypi. Microsoft Azure seems to have a plan for supporting this, but the issue looks staled https://github.com/microsoft/azure-pipelines-agent/issues/3922

Maybe a temporary solution could be to publish untested wheels on github with a download link. It would not be as convenient as publishing it on Pypi as users would have to download the wheel manually, but it would still be easier than compiling it manually.

On a side note: another solution for your colleagues is to install the amd_x86 version of Python with Rosetta 2.

JoOkuma commented 1 year ago

Thanks for the quick reply @PerretB. I completely agree with not pushing to pypi untested binaries. We can continue installing from the source until a free OSX ARM CI is available. Thanks again.

patrickbreier commented 4 months ago

Hey there, I just wanted ask what is the matter on this subject since arm64 runners are now available on GitHub (https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/). Thank you guys for your work!

PerretB commented 4 months ago

Oh thank you for pointing this. I'll set up the CI/CD then, hopefully everything goes smoothly, and binaries will be available soon for Mac silicon

Edit: apparently ATM only Github actions supports M1, but not Azure pipelines https://github.com/actions/runner-images/issues/7508#issuecomment-1917416413 (which this repo is currently using). Updated issue on azure agents, seems to be moving https://github.com/actions/runner-images/issues/8971

PerretB commented 1 month ago

mac-arm64 is now supported through conda higra-feedstock thanks to @JoOkuma

conda install higra -c conda-forge

It will be added to Pypi as soon as arm64 agents are available on Azure pipelines.