[SciPy-User] Compiling scipy.sparse.sparsetools extension throws g++ internal error&In-Reply-To=

Krzysztof Bartoszek krzbar@chalmers...
Sat Oct 23 18:24:58 CDT 2010


Hi,

I don't know whether anyone has done any follow up since March but I came across the exact same problem whilst installing scipy 0.8.0 under Python 2.7, the error output I got was : 

g++: scipy/sparse/sparsetools/csr_wrap.cxx
scipy/sparse/sparsetools/csr_wrap.cxx: In function ‘int require_size(PyArrayObject*, npy_intp*, int)’:
scipy/sparse/sparsetools/csr_wrap.cxx:2910: error: expected `)' before ‘PRIdPTR’
scipy/sparse/sparsetools/csr_wrap.cxx:2910: warning: spurious trailing ‘%’ in format
scipy/sparse/sparsetools/csr_wrap.cxx:2910: warning: too many arguments for format
scipy/sparse/sparsetools/csr_wrap.cxx:2917: error: expected `)' before ‘PRIdPTR’
scipy/sparse/sparsetools/csr_wrap.cxx:2917: warning: spurious trailing ‘%’ in format
scipy/sparse/sparsetools/csr_wrap.cxx:2917: warning: too many arguments for format
scipy/sparse/sparsetools/csr_wrap.cxx: In function ‘int require_size(PyArrayObject*, npy_intp*, int)’:
scipy/sparse/sparsetools/csr_wrap.cxx:2910: error: expected `)' before ‘PRIdPTR’
scipy/sparse/sparsetools/csr_wrap.cxx:2910: warning: spurious trailing ‘%’ in format
scipy/sparse/sparsetools/csr_wrap.cxx:2910: warning: too many arguments for format
scipy/sparse/sparsetools/csr_wrap.cxx:2917: error: expected `)' before ‘PRIdPTR’
scipy/sparse/sparsetools/csr_wrap.cxx:2917: warning: spurious trailing ‘%’ in format
scipy/sparse/sparsetools/csr_wrap.cxx:2917: warning: too many arguments for format
error: Command "g++ -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC

Disabling the sparse package worked as said in the previous message, but I managed to identify the lines which cause the problem :
They are 
  sprintf(s,"%" NPY_INTP_FMT ",", size[i]);
and 
 sprintf(s,"%" NPY_INTP_FMT ",", array_size(ary,i));
in the function 
int require_size(PyArrayObject* ary, npy_intp* size, int n) 
in the files  :
scipy/sparse/sparsetools/csc_wrap.cxx
scipy/sparse/sparsetools/coo_wrap.cxx
scipy/sparse/sparsetools/bsr_wrap.cxx
scipy/sparse/sparsetools/dia_wrap.cxx
scipy/sparse/sparsetools/csr_wrap.cxx
Commenting these two lines in these files makes scipy build fine, though I have not run it so I don't know what effect this will have on the functionality.
I hope this helps someone and is useful.

Cheers

Krzysztof



More information about the SciPy-User mailing list