[Numpy-discussion] Scalar math module is ready for testing

Albert Strasheim fullung at gmail.com
Fri Apr 28 15:32:13 CDT 2006

Hello Travis

I'm having some problems compiling the scalarmath code with the Visual
Studio .NET 2003 compiler.

Specifically, the compiler is failing to link in the llabs, fabsf and sqrtf
functions. The reason it is not finding these symbols could be explained by
the following errors I get when building the object file by hand using the
parameters distutils passes to the compiler (for some reason distutils is
suppressing compiler output -- this is pretty, but it makes debugging build
failures hard):

build\src.win32-2.4\numpy\core\src\scalarmathmodule.c(1737) : warning C4013:
'llabs' undefined; assuming extern returning int
build\src.win32-2.4\numpy\core\src\scalarmathmodule.c(1751) : warning C4013:
'fabsf' undefined; assuming extern returning int
build\src.win32-2.4\numpy\core\src\scalarmathmodule.c(1773) : warning C4013:
'sqrtf' undefined; assuming extern returning int

In c:\Program Files\Microsoft Visual Studio .NET 2003\vc7\crt\src\math.h I
have the following (extra code stripped):

#ifndef __cplusplus
#define acosl(x)    ((long double)acos((double)(x)))
#define asinl(x)    ((long double)asin((double)(x)))
#define atanl(x)    ((long double)atan((double)(x)))
/* NOTE! no sqrtf or fabsf is defined in this block */
#else  /* __cplusplus */
#if !defined (_M_MRX000) && !defined (_M_ALPHA) && !defined (_M_IA64)
/* NOTE! none of the above are defined on x86 */
inline float fabsf(float _X)
        {return ((float)fabs((double)_X)); }
inline float sqrtf(float _X)
        {return ((float)sqrt((double)_X)); }
#endif  /* !defined (_M_MRX000) && !defined (_M_ALPHA) && !defined (_M_IA64)
#endif  /* __cplusplus */

More information about the Numpy-discussion mailing list