[Numpy-discussion] New bug with "setup,py develop"

Charles R Harris charlesr.harris@gmail....
Wed Feb 13 08:27:47 CST 2008


On Feb 11, 2008 9:24 PM, David Cournapeau <cournapeau@cslab.kecl.ntt.co.jp>
wrote:

> On Mon, 2008-02-11 at 20:42 -0700, Charles R Harris wrote:
> >
> >
> > On Feb 11, 2008 7:10 PM, David Cournapeau <cournape@gmail.com> wrote:
> >
> >         On Feb 11, 2008 5:40 PM, Charles R Harris
> >         <charlesr.harris@gmail.com> wrote:
> >         >
> >         >
> >         >
> >         > On Feb 11, 2008 1:21 AM, Robert Kern <robert.kern@gmail.com>
> >         wrote:
> >         >
> >         > > I've just updated the SVN trunk to get the latest numscons
> >         merge.
> >         > > Something broke the support I put in for the setuptools
> >         "develop"
> >         > > command. In order to make sure that setuptools' "develop"
> >         works with
> >         > > numpy.distutils' "build_src", we override the "develop"
> >         command to
> >         > > reinitialize the "build_src" command to add the --inplace
> >         option. This
> >         > > used to work as of r4772, but now any Fortran Extensions
> >         have the
> >         > > generated sources added twice. This causes links to fail
> >         since the
> >         > > same symbol shows up twice.
> >         > >
> >         >
> >         > While we're talking build, how do I set the compiler flags?
> >         Numpy here
> >         > always compiles with -march=i386, which seems a bit
> >         conservative. My
> >         > environment flags are also ignored, but I assume there is
> >         someway of getting
> >         > the compile to behave.
> >
> >         Well, you assumed wrong :)
> >
> > For some reason I was hoping you would pipe up  :0) Yeah, that in
> > itself is a good reason for trying something like scons.
>
> To be more exact: you can simply add flags in distutils. It is just that
> there is not much logic to handle different cases (e.g. having different
> set of warnings for pyrex vs swig vs normal C extensions is difficult).
>
> >  I note that with -O2 -finline-functions, or -O3, I can knock almost
> > 30% off the string sort times. That's a lot better than I can do
> > fooling around with the code.
>
> You should be able to do it just with numpy.distutils:
>
> CFLAGS="-O2 -finline-functions" setup.py build
>

Curiously,  CFLAGS="-O3 -finline-functions" causes the -fno-strict-aliasing
flag to disappear when the random module is compiled, resulting in a lot of
warnings and, in my experience, probably buggy code generation. So a safer
bet is CFLAGS="-O3 -finline-functions -fno-strict-aliasing" .
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080213/47a01068/attachment-0001.html 


More information about the Numpy-discussion mailing list