-
Notifications
You must be signed in to change notification settings - Fork 83
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
Support for M1 Macs #152
Comments
It seems that an osx-arm64 build of pytables is available on conda-forge |
@chourmo Oh, great! I'll clean up the |
Binary installers for Pandana on Here's the current state of things. Note that it's not a problem to run older x86 Python installations and packages, including Pandana, on ARM Macs. These adjustments are just to support native compilation, which improves performance. Installing from Conda Forge on ARM Macs
Compiling locally for ARMAssumes you're using a copy of the codebase post-PR #159.
|
-- SEE UPDATES LATER IN THREAD --
Pandana runs on the new M1 ARM-based Macs without much trouble.
Installing Python
One option is to install Anaconda in the normal way, which for now gives you x86 binaries that runs through a translation layer. All the Python libraries I tried ran fine as x86 binaries. Performance was similar to my i7 MacBook Pro.
The Conda Forge team is doing great work with ARM builds, though. So another option is to install the
osx-arm64
build of MiniForge from here. This will set you up to conda-install the ARM builds of packages on Conda Forge, which there are already quite a lot of. More info about the Conda Forge work here: https://conda-forge.org/blog/posts/2020-10-29-macos-arm64/Installing Pandana
If you're using an x86 Python installation, you can install Pandana in any normal way (conda, pip, etc).
To get ARM binaries for Pandana, you'll need to compile locally. In my testing, the performance is about 35% better. It seems like Python environments need to be either all-x86 or all-ARM.
Clone the
osx-arm64
Pandana branch from GitHub.Conda-install the key dependencies:
clang
,llvm-openmp
,cython
,numpy
,pandas
,scikit-learn
. You should see in the status messages that you're gettingosx-arm64
binaries.Compile & install Pandana with
python setup.py develop
.I ran into a glitch involving a "No such file or directory" error after a compilation command that used
arm64-apple-darwin20.0.0-clang++
. I fixed it by going into the MiniForge binaries folder (find it withwhich clang
) and renaming theclang++
file with the longer name. This will probably be fixed upstream at some point.That should do it! The only caveat is that there's no PyTables build for ARM at this point, so you will not be able to work with h5 files.
What's different in the
osx-arm64
branch?Replaced
distutils
with the newersetuptools
, which correctly detects that ARM should be the compilation target.Commented out the PyTables dependency, because there isn't an ARM build available yet.
Commented out C++ code related to hyper-threading, because it included some lines of x86 assembly that couldn't be compiled on ARM. The M1 does not use hyper-threading (just one process per core rather than two), so there's no performance loss. But we'll need to clean this up before merging the branch.
Next steps
It sounds like an
osx-arm64
build of Pandana on Conda Forge should be straightforward (see blog post above). But at this point it's held up by the PyTables dependency.The text was updated successfully, but these errors were encountered: