[Numpy-discussion] Numpy compilation error

Pradeep Jha jhapk at utias.utoronto.ca
Fri Apr 16 19:53:42 EDT 2010


Hi,

I changed it. I am not getting that error anymore, but I get the following
error:
*running build
running build_py
running build_ext
building 'Cantera._cantera' extension
g++ -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386
-mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -O3 -Wall
-fPIC -fPIC -I../../build/include -Isrc -I../clib/src
-I/nfs/carv/d1/people/pradeep/src/numpy-1.3.0//include/python
-I/usr/include/python2.4 -c src/pycantera.cpp -o
build/temp.linux-i686-2.4/src/pycantera.o
src/pycantera.cpp:25:31: error: numpy/arrayobject.h: No such file or
directory
src/ctphase_methods.cpp: In function ‘PyObject* phase_getarray(PyObject*,
PyObject*)’:
src/ctphase_methods.cpp:126: error: ‘PyArrayObject’ was not declared in this
scope
src/ctphase_methods.cpp:126: error: ‘x’ was not declared in this scope
src/ctphase_methods.cpp:132: error: ‘npy_intp’ was not declared in this
scope
**************************
**************************
**************************
**************************

*The pycantera.cpp file is at*
/nfs/carv/d1/people/pradeep/cantera/Cantera/python/src*

In the file pycantera.cpp, line number 30-31-32 say:*
#ifdef HAS_NUMPY
#include "numpy/arrayobject.h"
#else*

So the error is still with NUMPY somewhere. My sys.path in Python now shows:
*
['', '/nfs/carv/d1/people/pradeep/cantera/Cantera/python/src',
'/nfs/carv/d1/people/pradeep/cantera/bin',
'/nfs/carv/d1/people/pradeep/cantera/build/bin/i686-pc-linux-gnu',
'/nfs/carv/d1/people/pradeep/cantera/Cantera/python',
'/nfs/carv/d1/people/pradeep/cantera/Cantera/python/build/lib.linux-i686-2.4/Cantera',
'/nfs/carv/d1/people/pradeep/cantera/Cantera/python/Cantera',
'/usr/lib/python24.zip', '/usr/lib/python2.4',
'/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk',
'/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages',
'/usr/lib/python2.4/site-packages/Numeric',
'/usr/lib/python2.4/site-packages/gtk-2.0']

*In my bashrc file, the PATH variables are declared as follows:
*export CANTERA_ROOT=$HOME/cantera
export
PATH=$JAVA_HOME/bin/:$HOME/src/$PATH:$CANTERA_ROOT/build/bin/i686-pc-linux-gnu/:$HOME/src/pdfjam/scripts
export
PYTHONPATH=$PYTHONPATH:$CANTERA_ROOT/bin:$CANTERA_ROOT/build/bin/i686-pc-linux-gnu:$CANTERA_ROOT/Cantera/python:$CANTERA_ROOT/Cantera/python/build/lib.linux-i686-2.4/Cantera:$CANTERA_ROOT/Cantera/python/Cantera:
export Cantera_Path=$CANTERA_ROOT
*
I am not sure whats going wrong.*
*Thanks for your help.

2010/4/16 Robert Kern <robert.kern at gmail.com>

> On Fri, Apr 16, 2010 at 17:59, Pradeep Jha <jhapk at utias.utoronto.ca>
> wrote:
> > Hi,
> >
> > I am trying to install a software called Cantera which uses numpy. When I
> > run the make command, during the installation it gives me the following
> > error:
> >
> > /bin/rm -f _build
> > (CXX="g++"; export CXX; CC="g++"; export CC; CFLAGS="-O3 -Wall
> -fPIC";
> > export CFLAGS; PURIFY=""; export PURIFY; /usr/bin/python2 setup.py build)
> > Traceback (most recent call last):
> >   File "setup.py", line 3, in ?
> >     from distutils.core import setup, Extension
> >   File
> >
> "/nfs/carv/d1/people/pradeep/src/numpy-1.3.0/numpy/distutils/__init__.py",
> > line 6, in ?
> >     import ccompiler
> >   File
> >
> "/nfs/carv/d1/people/pradeep/src/numpy-1.3.0/numpy/distutils/ccompiler.py",
> > line 7, in ?
> >     from distutils import ccompiler
> > ImportError: cannot import name ccompiler
> > make[1]: *** [_build] Error 1
> > make[1]: Leaving directory
> > `/nfs/carv/d1/people/pradeep/cantera/Cantera/python'
> > make: *** [python] Error 2
> >
> > My numpy is stored in the following directory
> > /nfs/carv/d1/people/pradeep/src/numpy-1.3.0/
> >
> > I am running Linux (Fedora). When I do a sys.path in command line Python,
> > the output is:
> > ['', '/nfs/carv/d1/people/pradeep/src/numpy-1.3.0',
> > '/nfs/carv/d1/people/pradeep/src/numpy-1.3.0/numpy',
>
> You should not have these two entries in your sys.path. Did you add
> them yourself via PYTHONPATH? If so, remove them.
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
>  -- Umberto Eco
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20100416/f4d5d604/attachment.html>


More information about the NumPy-Discussion mailing list