healpy/healpy — pull request #44 by lpsinger (2012-08-11 22:28:29+00:00)
Title: Make openmp work on Mac OS again; rework how HEALPix makefile is executed

This branch reworks how HEALPix is built. I made several improvements to `setup.py`:

* OpenMP is now disabled if the compiler is `clang` _or_ `llvm`. Both are present on Mac OS systems; neither support OpenMP (although `llvm` has a non-functional `-fopenmp` argument).
* When testing for OpenMP support, the compiler is located through the standard `distutils` mechanisms. This makes it possible to override the default compiler by specifying environment variables, as in:
```
env CC=gcc-mp-4.4 CXX=g++-mp-4.4 python setup.py install --prefix=...
```
This makes it possible to enable OpenMP support on Mac OS once again if one has an OpenMP-capable compiler (e.g. from MacPorts).
* The build of HEALPix now inherits build settings from `distutils`. This makes it so that the HEALPix libraries and the Python extension modules are built with the same compiler.
* The build of HEALPix is now a custom subclass of `distutils.command.build_clib.build_clib`. This has numerous benefits, including:
- HEALPix is automatically executed if and only if `build_ext` or any subcommand that depends on it is run.
- The HEALPix build products are now placed in an appropriate platform-specific subdirectory of `distutils`' own `build/` directory. This in turn simplifies the work that `distclean` has to do.