matplotlib, build from source on osx 10.5.8

Hi All,

i'm tring to install matplotlib (svn) on a fesh mac osc installation using the system python 2.5.1.

but i have problems with freetype :-/

i compiled fretype from source without errors using this note :

http://www.kyngchaos.com/macosx:build:freetype2

(but i also have a working freetype.framework, but seems it is not visible to matplotlib,
so i installed from source)

this the log error, thanks for any help :

macbook-pro-15-di-sasha:~ sasha$ cd /Users/Shared/source/matplotlib/
macbook-pro-15-di-sasha:matplotlib sasha$ sudo python setupegg.py develop
Password:

···

============================================================================
BUILDING MATPLOTLIB
             matplotlib: 1.0.svn
                 python: 2.5.1 (r251:54863, Feb 9 2009, 18:49:36) [GCC
                         4.0.1 (Apple Inc. build 5465)]
               platform: darwin

REQUIRED DEPENDENCIES
                  numpy: 1.4.0.dev7273
              freetype2: found, but unknown version (no pkg-config)

OPTIONAL BACKEND DEPENDENCIES
                 libpng: found, but unknown version (no pkg-config)
                         * Could not find 'libpng' headers in any of
                         * '/usr/local/include', '/usr/include', '.'
                Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4
               wxPython: 2.8.4.0
                         * WxAgg extension not required for wxPython >= 2.8
                   Gtk+: no
                         * Building for Gtk+ requires pygtk; you must be able
                         * to "import gtk" in your build/install environment
        Mac OS X native: yes
                     Qt: no
                    Qt4: Qt: 4.5.1, PyQt4: 4.5.4
                  Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
               datetime: present, version unknown
               dateutil: present, version unknown
                   pytz: matplotlib will provide
adding pytz

OPTIONAL USETEX DEPENDENCIES
                 dvipng: no
            ghostscript: /bin/sh: gs: command not found
                  latex: no

[Edit setup.cfg to suppress the above messages]

pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.projections', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid', 'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab', 'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra', 'matplotlib.numerix.random_array', 'matplotlib.numerix.fft', 'matplotlib.delaunay', 'pytz']
running develop
running egg_info
creating lib/matplotlib.egg-info
writing lib/matplotlib.egg-info/PKG-INFO
writing namespace_packages to lib/matplotlib.egg-info/namespace_packages.txt
writing top-level names to lib/matplotlib.egg-info/top_level.txt
writing dependency_links to lib/matplotlib.egg-info/dependency_links.txt
writing manifest file 'lib/matplotlib.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'MANIFEST'
warning: no files found matching 'examples/data/*'
warning: no files found matching 'lib/mpl_toolkits'
writing manifest file 'lib/matplotlib.egg-info/SOURCES.txt'
running build_ext
building 'matplotlib.backends._backend_agg' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -I/Library/Python/2.5/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/Library/Python/2.5/site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/Library/Python/2.5/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/Library/Python/2.5/site-packages/numpy/core/include/freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/Library/Python/2.5/site-packages/numpy/core/include/freetype2 -Isrc/freetype2 -Iagg24/include/freetype2 -I./freetype2 -I/Library/Python/2.5/site-packages/numpy/core/include/freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/backend_agg.cpp -o build/temp.macosx-10.5-i386-2.5/src/backend_agg.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
src/backend_agg.cpp:3:17: error: png.h: No such file or directory
In file included from /usr/local/include/freetype2/freetype/freetype.h:33,
                  from src/ft2font.h:14,
                  from src/backend_agg.cpp:10:
/usr/local/include/freetype2/freetype/config/ftconfig.h:83:1: warning: "SIZEOF_LONG" redefined
In file included from /System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:8,
                  from ./CXX/WrapPython.h:42,
                  from ./CXX/Extensions.hxx:48In file included from /usr/local/include/freetype2/freetype/freetype.h:33,
                  from src/ft2font.h:4,
                  from src/ft2font.h:14,
                  from src/backend_agg.cpp:10:
,
                  from src/backend_agg.cpp:10/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyconfig.h:814:1::
  /usr/local/include/freetype2/freetype/config/ftconfig.h:83:1:warning: this is the location of the previous definitionwarning:
"SIZEOF_LONG" redefined
In file included from /System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:8,
                  from ./CXX/WrapPython.h:42,
                  from ./CXX/Extensions.hxx:48,
                  from src/ft2font.h:4,
                  from src/backend_agg.cpp:10:
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyconfig.h:814:1: warning: this is the location of the previous definition
lipo: can't open input file: /var/tmp//ccxG2l2o.out (No such file or directory)
error: command 'gcc' failed with exit status 1
macbook-pro-15-di-sasha:matplotlib sasha$

No, you have troubles with libpng -- check the first instance of
"error" in your gcc output:

  src/backend_agg.cpp:3:17: error: png.h: No such file or directory

Either you do not have libpng installed, or it is in a place where the
build cannot find it. Try installing it in a place where the build
can find it. Take a look at release/osx/Makefile to see the configure
flags and environment variables we set when building png for the OSX
installer. In particular, we use

  CFLAGS="-Os -arch ppc -arch i386"
  LDFLAGS="-arch ppc -arch i386"
  MACOSX_DEPLOYMENT_TARGET=10.4
  ./configure --disable-dependency-tracking

JDH

···

On Thu, Aug 6, 2009 at 9:28 PM, sasha<massimodisasha@...174...> wrote:

Hi All,

i'm tring to install matplotlib (svn) on a fesh mac osc installation
using the system python 2.5.1.

but i have problems with freetype :-/

John Hunter wrote:

No, you have troubles with libpng -- check the first instance of
"error" in your gcc output:

  src/backend_agg.cpp:3:17: error: png.h: No such file or directory

Either you do not have libpng installed, or it is in a place where the
build cannot find it.

Note that the UnixImageIO Framework from Kyng Chaos should give you a good libpng (and freetype), you just have to make sure that MPL can find it.

Another easy option is to use Macports to build it, with the "universal" variant.

HTH,

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Ok i fixed insytalling in usr local lib from source (both png and freetype)
i tried to tell matplotlib to find the frameworks but i don't know how.
now matplotlib is up and running, thanks to point me to the png error.

···

Il giorno 07/ago/09, alle ore 18:10, Christopher Barker ha scritto:

John Hunter wrote:

No, you have troubles with libpng -- check the first instance of
"error" in your gcc output:
src/backend_agg.cpp:3:17: error: png.h: No such file or directory
Either you do not have libpng installed, or it is in a place where the
build cannot find it.

Note that the UnixImageIO Framework from Kyng Chaos should give you a good libpng (and freetype), you just have to make sure that MPL can find it.

Another easy option is to use Macports to build it, with the "universal" variant.

HTH,

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

sasha wrote:

Ok i fixed insytalling in usr local lib from source (both png and freetype)
i tried to tell matplotlib to find the frameworks but i don't know how.

for the record, William's Frameworks all have a "unix" dir in them, which have "lib" and "include" dirs. You need to add those to MPL's search paths, by editing setup_ext.py. Look for the basedir dict.

-CHB

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...