scipy/scipy — pull request #2695 by michaelwimmer (2013-08-05 21:00:27+00:00)
Title: Completion of g77 ABI wrappers for MacOSX

The MacOSX Accelerate framework adheres to g77 ABI conventions (this is stated for example [here] (https://developer.apple.com/hardwaredrivers/ve/errata.html#fortran_conventions), although the solution presented there is incomplete): This implies that

- every function returning a single precision floating point value (Fortran REAL) in fact returns a double precision
value (Fortran DOUBLE PRECISION)
- every function returning a complex number is in fact internally a subroutine with the result as the first argument, i.e. ```COMPLEX FUNCTION X(A, B, C)``` is in fact ```SUBROUTINE X(RESULT, A, B, C)```

Trying to link gfortran generated code with this different ABI results either in crashes (typically for complex) or wrong results (especially for REAL). Scipy already contained wrappers that solved these ABI issues for some BLAS/LAPACK routines (in particular C,ZDOTC, C,ZDOTU), but these ABI wrappers were rather incomplete.

As a result, the scipy tests involving single precision failed often on OSX machines (see e.g. issue #2248).

In this pull request:
- the ABI wrappers for the basic lapack/blas wrappers in scipy.linalg and scipy.lib are completed
- the ABI wrappers for the Fortran routines in scipy.sparse.linalg.isolve are completed
- test cases for single precision for the iterative solvers are added (there were no before, so the failure of the iterative solvers on OSX was unnoticed)
- the ABI wrappers for ARPACK are completed
- single precision in ARPACK has been enabled again
- pv's patch for ARPACK is included (see http://forge.scilab.org/index.php/p/arpack-ng/issues/1259/)

With these changes, all relevant tests pass again for my MacOSX 10.8 machine that showed many failures before these patches.