[SciPy-Dev] [PATCH] Scipy and python2.7

Ralf Gommers ralf.gommers at googlemail.com
Tue Jul 27 11:20:08 EDT 2010


On Sun, Jul 25, 2010 at 8:45 PM, Fabian Pedregosa <fabian.pedregosa at inria.fr
> wrote:

> Ralf Gommers wrote:
> > Hi Fabian,
> >
> > On Thu, Jul 22, 2010 at 8:13 PM, Fabian Pedregosa
> > <fabian.pedregosa at inria.fr <mailto:fabian.pedregosa at inria.fr>> wrote:
> >
> >     Hi all.
> >
> >     With some minor changes I could install scipy using python2.7. The
> >     only thing that failed was the c++ swig wrappers in
> >     scipy.sparse.sparsetools. I believe this is because python is
> >     compiled now using gcc and not g++, and also default flags have
> changed.
> >
> >     The problem seems to be that numpy/ndarraytypes.h import inttypes.h,
> >     but the macros in this file are not accessibly from C++ unless you
> >     define the variable __STDC_FORMAT_MACROS. My solution was to define
> >     this variable in the setup.py script. This makes it build fine and
> >     test are OK too (ubuntu linux 64 bit). I attach the (git) patch.
> >
> >
> > That seems to fix the problem, good catch. I'm wondering if this really
> > belongs in setup.py. numpyconfig.h already defines __STDC_FORMAT_MACROS,
> > so maybe including that in sparsetools.i before arrayobject.h would be
> > cleaner?
>
> Thanks for the review. I tried to include numpyconfig.h in sparsetools.i
> as you suggest but for some reason it didn't solve the problem
> (hand-editing the generated swig wrapper and placing that file at start
> made it work, though). Maybe someone with more swig/C/C++ experience
> knows why.
>
>
Hmm, no idea. But admittedly I don't know too much about SWIG or C++.


> >
> > If it goes in setup.py it should also go in the SConscript file.
>
> I updated the patch in issue #1180.
>
> Thanks, looks good. This is an important patch, so unless someone objects
it will go in in the next few days.

Cheers,
Ralf

Cheers,
>
> Fabian
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20100727/63f5bd97/attachment.html>


More information about the SciPy-Dev mailing list