[Numpy-discussion] NumPy on 64-bit Linux (Opteron)

David M. Cooke cookedm at physics.mcmaster.ca
Tue Feb 8 08:46:11 CST 2005


On Tue, Feb 08, 2005 at 12:44:18PM +0100, konrad.hinsen at laposte.net wrote:
> Is anyone here using NumPy on Opteron machines running Linux in 64 bit  
> mode? I am running into problems such as:
> 
> Python 2.4 (#4, Jan 18 2005, 18:06:45)
> [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-42)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from Numeric import *
> >>> a = arange(4)
> >>> a
> array([0, 1, 2, 3])
> >>> a.shape = (2, 2)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ValueError: total size of new array must be unchanged
> 
> This is with Python 2.4 and Numeric 23.7. Before looking into this  
> myself, I thought I'd ask here, perhaps someone has already found a  
> fix.

Yes; I submitted a patch (#1108739) to the Numeric patch tracker last week.

Basically, PyArray_Reshape takes an array of dimensions. That has to be
a PyArray_INT (C ints) instead of the PyArray_LONG (C longs) that it has
in the code, because that array is passed to PyArray_FromDimsAndDataAndDescr.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca




More information about the Numpy-discussion mailing list