[SciPy-Dev] scipy error compiling csr_wrap under Python 2.7

Bruce Southey bsouthey at gmail.com
Tue Jul 6 17:27:09 EDT 2010


Hi,
I failed to get the scipy 0.8 rc1 and SVN to build under Python2.7 with 
numpy '2.0.0.dev8469' and gcc version 4.4.4 20100503 (Red Hat 4.4.4-2) 
(GCC) . But scipy does compile with Python 2.6.

building 'scipy.sparse.sparsetools._csr' extension
compiling C++ sources
C compiler: g++ -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv 
-O3 -Wall -fPIC

compile options: 
'-I/usr/local/lib/python2.7/site-packages/numpy/core/include 
-I/usr/local/include/python2.7 -c'
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 
-I/usr/local/lib/python2.7/site-packages/numpy/core/include 
-I/usr/local/include/python2.7 -c scipy/sparse/sparsetools/csr_wrap.cxx 
-o build/temp.linux-x86_64-2.7/scipy/sparse/sparsetools/csr_wrap.o" 
failed with exit status 1

The error is possibly related the variable 'NPY_INTP_FMT' (defined in 
numpy/core/include/numpy/ndarraytypes.h). A grep shows these files:
scipy/sparse/sparsetools/coo_wrap.cxx: sprintf(s,"%" NPY_INTP_FMT ",", 
size[i]);
scipy/sparse/sparsetools/coo_wrap.cxx: sprintf(s,"%" NPY_INTP_FMT ",", 
array_size(ary,i));
scipy/sparse/sparsetools/bsr_wrap.cxx: sprintf(s,"%" NPY_INTP_FMT ",", 
size[i]);
scipy/sparse/sparsetools/bsr_wrap.cxx: sprintf(s,"%" NPY_INTP_FMT ",", 
array_size(ary,i));
scipy/sparse/sparsetools/numpy.i: sprintf(s,"%" NPY_INTP_FMT ",", size[i]);
scipy/sparse/sparsetools/numpy.i: sprintf(s,"%" NPY_INTP_FMT ",", 
array_size(ary,i));
scipy/sparse/sparsetools/csr_wrap.cxx: sprintf(s,"%" NPY_INTP_FMT ",", 
size[i]);
scipy/sparse/sparsetools/csr_wrap.cxx: sprintf(s,"%" NPY_INTP_FMT ",", 
array_size(ary,i));
scipy/sparse/sparsetools/csc_wrap.cxx: sprintf(s,"%" NPY_INTP_FMT ",", 
size[i]);
scipy/sparse/sparsetools/csc_wrap.cxx: sprintf(s,"%" NPY_INTP_FMT ",", 
array_size(ary,i));
scipy/sparse/sparsetools/dia_wrap.cxx: sprintf(s,"%" NPY_INTP_FMT ",", 
size[i]);
scipy/sparse/sparsetools/dia_wrap.cxx: sprintf(s,"%" NPY_INTP_FMT ",", 
array_size(ary,i));

Note that the scipy/sparse/sparsetools/numpy.i contains tabs in some 
places instead of spaces.

The ndarraytypes.h is present in 
/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/

Bruce






More information about the SciPy-Dev mailing list