Failed build: src/_macosx.m:1:25: error: Cocoa/Cocoa.h: No such file or directory

Hi, matplotlibers,

  I tried to compile matplotlib0.99.1.1 against Python-2.6.4, numpy-1.3.0,
libpng-1.2.40, freetype-2.3.11 with the following command:
python setup.py install --prefix=/opt64 > & comp.log

  I got

building 'matplotlib.backends._macosx' extension
/opt64/bin/gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt64/include -I/opt64/include/wx-2.8 -I/opt64/lib/wx/include/gtk2-ansi-release-2.8 -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -I/opt64/lib/python2.6/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/opt64/lib/python2.6/site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/opt64/include/python2.6 -c src/_macosx.m -o build/temp.linux-x86_64-2.6/src/_macosx.o
src/_macosx.m:1:25: error: Cocoa/Cocoa.h: No such file or directory
src/_macosx.m:2:53: error: ApplicationServices/ApplicationServices.h: No such file or directory
src/_macosx.m:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'style'

  I checked, I have neither Cocoa.h , nor ApplicationServices.h in my system
( Linux 2.6.28-16-generic #55-Ubuntu SMP ). I have no idea to which
package headers Cocoa.h and ApplicationServices.h belong.

  Which additional source packages, not mentioned in
http://matplotlib.sourceforge.net/users/installing.html, should I download
and compile in order to build matplotlib?

Thank you in advance,
Leonid

For some reason mpl is trying to build the macosx backend (for OSX)
even though you are on linux. Please do a clean build (rm -rf build)
and capture all stdout and stderr into a file when rebuilding and post
it. Also see if you have a setup.cfg file in your mpl dir next to
setup.py and post it.

Finally, where did you get the mpl src from?

JDH

···

On Mon, Nov 9, 2009 at 1:29 PM, Leonid Petrov <mail@...796...> wrote:

Hi, matplotlibers,

I tried to compile matplotlib0.99.1.1 against Python-2.6.4, numpy-1.3.0,
libpng-1.2.40, freetype-2.3.11 with the following command:
python setup.py install --prefix=/opt64 > & comp.log

I got

building 'matplotlib.backends._macosx' extension
/opt64/bin/gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt64/include -I/opt64/include/wx-2.8 -I/opt64/lib/wx/include/gtk2-ansi-release-2.8 -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -I/opt64/lib/python2.6/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/opt64/lib/python2.6/site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/opt64/include/python2.6 -c src/_macosx.m -o build/temp.linux-x86_64-2.6/src/_macosx.o
src/_macosx.m:1:25: error: Cocoa/Cocoa.h: No such file or directory
src/_macosx.m:2:53: error: ApplicationServices/ApplicationServices.h: No such file or directory
src/_macosx.m:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'style'

I checked, I have neither Cocoa.h , nor ApplicationServices.h in my system
( Linux 2.6.28-16-generic #55-Ubuntu SMP ). I have no idea to which
package headers Cocoa.h and ApplicationServices.h belong.

Which additional source packages, not mentioned in
http://matplotlib.sourceforge.net/users/installing.html, should I download
and compile in order to build matplotli

Hi, John,

  I got mpl from

http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/matplotlib-0.99.1.1.tar.gz/download

/d1/incoming> md5sum matplotlib-0.99.1.1.tar.gz
bd0894dd924eb5bec84c42d26041a544 matplotlib-0.99.1.1.tar.gz

I removed source code of matplotlib-0.99.1.1 from my previous attempt to
install it and did it again.

cd /d1/dist
tar -zxf /d1/incoming/matplotlib-0.99.1.1.tar.gz
cd matplotlib-0.99.1.1/
python setup.py install --prefix=/opt64 > & matplotlib-0.99.1.1_comp.log

gzip matplotlib-0.99.1.1_comp.log
cp matplotlib-0.99.1.1_comp.log.gz /pub/
cp setup.cfg /pub/matplotlib-0.99.1.1_comp.log.gz
cp /d1/incoming/matplotlib-0.99.1.1.tar.gz /pub/

You can get them from

ftp://71.178.13.84/matplotlib-0.99.1.1_comp.log
ftp://71.178.13.84/matplotlib-0.99.1.1.tar.gz
ftp://71.178.13.84/matplotlib-0.99.1.1_setup.cfg

But stop, stop, stop... I looked at setup.cfg and found there at line 58
macosx = True

One more attempt:

cd /d1/dist
rm -fR matplotlib-0.99.1.1
tar -zxf /d1/incoming/matplotlib-0.99.1.1.tar.gz
cd matplotlib-0.99.1.1/
sed -i 's@...797... = True@...797... = False@...798...' setup.cfg
python setup.py install --prefix=/opt64 > & matplotlib-0.99.1.1_comp.log
echo $?
0
tail -2 matplotlib-0.99.1.1_comp.log
Removing /opt64/lib/python2.6/site-packages/matplotlib-0.99.1.1-py2.6.egg-info
Writing /opt64/lib/python2.6/site-packages/matplotlib-0.99.1.1-py2.6.egg-info

Success!!

Thank you for a quick reply and suggestion to look at setup.cfg .

Leonid

Glad you found the fix -- I'm just uploaded a new tarball now with the
setup.cfg removed.

JDH

···

On Mon, Nov 9, 2009 at 3:08 PM, Leonid Petrov <mail@...796...> wrote:

Hi, John,

I got mpl from

matplotlib - Browse Files at SourceForge.net

/d1/incoming> md5sum matplotlib-0.99.1.1.tar.gz
bd0894dd924eb5bec84c42d26041a544 matplotlib-0.99.1.1.tar.gz

I removed source code of matplotlib-0.99.1.1 from my previous attempt to
install it and did it again.

cd /d1/dist
tar -zxf /d1/incoming/matplotlib-0.99.1.1.tar.gz
cd matplotlib-0.99.1.1/
python setup.py install --prefix=/opt64 > & matplotlib-0.99.1.1_comp.log

gzip matplotlib-0.99.1.1_comp.log
cp matplotlib-0.99.1.1_comp.log.gz /pub/
cp setup.cfg /pub/matplotlib-0.99.1.1_comp.log.gz
cp /d1/incoming/matplotlib-0.99.1.1.tar.gz /pub/

You can get them from

ftp://71.178.13.84/matplotlib-0.99.1.1_comp.log
ftp://71.178.13.84/matplotlib-0.99.1.1.tar.gz
ftp://71.178.13.84/matplotlib-0.99.1.1_setup.cfg

But stop, stop, stop... I looked at setup.cfg and found there at line 58
macosx = True