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

David Cournapeau cournapeau@cslab.kecl.ntt.co...
Mon Feb 11 22:24:50 CST 2008


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

What should be easier with numscons at some point is a fine grained
control. For example, the basic configuration is set in files similar to
site.cfg right now, and I intend to add the possibility to set your own
file in a near future (you can look for the file
numscons/core/compiler.cfg to see how I do things now, in numscons
sources).

If that's the kind of things you are interested in, do not hesitate to
try thing with numscons and tell me what's missing/what could be
improved. I am mostly focused on getting things working by default on
all platforms right now, but I am interested by inputs from other people
with different needs.

cheers,

David




More information about the Numpy-discussion mailing list