nipy/dipy — pull request #527 by omarocegueda (2014-12-29 02:34:54+00:00)
Title: Remove npymath library from cython extensions

When numpy is built with mingw, the npy_* functions exported from __libnpymath.a__ reference some runtime math functions whose name has a leading underscore, like:
...
000008E5 REL32 00000000 86 _asinf
000008F5 REL32 00000000 85 _acosf
00000905 REL32 00000000 84 _atanf
...
If we try to link this library with visual c by renaming it to npymath.lib it will fail because the corresponding functions in the msvc runtime don't contain that leading underscore:
...
00000281 REL32 00000000 4F asinf
00000291 REL32 00000000 51 acosf
000002A1 REL32 00000000 53 atanf
...
This means that the library compiled with mingw is not compatible with visual c, and we get these errors:
http://nipy.bic.berkeley.edu/builders/dipy-bdist32-34/builds/76/steps/shell_6/logs/stdio

This PR removes the npymath library from the linking step of the cython extensions, and defines the required subset of math functions in dpy_math.h (by borrowing some code directly from numpy).

With the proposed modification, the conflicting buildbots now pass:
http://nipy.bic.berkeley.edu/builders/dipy-bdist32-33/builds/78
http://nipy.bic.berkeley.edu/builders/dipy-bdist32-34/builds/80