UDST / pandana

Pandas Network Analysis by UrbanSim: fast accessibility metrics and shortest paths, using contraction hierarchies :world_map:
http://udst.github.io/pandana
GNU Affero General Public License v3.0
386 stars 84 forks source link

Compilation fixes for MacOS 10.15 Catalina #137

Closed smmaurer closed 4 years ago

smmaurer commented 4 years ago

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

coveralls commented 4 years ago

Coverage Status

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

coveralls commented 4 years ago

Coverage Status

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