[Numpy-tickets] [NumPy] #164: Patch to build numpy-0.9.8 on Windows X64 (AMD64) with MSVS2005

NumPy numpy-tickets at scipy.net
Fri Jun 30 23:27:48 CDT 2006


#164: Patch to build numpy-0.9.8 on Windows X64 (AMD64) with MSVS2005
-----------------------------+----------------------------------------------
 Reporter:  GerardVermeulen  |       Owner:  somebody
     Type:  enhancement      |      Status:  new     
 Priority:  normal           |   Milestone:          
Component:  Other            |     Version:          
 Severity:  normal           |    Keywords:          
-----------------------------+----------------------------------------------
 I am assembling a Python system for Windows X64 (AMD64) built with MS
 Visual Studio 2005
 and I have patched Python (ask, if you need the patches for Python) and
 numpy. Comments on
 the patch for numpy-0.9.8 below:
 1. setup.py: this system has no fabsf, rintf, and hypotf
 2. arrayobject.c: fixes a typo
 3. umathmodule.c.src: implements the missing fabsf, rintf, and hypotf

 {{{
 --- numpy-0.9.8/numpy/core/setup.py.win64       2006-06-25
 18:26:56.984375000 +0200
 +++ numpy-0.9.8/numpy/core/setup.py     2006-06-25 18:46:24.375000000
 +0200
 @@ -75,6 +75,12 @@
                  moredefs.append('HAVE_ISINF')
              if config_cmd.check_func('rint', **kws_args):
                  moredefs.append('HAVE_RINT')
 +            if config_cmd.check_func('fabsf', **kws_args):
 +                moredefs.append('HAVE_FABSF')
 +            if config_cmd.check_func('rintf', **kws_args):
 +                moredefs.append('HAVE_RINTF')
 +            if config_cmd.check_func('hypotf', **kws_args):
 +                moredefs.append('HAVE_HYPOTF')

              if sys.version[:3] < '2.4':
                  kws_args['headers'].append('stdlib.h')
 --- numpy-0.9.8/numpy/core/src/arrayobject.c.win64      2006-06-25
 18:23:48.765625000 +0200
 +++ numpy-0.9.8/numpy/core/src/arrayobject.c    2006-06-25
 18:24:29.781250000 +0200
 @@ -451,7 +451,7 @@
  #elif SIZEOF_INTP == SIZEOF_INT
         descr = &INT_Descr;
  #else
 -       descr = &LONGLONG_DESCR;
 +       descr = &LONGLONG_Descr;
  #endif
         arr = NULL;

 --- numpy-0.9.8/numpy/core/src/umathmodule.c.src.win64  2006-05-13
 03:56:38.000000000 +0200
 +++ numpy-0.9.8/numpy/core/src/umathmodule.c.src        2006-06-25
 18:43:48.578125000 +0200
 @@ -216,6 +216,15 @@
  #endif
  #endif

 +#ifndef HAVE_FABSF
 +#ifdef fabsf
 +#undef fabsf
 +#endif
 +static float fabsf(float x)
 +{
 +       return (float)fabs((double)(x));
 +}
 +#endif

  #ifdef HAVE_HYPOT
  #if !defined(NeXT) && !defined(_MSC_VER)
 @@ -242,6 +251,12 @@
  }
  #endif

 +#ifndef HAVE_HYPOTF
 +static float hypotf(float x, float y)
 +{
 +       return (float)hypot((float)(x), (float)(y));
 +}
 +#endif

  #ifndef HAVE_RINT
  static double
 @@ -266,7 +281,13 @@
  }
  #endif

 -
 +#ifndef HAVE_RINTF
 +static float
 +rintf(float x)
 +{
 +       return (float)rint((double) x);
 +}
 +#endif

  /* Define isnan, isinf, isfinite, signbit if needed */
  /* Use fpclassify if possible */

 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/164>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list