Re: Errors building PyNIO on RHEL 5.3

From: Allen, Pat <pat_at_nyahnyahspammersnyahnyah>
Date: Fri, 4 Sep 2009 11:26:31 -0700

Thanks for the pointer! I followed Mary's suggestion and changed the line to

        INC_DIRS.insert(0,numpy.get_include())

and it worked great. Thanks again!

Pat

-----Original Message-----
From: Mary Haley [mailto:haley_at_ucar.edu]
Sent: Wednesday, September 02, 2009 1:16 PM
To: Allen, Pat
Cc: pyngl-talk_at_ucar.edu
Subject: Re: Errors building PyNIO on RHEL 5.3

Hi Pat,

To build on what Dave said, I think you can use "numpy.get_include()"
to retrieve the path of the numpy include files.

In setup.py, try replacing:

INC_DIRS.insert(0,os.path.join(pkgs_pth,"numpy","core","include"))

with:

INC_DIRS.insert(0,numpy.get_include())

For older versions of numpy, it might be:

INC_DIRS.insert(0,numpy.get_numpy_include())

--Mary

On Mon, 31 Aug 2009, David Brown wrote:

> Hi Pat,
> It appears that the PyNIO build process does not account for the possible
> installation of the numpy package to an ".egg" directory.
> As a quick work-around you could try modifying the pynio/setup.py file by
> changing the following line (~ line 220):
>
> INC_DIRS.insert(0,os.path.join(pkgs_pth,"numpy","core","include"))
>
> to
>
> INC_DIRS.insert(0,os.path.join(pkgs_pth,"numpy-1.3.0-py2.4-linux-i686.egg",
> "numpy","core","include"))
>
> We will have to research this problem a little more to develop a universal
> solution.
> If you have further problems, please contact me directly.
> -dave
>
>
> On Aug 31, 2009, at 2:21 PM, Allen, Pat wrote:
>
>> Hi,
>>
>> I posted this once but I never saw it submitted and I don't see it in the
>> archives. So I'm going to post it again. Sorry if there are two copies but
>> this is sort of important. I'mtrying to build PyNIO 1.3.0b1 from source on
>> RHEL 5.3. Here's some of the relevant information:
>> # uname -m
>> i686
>> # python -V
>> Python 2.4.3
>> # gcc --version
>> gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)
>>
>> However I get the following errors trying to build the software:
>> # python setup.py install
>> ====> Installing Nio to the "PyNIO" site packages directory.
>> running install
>> running build
>> running build_py
>> copying ./pynio_version.py -> build/lib.linux-i686-2.4/PyNIO
>> running build_ext
>> building 'nio' extension
>> gcc -pthread -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 -fPIC -DNeedFuncProto=1 -I/usr/lib/python2.4/site-
>> packages/numpy/core/include -I/usr/local/ncl/include -Iinclude -I/
>> usr/include/python2.4 -c niomodule.c -o build/temp.linux-i686-2.4/
>> niomodule.o
>> niomodule.c:18:31: error: numpy/arrayobject.h: No such file or directory
>> In file included from niomodule.c:33:
>> niomodule.h:221: error: expected '=', ',', ';', 'asm' or '__attribute__'
>> before '*' token
>> niomodule.c: In function 'data_type':
>> niomodule.c:381: error: 'PyArray_SHORT' undeclared (first use in this
>> function)
>> niomodule.c:381: error: (Each undeclared identifier is reported only once
>> niomodule.c:381: error: for each function it appears in.)
>> niomodule.c:383: error: 'PyArray_INT' undeclared (first use in this
>> function)
>> niomodule.c:385: error: 'PyArray_LONG' undeclared (first use in this
>> function)
>> niomodule.c:387: error: 'PyArray_FLOAT' undeclared (first use in this
>> function)
>> niomodule.c:389: error: 'PyArray_DOUBLE' undeclared (first use in this
>> function)
>> niomodule.c:391: error: 'PyArray_UBYTE' undeclared (first use in this
>> function)
>> niomodule.c:393: error: 'PyArray_CHAR' undeclared (first use in this
>> function)
>> niomodule.c:395: error: 'PyArray_BOOL' undeclared (first use in this
>> function)
>> niomodule.c:397: error: 'PyArray_STRING' undeclared (first use in this
>> function)
>> niomodule.c:399: error: 'PyArray_NOTYPE' undeclared (first use in this
>> function)
>> niomodule.c: In function 'typecode':
>> niomodule.c:432: error: 'PyArray_BOOL' undeclared (first use in this
>> function)
>> niomodule.c:433: error: 'PyArray_BOOLLTR' undeclared (first use in this
>> function)
>> niomodule.c:435: error: 'PyArray_BYTE' undeclared (first use in this
>> function)
>> niomodule.c:436: error: 'PyArray_BYTELTR' undeclared (first use in this
>> function)
>> niomodule.c:438: error: 'PyArray_UBYTE' undeclared (first use in this
>> function)
>> niomodule.c:439: error: 'PyArray_UBYTELTR' undeclared (first use in this
>> function)
>> niomodule.c:441: error: 'PyArray_SHORT' undeclared (first use in this
>> function)
>> niomodule.c:442: error: 'PyArray_SHORTLTR' undeclared (first use in this
>> function)
>> niomodule.c:444: error: 'PyArray_INT' undeclared (first use in this
>> function)
>> niomodule.c:445: error: 'PyArray_INTLTR' undeclared (first use in this
>> function)
>> niomodule.c:447: error: 'PyArray_LONG' undeclared (first use in this
>> function)
>> niomodule.c:448: error: 'PyArray_LONGLTR' undeclared (first use in this
>> function)
>> niomodule.c:450: error: 'PyArray_FLOAT' undeclared (first use in this
>> function)
>> niomodule.c:451: error: 'PyArray_FLOATLTR' undeclared (first use in this
>> function)
>> niomodule.c:453: error: 'PyArray_DOUBLE' undeclared (first use in this
>> function)
>> niomodule.c:454: error: 'PyArray_DOUBLELTR' undeclared (first use in this
>> function)
>> niomodule.c:456: error: 'PyArray_STRING' undeclared (first use in this
>> function)
>> niomodule.c:457: error: 'PyArray_STRINGLTR' undeclared (first use in this
>> function)
>> niomodule.c:459: error: 'PyArray_CHAR' undeclared (first use in this
>> function)
>> niomodule.c: In function 'collect_attributes':
>> niomodule.c:517: error: 'npy_intp' undeclared (first use in this function)
>> niomodule.c:517: error: expected ';' before 'length'
>> niomodule.c:552: error: 'length' undeclared (first use in this function)
>> niomodule.c:552: error: expected ';' before 'md'
>> niomodule.c:554: warning: implicit declaration of function
>> 'PyArray_SimpleNew'
>> niomodule.c:554: warning: assignment makes pointer from integer without a
>> cast
>> niomodule.c:556: error: 'PyArrayObject' undeclared (first use in this
>> function)
>> niomodule.c:556: error: expected expression before ')' token
>> niomodule.c:556: error: expected expression before ')' token
>> niomodule.c:556: error: expected expression before ')' token
>> niomodule.c:556: error: expected expression before ')' token
>> niomodule.c:558: warning: implicit declaration of function 'PyArray_Return'
>> niomodule.c:558: error: expected expression before ')' token
>> niomodule.c:558: warning: assignment makes pointer from integer without a
>> cast
>> niomodule.c: In function 'set_attribute':
>> niomodule.c:575: error: 'PyArrayObject' undeclared (first use in this
>> function)
>> niomodule.c:575: error: 'array' undeclared (first use in this function)
>> niomodule.c:603: error: 'PyArray_NOTYPE' undeclared (first use in this
>> function)
>> niomodule.c:604: error: 'tmparray' undeclared (first use in this function)
>> niomodule.c:604: error: expected expression before ')' token
>> niomodule.c:608: error: expected expression before ')' token
>> niomodule.c:613: error: 'array2' undeclared (first use in this function)
>> niomodule.c:613: error: expected expression before ')' token
>> niomodule.c:626: error: 'npy_intp' undeclared (first use in this function)
>> niomodule.c: In function 'NioFileObject_str':
>> niomodule.c:1362: error: 'PyArrayObject' undeclared (first use in this
>> function)
>> niomodule.c:1362: error: 'att_arr_val' undeclared (first use in this
>> function)
>> niomodule.c:1362: error: expected expression before ')' token
>> niomodule.c:1364: warning: implicit declaration of function 'PyArray_DATA'
>> niomodule.c:1454: error: expected expression before ')' token
>> niomodule.c: In function 'NioVariableObject_value':
>> niomodule.c:1633: warning: implicit declaration of function
>> 'NioVariable_ReadAsArray'
>> niomodule.c:1633: warning: return makes pointer from integer without a cast
>> niomodule.c: At top level:
>> niomodule.c:1818: error: expected '=', ',', ';', 'asm' or '__attribute__'
>> before '*' token
>> niomodule.c: In function 'NioVariable_ReadAsString':
>> niomodule.c:2030: error: 'PyArray_CHAR' undeclared (first use in this
>> function)
>> niomodule.c: In function 'NioVariable_WriteArray':
>> niomodule.c:2058: error: 'PyArrayObject' undeclared (first use in this
>> function)
>> niomodule.c:2058: error: 'array' undeclared (first use in this function)
>> niomodule.c:2161: error: expected expression before ')' token
>> niomodule.c:2163: error: 'array2' undeclared (first use in this function)
>> niomodule.c:2163: error: expected expression before ')' token
>> niomodule.c:2168: error: expected expression before ')' token
>> niomodule.c:2183: error: expected expression before ')' token
>> niomodule.c:2187: error: expected expression before ')' token
>> niomodule.c:2313: error: expected expression before ')' token
>> niomodule.c: In function 'NioVariable_WriteString':
>> niomodule.c:2379: error: 'PyArray_CHAR' undeclared (first use in this
>> function)
>> niomodule.c: In function 'NioVariableObject_item':
>> niomodule.c:2432: warning: return makes pointer from integer without a cast
>> niomodule.c: In function 'NioVariableObject_slice':
>> niomodule.c:2449: warning: return makes pointer from integer without a cast
>> niomodule.c: In function 'NioVariableObject_subscript':
>> niomodule.c:2476: warning: return makes pointer from integer without a cast
>> niomodule.c:2513: warning: return makes pointer from integer without a cast
>> niomodule.c: In function 'NioVariableObject_str':
>> niomodule.c:2883: error: 'PyArrayObject' undeclared (first use in this
>> function)
>> niomodule.c:2883: error: 'att_arr_val' undeclared (first use in this
>> function)
>> niomodule.c:2883: error: expected expression before ')' token
>> niomodule.c: In function 'initnio':
>> niomodule.c:3349: warning: implicit declaration of function 'import_array'
>> niomodule.c:3390: error: 'NioVariable_ReadAsArray' undeclared (first use in
>> this function)
>> error: command 'gcc' failed with exit status 1
>>
>> I noticed that my first error was that it couldn't find arrayobject.h:
>> # find / -mount -name arrayobject.h
>> /usr/lib/python2.4/site-packages/numpy-1.3.0-py2.4-linux-i686.egg/
>> numpy/core/include/numpy/arrayobject.h
>> /usr/include/python2.4/Numeric/arrayobject.h
>>
>> My arrayobject.h file doesn't appear to be in any of the paths specified on
>> the gcc line. Has anybody had this problem before? Do I need to make any
>> adjustments to the files before trying to do a build?
>>
>> Thanks for any help!
>> Pat
>>
>> --------------
>> Pat Allen (pat@mbari.org & http://www.mbari.org/staff/pat)
>> Monterey Bay Aquarium Research Institute (MBARI)
>> 7700 Sandholdt Rd, Moss Landing, CA 95039
>> (voice) 831-775-1724; (fax) 831-775-1620
>>
>> _______________________________________________
>> pyngl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>
>
_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Fri Sep 04 2009 - 12:26:31 MDT

This archive was generated by hypermail 2.2.0 : Thu Sep 10 2009 - 15:06:39 MDT