Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

PyValhalla for mac os arm #31

Open
baileyheading opened this issue May 23, 2023 · 8 comments
Open

PyValhalla for mac os arm #31

baileyheading opened this issue May 23, 2023 · 8 comments

Comments

@baileyheading
Copy link

Hi,

I managed to hack PyValhalla to run a Mac os arm valhalla build I made a week or so ago

Once the isochrone issues I encountered are sorted, I should be able to help out with the build process for PyValhalla

Can't say I know exactly what is going on in the build scripts here, but to me it looks like the main thing to change from "build_mac.sh" would be pathing to the mac os arm location

@nilsnolde
Copy link
Member

That'd be really nice to have a user reporting how to do it.

Not sure we'd ever really have a pipeline to publish M1 binaries on PyPI as long as there's no easily accessible & free M1 runners on GHA. It can be done locally as well (build all minor Python versions separately and publish them manually), but it's painful and I can tell 100% that no one would commit to that long-term (or very soon un-commit after starting;)).

@baileyheading
Copy link
Author

It seems this is on the GitHub roadmap for Q4 2023

github/roadmap#528

image

@kkostov
Copy link

kkostov commented Mar 1, 2024

It seems GitHub has added support for ARM based distributions of macOS. It would be an amazing improvement to DX if Valhalla's python bindings work on ARM Macs.

@nilsnolde
Copy link
Member

yeah, we're already using that in upstream valhalla to build.

to be clear, python bindings are working for apple silicon, they're just not distributed on pypi. fwiw, it'd be better to do the packaging directly in valhalla as part of our release workflow. but that'll need quite a bit of work, especially for linux.

if someone is really interested, over [email protected] I'm open for this type of commercial enquiries.

@baileyheading
Copy link
Author

baileyheading commented Mar 2, 2024

I basically just pip installed PyValhalla for Mac Intel, built Valhalla for Mac ARM, then copied the PyValhalla site_packages stuff from python Intel env into a new python arm env and replaced it with the stuff I built (and renamed a few things until errors went away). Valhalla in ARM is a little faster, but the most significant gain is that you can run your regular python code in ARM.

@nilsnolde
Copy link
Member

Easiest is probably to just “sudo” install all of Valhalla, which will also install the Python bindings in the right place, unless you have a strange Python setup .

@baileyheading
Copy link
Author

Things can get a bit messy if you have different environments (I like to use Conda) and Rosetta intel + arm environments. I had such a hard time getting it to use the exact python version I wanted I gave up and hardcoded it into the CMake in Valhalla (pro move)

@nilsnolde
Copy link
Member

Haha yeah I can imagine. In theory I guess CMake should make it easy via some variables but I can imagine it's not necessarily working as expected always.. At least Valhalla is not relying on Rosetta stuff anymore and can be installed natively now on apple silicon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants