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

Compilation fixes for MacOS 10.15 Catalina #137

Merged
merged 4 commits into from
Jun 7, 2020
Merged

Conversation

smmaurer
Copy link
Member

@smmaurer smmaurer commented Jun 3, 2020

This PR updates setup.py in order to support Pandana compilation in MacOS 10.15 Catalina, as discussed in issue #129. The system's C++ headers were moved, so the script now detects which version of the operating system is present and uses the appropriate header path. This PR also improves support for custom compilers on Mac.

New usage

Installing Pandana from Conda Forge gives you pre-compiled binaries. Installing from Pip or from source code requires local compilation. (Pip binaries are a lot harder for us to provide than Conda Forge binaries, so we had to drop them.)

Here's how local compilation works on Mac:

All Macs will need Xcode command line tools in order to do the local compilation.

xcode-select --install

At this point, you can do one of the following:

  1. Use the system's default compiler. This is the easiest if you're not using Anaconda, but will not support multi-threading in Pandana.
pip install cython numpy
pip install -e .  # or 'pip install pandana' for a production release
  1. Use the Conda toolchain. This is what we recommend.
conda install cython numpy llvm-openmp clang
pip install -e .
  1. Use a compiler of your choice, if you want multi-threading support but don't like Anaconda. Homebrew is a common alternative. As of this PR, we now detect whether you've set a CC environment variable, and if so we use whichever compiler you specify.
export CC=/your/favorite/compiler
pip install cython numpy
pip install -e .

Testing

  • compilation on 10.14 using system compiler
  • compilation on 10.14 using Conda toolchain
  • compilation on 10.15 using system compiler
  • compilation on 10.15 using Conda toolchain
  • compilation with CC set manually

@coveralls
Copy link

Coverage Status

Coverage remained the same at 89.873% when pulling db3c3d1 on macos-catalina into 620281c on vectorized-shortest-path-length.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 89.873% when pulling db3c3d1 on macos-catalina into 620281c on vectorized-shortest-path-length.

@smmaurer smmaurer changed the base branch from vectorized-shortest-path-length to develop June 7, 2020 23:17
@smmaurer smmaurer merged commit a81f3f7 into develop Jun 7, 2020
@smmaurer smmaurer deleted the macos-catalina branch June 7, 2020 23:18
@smmaurer smmaurer mentioned this pull request Jul 17, 2020
6 tasks
@smmaurer smmaurer mentioned this pull request Aug 5, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants