compilation failure for matplotlib 0.81 on RH9

Hi, I was trying to install the latest matplotlib from

    > source on an ancient RH9 system but I get the following
    > compilation error:

    > building 'matplotlib._na_cntr' extension gcc -DNDEBUG -O2
    > -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC -
    > fPIC -I/usr/local/include -I/usr/include
    > -I/usr/include/python2.2 -c src/_na_cntr.c -o
    > build/temp.linux-i686-2.2/_na_cntr.o -DNUMARRAY=1
    > src/_na_cntr.c:1698: parse error before "init_na_cntr"
    > error: command 'gcc' failed with exit status 1

    > Any advice would be greatly appreciated - I can't even
    > find the file _na_cntr.c that triggers the error....

    > The gcc version is 3.2.2 if that matters.

What is your python version? It looks like the macro PyMODINIT_FUNC
is not being found. This is defined in pyport.h in python2.4, but you
probably have a much older python installed. The reason you cannot
find _na_cntr.c is that it is autogenerated to support Numeric or
numarray at compile time. The src dile is src/cntr.c. In that file,
try replacing

PyMODINIT_FUNC

  with

extern "C" void

  or perhaps

DL_EXPORT(void)

and let me know if this helps

JDH

Hi John

“William” == William Henney <whenney@…287…> writes:

Hi, I was trying to install the latest matplotlib from

source on an ancient RH9 system but I get the following

compilation error:

[ snip ]

What is your python version? It looks like the macro PyMODINIT_FUNC

is not being found. This is defined in pyport.h in python2.4, but you

probably have a much older python installed.

Yes, it is python 2.2.

The reason you cannot

find _na_cntr.c is that it is autogenerated to support Numeric or

numarray at compile time.

I suspected as much.

The src dile is src/cntr.c. In that file,

try replacing

PyMODINIT_FUNC

with

extern “C” void

or perhaps

DL_EXPORT(void)

and let me know if this helps

Hmm, neither of these work - pretty much the same error:

gcc -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC -I/usr/local/include -I/usr/include -I/usr/include/python2.2 -c src/_na_cntr.c -o build/temp.linux-i686-2.2/_na_cntr.o -DNUMARRAY=1

src/_na_cntr.c:1698: parse error before string constant

I suspect that supporting such an antique distro will be more trouble than it is worth. It would probably be easier for me to upgrade the machine.

Cheers

Will

···

On Jun 14, 2005, at 1:11 PM, John Hunter wrote: