[Pythonmac-SIG] Someone had PIL trouble on i386 10.4.6 Python 2.4 IIRC--I succeeded this evening

Daniel Lord daniellord at mac.com
Tue Apr 18 07:48:07 CEST 2006


I was able to successfully compile and install it with just a few  
tweaks on my Macbook Pro this evening.
I don't know if this newbies methods are optimal, but they seem to  
have worked finally (I tried straight 'out of the box' compiles which  
failed at first)

[daniello at mercury.local]$  sudo python setup.py build_ext -i
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g  
-bundle -undefined dynamic_lookup -flat_namespace -no-cpp-precomp  
build/temp.macosx-10.4-fat-2.4/_imagingtk.o build/temp.macosx-10.4- 
fat-2.4/Tk/tkImaging.o -L/Library/Frameworks/Python.framework/ 
Versions/2.4/lib -L/usr/local/lib -L/usr/lib -o PIL/_imagingtk.so - 
framework Tcl -framework Tk

*** lines removed ***
--------------------------------------------------------------------
PIL 1.1.5 BUILD SUMMARY
--------------------------------------------------------------------
version       1.1.5
platform      darwin 2.4.3 (#1, Apr  7 2006, 10:54:33)
               [GCC 4.0.1 (Apple Computer, Inc. build 5250)]
--------------------------------------------------------------------
--- TKINTER support ok
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
--------------------------------------------------------------------
To check the build, run the selftest.py script.

[daniello at mercury.local]$ python selftest.py
55 tests passed.

SUCCESS!

Here is what I did:
I installed four things:

1. zlib: a straight forward curl, tar zxvf, ./configure, make, sudo  
make install
	curl http://www.gzip.org/zlib/zlib-1.1.4.tar.gz -o zlib-1.1.4.tar.gz

2. freetype: DL from SourceForge and straight forward tar zxvf, ./ 
configure, make, sudo make install

3. jpeg-6b: this is where the trouble started.
	curl http://www.ijg.org/files/jpegsrc.v6b.tar.gz -o jpegsrc.v6b.tar.gz

	a. after untarring and running ./configure, open 'Makefile' and  
change one line:
		CFLAGS=  -O2 -no-cpp-precomp -I$(srcdir)
		   to
		CFLAGS= -arch i386 -O2 -no-cpp-precomp -I$(srcdir)
	    then 'make; sudo make install'

	b. then we have to put some manifest files the the lib in the right  
place to be found by PIL's build setup.py (I chose /usr/local)

		sudo cp jconfig.h jmorecfg.h jpeglib.h /usr/local/include
		sudo cp libjpeg.a /usr/local/lib
		sudo ranlib /usr/local/lib/libjpeg.a


4. PIL: this required some tweaking per instructions given in the  
setup.py to find the jpeg lib and manifests.
	curl http://effbot.org/downloads/Imaging-1.1.5.tar.gz -o  
Imaging-1.1.5.tar.gz
	
	a. bascially, change
		JPEG_ROOT = None
		   to
		JPEG_ROOT = "(/usr/local/lib,/usr/local/include)"

	then 'sudo python setup.py build_ext -i'
	
	And success follows--at least for me ;-)




More information about the Pythonmac-SIG mailing list