Matplotlib and latest numpy

Hi,

Am I wrong, or does matploib not build with current numpy svn?

Here is the error message I am getting:

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC
-I/home/varoquau/dev/numpy/trunk/numpy/core/include
-I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I.
-I/usr/include/python2.5 -c src/ft2font.cpp -o
build/temp.linux-i686-2.5/src/ft2font.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
In file included from
/home/varoquau/dev/numpy/trunk/numpy/core/include/numpy/arrayobject.h:14,
                 from src/ft2font.cpp:6:
/home/varoquau/dev/numpy/trunk/numpy/core/include/numpy/ndarrayobject.h:17:25:
error: numpyconfig.h: No such file or directory
/home/varoquau/dev/numpy/trunk/numpy/core/include/numpy/ndarrayobject.h:1829:30:
error: __multiarray_api.h: No such file or directory
src/ft2font.cpp: In member function ‘Py::Object
FT2Image::py_as_array(const Py::Tuple&)’:
src/ft2font.cpp:273: error: ‘PyArray_Type’ was not declared in this scope
src/ft2font.cpp:273: error: ‘PyArray_New’ was not declared in this scope
src/ft2font.cpp: In function ‘void initft2font()’:
src/ft2font.cpp:1877: error: ‘import_array’ was not declared in this
scope
error: command 'gcc' failed with exit status 1

If you look at the numpy/core/include/numpy/ndarrayobject.h file, it says
clearly at the top of the file "do not include this file directly".

Gaël

OK, Fernando told me that matplotlib builds fine with latest numpy on his
box so Ienquired a bit more. The problem is that the build of matplotlib
tries to include a header file that is generated automatically during the
build of numpy (__multiarray_api.h). If you install numpy using "python
setup.py install", this header file is inlcuded in the install. However I
used "python setupegg.py develop" to install numpy. As a result the
header file does not get put in the include directory. I guess this is
thus a bug in the setupegg.py of numpy, but my knowledge of setuptools is
way to low to be able to fix that.

Cheers,

Ga�l

···

On Sat, Jul 19, 2008 at 01:25:51AM +0200, Gael Varoquaux wrote:

Am I wrong, or does matploib not build with current numpy svn?