<br><font size=2 face="sans-serif">Hello all,</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;I'm new to python and spent some time Friday installing PIL using the following configuration:</font>
<br><font size=2 face="sans-serif">OS: SunOS usatux29 5.8 Generic_108528-13 sun4u sparc SUNW,Sun-Fire-280R</font>
<br><font size=2 face="sans-serif">python: &nbsp;packaged with Zope (python 2.1.3)</font>
<br>
<br><font size=2 face="sans-serif">At any rate, I ran into several issues with the install. &nbsp;After being unable to find resolutions</font>
<br><font size=2 face="sans-serif">addressed in a mailing list anywhere I decided to post this in hopes of helping others down the line.</font>
<br><font size=2 face="sans-serif">At the end of this email I list the correct steps for installing PIL on a solaris box. &nbsp;Note, in the examples</font>
<br><font size=2 face="sans-serif">below you'll see Imaging-1.1.2. &nbsp;That was my playground. &nbsp;The same applies to Imaging-1.1.4</font>
<br>
<br><font size=2 face="sans-serif">=========================================================================</font>
<br><font size=2 face="sans-serif">BOTTOM LINE</font>
<br><font size=2 face="sans-serif">Most of my problems were because I did not have the directory containing</font>
<br><font size=2 face="sans-serif">libjpeg in my LD_LIBRARY_PATH environment variable.</font>
<br>
<br>
<br><font size=2 face="sans-serif">=========================================================================</font>
<br><font size=2 face="sans-serif">Symptons I received as a result, when I ran configure:</font>
<br><font size=2 face="sans-serif">[tewpe1@usatux29] /opt/cmf/PIL/Imaging-1.1.2/libImaging &gt;./configure</font>
<br><font size=2 face="sans-serif">creating cache ./config.cache</font>
<br><font size=2 face="sans-serif">checking for --without-gcc... no</font>
<br><font size=2 face="sans-serif">checking for gcc... gcc</font>
<br><font size=2 face="sans-serif">checking whether the C compiler (gcc &nbsp;) works... yes</font>
<br><font size=2 face="sans-serif">checking whether the C compiler (gcc &nbsp;) is a cross-compiler... no</font>
<br><font size=2 face="sans-serif">checking whether we are using GNU C... yes</font>
<br><font size=2 face="sans-serif">checking whether gcc accepts -g... yes</font>
<br><font size=2 face="sans-serif">checking for ranlib... ranlib</font>
<br><font size=2 face="sans-serif">checking for ar... ar</font>
<br><font size=2 face="sans-serif">checking MACHDEP... sunos5</font>
<br><font size=2 face="sans-serif">checking for jpeg_destroy_compress in -ljpeg... yes</font>
<br><font size=2 face="sans-serif">checking for deflate in -lz... yes</font>
<br><font size=2 face="sans-serif">checking how to run the C preprocessor... gcc -E</font>
<br><font size=2 face="sans-serif">checking for ANSI C header files... no</font>
<br><font size=2 face="sans-serif">checking for inline... inline</font>
<br><font size=2 face="sans-serif">checking whether byte ordering is bigendian... yes</font>
<br><font size=2 face="sans-serif">checking size of char... 0</font>
<br><font size=2 face="sans-serif">checking size of short... 0</font>
<br><font size=2 face="sans-serif">checking size of int... 0</font>
<br><font size=2 face="sans-serif">checking size of long... 0</font>
<br><font size=2 face="sans-serif">checking size of float... 0</font>
<br><font size=2 face="sans-serif">checking size of double... 0</font>
<br><font size=2 face="sans-serif">checking for working const... yes</font>
<br><font size=2 face="sans-serif">checking for prototypes... yes</font>
<br><font size=2 face="sans-serif">checking for unistd.h... yes</font>
<br><font size=2 face="sans-serif">checking for getpagesize... yes</font>
<br><font size=2 face="sans-serif">checking for working mmap... no</font>
<br><font size=2 face="sans-serif">updating cache ./config.cache</font>
<br><font size=2 face="sans-serif">creating ./config.status</font>
<br><font size=2 face="sans-serif">creating Makefile</font>
<br><font size=2 face="sans-serif">creating ImConfig.h</font>
<br>
<br><font size=2 face="sans-serif">Then, when running make, I received the following errors:</font>
<br><font size=2 face="sans-serif">[tewpe1@usatux29] /opt/cmf/PIL/Imaging-1.1.2/libImaging &gt;make</font>
<br><font size=2 face="sans-serif">gcc -O -I./. -I/usr/local/include -DHAVE_CONFIG_H &nbsp;-c &nbsp;coretest.c</font>
<br><font size=2 face="sans-serif">In file included from Imaging.h:21,</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;from coretest.c:19:</font>
<br><font size=2 face="sans-serif">ImPlatform.h:18: #error Sorry, this library requires ANSI header files.</font>
<br><font size=2 face="sans-serif">ImPlatform.h:36: #error Cannot find required 32-bit integer type</font>
<br><font size=2 face="sans-serif">ImPlatform.h:48: #error Cannot find required 32-bit floating point type</font>
<br><font size=2 face="sans-serif">*** Error code 1</font>
<br><font size=2 face="sans-serif">make: Fatal error: Command failed for target `coretest.o'</font>
<br>
<br>
<br><font size=2 face="sans-serif">The confusing parts about the configure process were these lines of output:</font>
<br><font size=2 face="sans-serif">checking for ANSI C header files... no</font>
<br><font size=2 face="sans-serif">...</font>
<br><font size=2 face="sans-serif">checking size of char... 0</font>
<br><font size=2 face="sans-serif">checking size of short... 0</font>
<br><font size=2 face="sans-serif">checking size of int... 0</font>
<br><font size=2 face="sans-serif">checking size of long... 0</font>
<br><font size=2 face="sans-serif">checking size of float... 0</font>
<br><font size=2 face="sans-serif">checking size of double... 0</font>
<br>
<br>
<br><font size=2 face="sans-serif">I looked in my config.log and found the C code used by configure to test these </font>
<br><font size=2 face="sans-serif">parts of my system. &nbsp;The reason all of these tests were failing was that configure</font>
<br><font size=2 face="sans-serif">was passing -ljpeg as a gcc compiler option. &nbsp;Since I did not have libjpeg in my</font>
<br><font size=2 face="sans-serif">ld path, the compilation failed and I received the errors above.</font>
<br>
<br>
<br><font size=2 face="sans-serif">=========================================================================</font>
<br><font size=2 face="sans-serif">SOLUTIONS</font>
<br>
<br><font size=2 face="sans-serif">Once I did the added the directory containing libjpeg to my ld path, </font>
<br><font size=2 face="sans-serif">configure produced different output and make worked as desired:</font>
<br>
<br>
<br><font size=2 face="sans-serif"># where is my libjpeg??</font>
<br><font size=2 face="sans-serif">[tewpe1@usatux29] /opt/cmf/PIL/Imaging-1.1.2/libImaging &gt;find / -name &quot;libjpeg*&quot;</font>
<br><font size=2 face="sans-serif">/opt/sfw/lib/libjpeg.so</font>
<br><font size=2 face="sans-serif">/opt/sfw/lib/libjpeg.so.1</font>
<br><font size=2 face="sans-serif">/opt/sfw/lib/libjpeg.so.6</font>
<br><font size=2 face="sans-serif">... additional places, like java's directory, etc</font>
<br>
<br><font size=2 face="sans-serif">[tewpe1@usatux29] /opt/cmf/PIL/Imaging-1.1.2/libImaging &gt;export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/sfw/lib</font>
<br>
<br><font size=2 face="sans-serif">[tewpe1@usatux29] /opt/cmf/PIL/Imaging-1.1.2/libImaging &gt;make distclean</font>
<br>
<br><font size=2 face="sans-serif">[tewpe1@usatux29] /opt/cmf/PIL/Imaging-1.1.2/libImaging &gt;./configure</font>
<br><font size=2 face="sans-serif">creating cache ./config.cache</font>
<br><font size=2 face="sans-serif">checking for --without-gcc... no</font>
<br><font size=2 face="sans-serif">checking for gcc... gcc</font>
<br><font size=2 face="sans-serif">checking whether the C compiler (gcc &nbsp;) works... yes</font>
<br><font size=2 face="sans-serif">checking whether the C compiler (gcc &nbsp;) is a cross-compiler... no</font>
<br><font size=2 face="sans-serif">checking whether we are using GNU C... yes</font>
<br><font size=2 face="sans-serif">checking whether gcc accepts -g... yes</font>
<br><font size=2 face="sans-serif">checking for ranlib... ranlib</font>
<br><font size=2 face="sans-serif">checking for ar... ar</font>
<br><font size=2 face="sans-serif">checking MACHDEP... sunos5</font>
<br><font size=2 face="sans-serif">checking for jpeg_destroy_compress in -ljpeg... yes</font>
<br><font size=2 face="sans-serif">checking for deflate in -lz... yes</font>
<br><font size=2 face="sans-serif">checking how to run the C preprocessor... gcc -E</font>
<br><font size=2 face="sans-serif">checking for ANSI C header files... yes</font>
<br><font size=2 face="sans-serif">checking for inline... inline</font>
<br><font size=2 face="sans-serif">checking whether byte ordering is bigendian... yes</font>
<br><font size=2 face="sans-serif">checking size of char... 1</font>
<br><font size=2 face="sans-serif">checking size of short... 2</font>
<br><font size=2 face="sans-serif">checking size of int... 4</font>
<br><font size=2 face="sans-serif">checking size of long... 4</font>
<br><font size=2 face="sans-serif">checking size of float... 4</font>
<br><font size=2 face="sans-serif">checking size of double... 8</font>
<br><font size=2 face="sans-serif">checking for working const... yes</font>
<br><font size=2 face="sans-serif">checking for prototypes... yes</font>
<br><font size=2 face="sans-serif">checking for unistd.h... yes</font>
<br><font size=2 face="sans-serif">checking for getpagesize... yes</font>
<br><font size=2 face="sans-serif">checking for working mmap... yes</font>
<br><font size=2 face="sans-serif">updating cache ./config.cache</font>
<br><font size=2 face="sans-serif">creating ./config.status</font>
<br><font size=2 face="sans-serif">creating Makefile</font>
<br><font size=2 face="sans-serif">creating ImConfig.h</font>
<br>
<br>
<br><font size=2 face="sans-serif">Looks much better now!</font>
<br><font size=2 face="sans-serif">I would assume that the location of libjpeg will vary on systems, </font>
<br><font size=2 face="sans-serif">but the find command will point anyone to the correct location.</font>
<br>
<br><font size=2 face="sans-serif">=========================================================================</font>
<br><font size=2 face="sans-serif">SUMMARY OF STEPS FOR INSTALLING PIL ON SOLARIS:</font>
<br>
<br><font size=2 face="sans-serif">gtar zxvf Imaging-1.1.2.tar.gz</font>
<br><font size=2 face="sans-serif">cd Imaging-1.1.2/libImaging</font>
<br><font size=2 face="sans-serif">export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/the/directory/containing/libjpeg</font>
<br><font size=2 face="sans-serif">./configure</font>
<br><font size=2 face="sans-serif">edit Makefile and add -fPIC to the end of the CFLAGS variable ( about line 36? )</font>
<br><font size=2 face="sans-serif">make</font>
<br><font size=2 face="sans-serif">make check</font>
<br><font size=2 face="sans-serif">cd ..</font>
<br><font size=2 face="sans-serif">make -f Makefile.pre.in boot</font>
<br><font size=2 face="sans-serif">edit Setup.in and added -L/opt/sfw/lib to the libjpeg specification, </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; also commented out the tk stuff since I'm not using it</font>
<br><font size=2 face="sans-serif">make</font>
<br><font size=2 face="sans-serif">make install</font>
<br>
<br>
<br><font size=2 face="sans-serif">=========================================================================</font>
<br><font size=2 face="sans-serif">SUGGESTIONS:</font>
<br><font size=2 face="sans-serif">First, to the authors of PIL, thanks for the software. &nbsp;</font>
<br><font size=2 face="sans-serif">I am grateful for the use of it. &nbsp;I hope that these suggestions will be perceived</font>
<br><font size=2 face="sans-serif">as such and not complaining.</font>
<br>
<br><font size=2 face="sans-serif">1. The README gives the appearance that the jpeg library is optional, when it's not since</font>
<br><font size=2 face="sans-serif">configure doesn't produce the correct output without libjpeg in the ld path.</font>
<br><font size=2 face="sans-serif">&quot;&quot;&quot;</font>
<br><font size=2 face="sans-serif">&nbsp;If you need JPEG and/or PNG support, make sure to get and build</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;the necessary external libraries:</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;- for JPEG support, get the IJG JPEG library, version 6a or 6b.</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp;You can find this library here:</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://www.ijg.org</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ftp://ftp.uu.net/graphics/jpeg/</font>
<br><font size=2 face="sans-serif">&quot;&quot;&quot;</font>
<br><font size=2 face="sans-serif">Should this be changed to remove the If?</font>
<br>
<br><font size=2 face="sans-serif">2. &nbsp;The configure process should run a test specifically for libjpeg and fail with an error</font>
<br><font size=2 face="sans-serif">message stating that it could not be loaded and is needed by the program. &nbsp;If this</font>
<br><font size=2 face="sans-serif">were done at the beginning of the build process, I believe it would be enough</font>
<br><font size=2 face="sans-serif">information for an admin or developer to make the adjustments necessary to install PIL.</font>
<br>
<br><font size=2 face="sans-serif">3. Is there a way to remove the jpeg and z library dependencies for the ASNI C header check</font>
<br><font size=2 face="sans-serif">and the sizeof checks? &nbsp;I don't know the GNU Autoconf toolset very well, but</font>
<br><font size=2 face="sans-serif">I think a check for sizeof should only fail if the sizeof C call fails, and not for a </font>
<br><font size=2 face="sans-serif">missing library that isn't used in the actual C code.</font>
<br>
<br>
<br><font size=2 face="sans-serif">4. &nbsp;I didn't have xv on my system, so I received a non-fatal error</font>
<br><font size=2 face="sans-serif">while running 'make check'. &nbsp;It would be useful if it were documented in the</font>
<br><font size=2 face="sans-serif">README or elsewhere that a successful make check depended on xv.</font>
<br>
<br><font size=2 face="sans-serif">Well, I hope this information is found useful by others. &nbsp;If I haven't got something quite right,</font>
<br><font size=2 face="sans-serif">please let me know.</font>
<br>
<br><font size=2 face="sans-serif">Thanks,</font>
<br><font size=2 face="sans-serif">Perry Tew</font>