#7273: PIL spkg uses libraries it must not use
---------------------------+------------------------------------------------
   Reporter:  GeorgSWeber  |       Owner:  mabshoff    
       Type:  defect       |      Status:  needs_review
   Priority:  blocker      |   Milestone:  sage-4.2.1  
  Component:  packages     |    Keywords:              
Work_issues:               |      Author:              
   Reviewer:               |      Merged:              
---------------------------+------------------------------------------------
Changes (by timdumol):

  * status:  new => needs_review


Old description:

> From the pil-1.1.6.spkg's "setup.py":
> {{{
> # --------------------------------------------------------------------
> # Library pointers.
> #
> # Use None to look for the libraries in well-known library locations.
> # Use a string to specify a single directory, for both the library and
> # the include files.  Use a tuple to specify separate directories:
> # (libpath, includepath).  Examples:
> #
> # JPEG_ROOT = "/home/libraries/jpeg-6b"
> # TIFF_ROOT = "/opt/tiff/lib", "/opt/tiff/include"
> #
> # If you have "lib" and "include" directories under a common parent,
> # you can use the "libinclude" helper:
> #
> # TIFF_ROOT = libinclude("/opt/tiff")
>
> FREETYPE_ROOT = None
> JPEG_ROOT = None
> TIFF_ROOT = None
> ZLIB_ROOT = None
> TCL_ROOT = None
>
> # FIXME: add mechanism to explicitly *disable* the use of a library
>
> # --------------------------------------------------------------------
> }}}
> and any of these libraries the setup thinks it finds will be set as
> {{{
> -DHAVE_LIBJPEG -DHAVE_LIBZ
> }}}
> and the like in "building '_imaging' extension".
>
> This means that if a Sage binary is built on a computer with having some
> of these libraries, then this binary will *not* work (might not even
> start) on a computer not having at least these libraries available.
>
> Even more fun (again taken from PIL's setup.py):
> {{{
>         elif sys.platform == "darwin":
>             # attempt to make sure we pick freetype2 over other versions
>             add_directory(include_dirs, "/sw/include/freetype2")
>             add_directory(include_dirs, "/sw/lib/freetype2/include")
>             # fink installation directories
>             add_directory(library_dirs, "/sw/lib")
>             add_directory(include_dirs, "/sw/include")
>             # darwin ports installation directories
>             add_directory(library_dirs, "/opt/local/lib")
>             add_directory(include_dirs, "/opt/local/include")
> }}}
> Last, but not least, pil-1.1.6 as contained in Sage-4.2.alpha1 breaks the
> Sage build, at least on my computer. It somehow thinks it could find
> "libjpeg" and its includes, but then cannot:
> {{{
> ...
> running build_ext
> --- using frameworks at /System/Library/Frameworks
> building '_imaging' extension
> gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-
> prototypes -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/
> Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/
> Headers -I/Users/Shared/sage/sage-4.2.alpha1/local/include/freetype2 -
> IlibImaging -I/opt/local/include -I/Users/Shared/sage/sage-4.2.alpha1/
> local/include -I/usr/local/include -I/usr/include -I/Users/Shared/sage/
> sage-4.2.alpha1/local/include/python2.6 -c decode.c -o build/
> temp.macosx-10.3-i386-2.6/decode.o
> In file included from decode.c:653:
> libImaging/Jpeg.h:11:21: error: jpeglib.h: No such file or directory
> In file included from decode.c:653:
> libImaging/Jpeg.h:17: error: field 'pub' has incomplete type
> libImaging/Jpeg.h:26: error: field 'pub' has incomplete type
> libImaging/Jpeg.h:49: error: field 'cinfo' has incomplete type
> libImaging/Jpeg.h:62: error: field 'pub' has incomplete type
> libImaging/Jpeg.h:90: error: field 'cinfo' has incomplete type
> error: command 'gcc' failed with exit status 1
>
> The full install.log is at
> http://sage.math.washington.edu/home/weberg/logs/sage-4.2.alpha1_install.log
> }}}
> But the problem with the binaries *will* occur on any platform, not only
> Darwin.
>
> So we either have to also include a jpeg.spkg, a tiff.spkg, and so on in
> Sage (and make sure PIL uses these !!!), or cripple PIL to not use any of
> these libraries (even if they *were* present).
>
> The former is problematic, as far as I remember e.g. the tiff license is
> not GPL compatible (apart from the technical aspects), but I might be
> mistaken. Crippling might render PIL pretty useless, however.

New description:

 New spkg's available at these url's:

 http://sage.math.washington.edu/home/timdumol/pil-1.1.6.p1.spkg

 http://sage.math.washington.edu/home/timdumol/libtiff-3.9.1.p0.spkg

 http://sage.math.washington.edu/home/timdumol/libjpeg-7.p0.spkg

 The updated PIL library depends on libtiff, libpng, and libjpeg with the
 path explicitly set to the local lib path. TCL/TK support is disabled.

 ------

 From the pil-1.1.6.spkg's "setup.py":
 {{{
 # --------------------------------------------------------------------
 # Library pointers.
 #
 # Use None to look for the libraries in well-known library locations.
 # Use a string to specify a single directory, for both the library and
 # the include files.  Use a tuple to specify separate directories:
 # (libpath, includepath).  Examples:
 #
 # JPEG_ROOT = "/home/libraries/jpeg-6b"
 # TIFF_ROOT = "/opt/tiff/lib", "/opt/tiff/include"
 #
 # If you have "lib" and "include" directories under a common parent,
 # you can use the "libinclude" helper:
 #
 # TIFF_ROOT = libinclude("/opt/tiff")

 FREETYPE_ROOT = None
 JPEG_ROOT = None
 TIFF_ROOT = None
 ZLIB_ROOT = None
 TCL_ROOT = None

 # FIXME: add mechanism to explicitly *disable* the use of a library

 # --------------------------------------------------------------------
 }}}
 and any of these libraries the setup thinks it finds will be set as
 {{{
 -DHAVE_LIBJPEG -DHAVE_LIBZ
 }}}
 and the like in "building '_imaging' extension".

 This means that if a Sage binary is built on a computer with having some
 of these libraries, then this binary will *not* work (might not even
 start) on a computer not having at least these libraries available.

 Even more fun (again taken from PIL's setup.py):
 {{{
         elif sys.platform == "darwin":
             # attempt to make sure we pick freetype2 over other versions
             add_directory(include_dirs, "/sw/include/freetype2")
             add_directory(include_dirs, "/sw/lib/freetype2/include")
             # fink installation directories
             add_directory(library_dirs, "/sw/lib")
             add_directory(include_dirs, "/sw/include")
             # darwin ports installation directories
             add_directory(library_dirs, "/opt/local/lib")
             add_directory(include_dirs, "/opt/local/include")
 }}}
 Last, but not least, pil-1.1.6 as contained in Sage-4.2.alpha1 breaks the
 Sage build, at least on my computer. It somehow thinks it could find
 "libjpeg" and its includes, but then cannot:
 {{{
 ...
 running build_ext
 --- using frameworks at /System/Library/Frameworks
 building '_imaging' extension
 gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-
 prototypes -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/
 Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/
 Headers -I/Users/Shared/sage/sage-4.2.alpha1/local/include/freetype2 -
 IlibImaging -I/opt/local/include -I/Users/Shared/sage/sage-4.2.alpha1/
 local/include -I/usr/local/include -I/usr/include -I/Users/Shared/sage/
 sage-4.2.alpha1/local/include/python2.6 -c decode.c -o build/
 temp.macosx-10.3-i386-2.6/decode.o
 In file included from decode.c:653:
 libImaging/Jpeg.h:11:21: error: jpeglib.h: No such file or directory
 In file included from decode.c:653:
 libImaging/Jpeg.h:17: error: field 'pub' has incomplete type
 libImaging/Jpeg.h:26: error: field 'pub' has incomplete type
 libImaging/Jpeg.h:49: error: field 'cinfo' has incomplete type
 libImaging/Jpeg.h:62: error: field 'pub' has incomplete type
 libImaging/Jpeg.h:90: error: field 'cinfo' has incomplete type
 error: command 'gcc' failed with exit status 1

 The full install.log is at
 http://sage.math.washington.edu/home/weberg/logs/sage-4.2.alpha1_install.log
 }}}
 But the problem with the binaries *will* occur on any platform, not only
 Darwin.

 So we either have to also include a jpeg.spkg, a tiff.spkg, and so on in
 Sage (and make sure PIL uses these !!!), or cripple PIL to not use any of
 these libraries (even if they *were* present).

 The former is problematic, as far as I remember e.g. the tiff license is
 not GPL compatible (apart from the technical aspects), but I might be
 mistaken. Crippling might render PIL pretty useless, however.

--

Comment:

 Here's a libtiff package:
 http://sage.math.washington.edu/home/timdumol/libtiff-3.9.1.p0.spkg.
 Updated PIL package here:
 http://sage.math.washington.edu/home/timdumol/pil-1.1.6.p1.spkg. The
 updated package has explicid dependencies on Sage's libtiff, libpng and
 libjpeg, and disables TCL/TK.

 I'm guessing libtiff and libjpeg have to be voted in?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7273#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to