<div dir="ltr"><div><div><div>Hi,<br><br></div>I create an Ubuntu VM, cloned numpy and it compiled correctly in it.<br><br></div>I tried in my normal development environment (instead of a virtualenv) with my old clone that is updated of numpy and it failed. So this isn't virtualenv.<br>
<br>I created a new clone of numpy and it compiled correctly with my normal development environment.<br><br></div><div>So this seam to indicate that the __multiarray_api.* are cached.<br><br></div><div>In the new clone, I have this after compilation:<br>
<br>$find . -name '*multiarray_api*'<br>./build/src.linux-x86_64-2.7/numpy/core/include/numpy/__multiarray_api.c<br>./build/src.linux-x86_64-2.7/numpy/core/include/numpy/multiarray_api.txt<br>./build/src.linux-x86_64-2.7/numpy/core/include/numpy/__multiarray_api.h<br>
<br></div><div>In my old clone, I have this:<br>$cd ../numpy<br>[bastienf@oolong numpy]$find . -name '*multiarray_api*'<br>./numpy/core/include/numpy/__multiarray_api.h<br>./build/src.linux-x86_64-2.7/numpy/core/include/numpy/__multiarray_api.c<br>
./build/src.linux-x86_64-2.7/numpy/core/include/numpy/multiarray_api.txt<br>./build/src.linux-x86_64-2.7/numpy/core/include/numpy/__multiarray_api.h<br><br></div><div>So for some reason, the __multiarray_api.h file ended in the source of numpy. When this happen all following compilation reuse it instead of regenerating it.<br>
<br></div><div>If in the new numpy clone, I run: python setup.py build_ext --inplace<br><br></div><div>I get:<br><br>$find . -name '*multiarray_api*'<br>./numpy/core/include/numpy/__multiarray_api.c<br>./numpy/core/include/numpy/multiarray_api.txt<br>
./numpy/core/include/numpy/__multiarray_api.h<br>./build/src.linux-x86_64-2.7/numpy/core/include/numpy/__multiarray_api.c<br>./build/src.linux-x86_64-2.7/numpy/core/include/numpy/multiarray_api.txt<br>./build/src.linux-x86_64-2.7/numpy/core/include/numpy/__multiarray_api.h<br>
<br></div><div>So this could explain how I ended up with a numpy clone in such state.<br><br></div><div>I think we should make numpy always regenerate the auto-generated files even if they are present, or it would need to check if they are older the the source of thoses files. Do you think this is the good solution too? Do someone have guidance on where those file are generated? Do you and how do you support the partial rebuild vs the full rebuild?<br>
<br></div><div>Or is it just not supported to build inplace? In the .gitignore file, there is 41 files that seam to be generated.<br></div><div><br></div><div>thanks<br><br>Frédéric<br></div><div><br></div><div><br><br></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 9, 2013 at 2:14 PM, Charles R Harris <span dir="ltr"><<a href="mailto:charlesr.harris@gmail.com" target="_blank">charlesr.harris@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Mon, Sep 9, 2013 at 12:04 PM, Charles R Harris <span dir="ltr"><<a href="mailto:charlesr.harris@gmail.com" target="_blank">charlesr.harris@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div>On Mon, Sep 9, 2013 at 11:09 AM, Frédéric Bastien <span dir="ltr"><<a href="mailto:nouiz@nouiz.org" target="_blank">nouiz@nouiz.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>I don't have CFLAGS defined. But I have iothers env variable that point to other python stuff like CPATH.<br>
<br></div>But even in that case, I don't understand how other people could have compiled methods.c. The include aren't part of the env variable, but in the file.<br>
<br></div><div>Anyway, I think your PR is the good fix. I checked our PR and now I have this new error:<br><br>gcc: numpy/core/src/multiarray/multiarraymodule.c<br><br>In file included from numpy/core/src/multiarray/multiarraymodule.c:3753:0:<br>
<br>build/src.linux-x86_64-2.7/numpy/core/include/numpy/__multiarray_api.c:303:18: error: ‘PyArray_Partition’ undeclared here (not in a function)<br><br>build/src.linux-x86_64-2.7/numpy/core/include/numpy/__multiarray_api.c:304:18: error: ‘PyArray_ArgPartition’ undeclared here (not in a function)<br>
<br>In file included from numpy/core/src/multiarray/multiarraymodule.c:3753:0:<br><br>build/src.linux-x86_64-2.7/numpy/core/include/numpy/__multiarray_api.c:303:18: error: ‘PyArray_Partition’ undeclared here (not in a function)<br>
<br>build/src.linux-x86_64-2.7/numpy/core/include/numpy/__multiarray_api.c:304:18: error: ‘PyArray_ArgPartition’ undeclared here (not in a function)<br><br>error: Command "gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -O2 -fPIC -DHAVE_NPY_CONFIG_H=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-2.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/include -I/opt/lisa/os/epd-7.1.2/include/python2.7 -c numpy/core/src/multiarray/multiarraymodule.c -o build/temp.linux-x86_64-2.7/numpy/core/src/multiarray/multiarraymodule.o" failed with exit status 1<br>
<br><br></div><div>So it seam we have the same problem with those 2 functions. They are defined in numpy/core/src/multiarray/item_selection.c, but not in the .h file.<br></div><div><br></div></div></blockquote><div><br></div>
</div><div>I'm going to guess that there is something special about your virtualenv.<br><br></div><div><snip><br><br></div></div></div></div></blockquote><div><br></div></div></div><div>The prototypes should be in `arrayobject.h` and `ndarrayobject.h`. Perhaps old versions are being used and cached somewhere. Are they precompiled somewhere?<br>
<br></div><div>Chuck</div></div><br></div></div>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div>