numpy/numpy — pull request #5237 by sturlamolden (2014-10-27 07:37:59+00:00)
Title: WIP (BUG): Workaround sgefault in Apple Accelerate framework SGEMV function

SGEMV in Accelerate framework will segfault on MacOS X version 10.9
(aka Mavericks) if arrays are not aligned to 32 byte boundaries
and the CPU supports AVX instructions. This can produce segfaults
in np.dot. This patch overshadows the symbols cblas_sgemv, sgemv_ and
sgemv exported by Accelerate to produce the correct behavior. The MacOS X
version and CPU specs are checked on module import. If Mavericks and
AVX are detected the call to SGEMV is emulated with a call to SGEMM
if the arrays are not 32 byte aligned. If the exported symbols cannot
be overshadowed on module import, a fatal error is produced and the
process aborts. All the fixes are in a self-contained C file
and do not alter the multiarray C code. The patch is not applied
unless NumPy is configured to link with Apple's Accelerate
framework.