numpy/numpy — pull request #3439 by pv (2013-06-15 14:56:36+00:00)
Title: BUG: distutils: check Fortran ABI for BLAS libraries 

Make numpy.distutils to check that the BLAS libraries can actually be used from Fortran, with the currently active Fortran compiler configuration. Failing to check this can result to several commonly used functions such as SDOT, DDOT, ..., to either return invalid results or segfault when called from Fortran code.

The second commit also turns on `-ff2c` flag on OSX for gfortran, so that the default flags are compatible with Veclib/Accelerate. The other commit is independent of this. We can drop the OSX flag change, if it seems too risky (the ABI error message is informative and tells the user how to add `-ff2c` to the build flags).

Known occurrence of problems: Scipy's ARPACK routines currently **fail consistently** on OSX due to Fortran ABI mismatch. Scipy has some wrapper code that uses Veclib's C API instead of the Fortran API, but this is brittle and fails for a reason or another to work properly on OSX 10.7 and 10.8. Such wrappers are IMHO better left on the responsibility of whoever is doing the building rather than bundled by us.

Moreover, allowing numpy.distutils to give an incompatible flags+library info combination is a trap for 3rd party modules, whose authors may not be aware (and should not be requried to be!) of the Fortran ABI issues.

NOTE: this PR affects also Intel MKL which I think may have similar ABI issues, so also it should be tested. I don't yet know how far the consequences stretch in this direction, so feedback would be useful.

@cournape: heads up, this probably may affect Enthought's build rig