Skip to content

mac yosemite seems to have broken things #3694

Closed

Activity

  1. matthew-brett commented on Oct 22, 2014

    @matthew-brett
    Contributor

    I'm afraid I don't have enough SO reputation to comment on the site forms. I think the first poster is not using the pypi wheel, because it's trying to find the png library in X11, and our wheel builds don't build on a system with X11 installed. I suspect the second isn't either - could you clarify with them?

  2. mdboom commented on Oct 22, 2014

    @mdboom
    Member

    For the first, it would be helpful to know in which of the many possible ways the user is building matplotlib: i.e., from source, from MacPorts/fink/homebrew, from pip etc.

    For the second, the user has clipped away the part of the output that describes a little bit about freetype and what was found. If I disable MacPorts, indeed it doesn't find freetype on my Yosemite Mac either. This one I can look into.

  3. mdboom commented on Oct 22, 2014

    @mdboom
    Member

    Indeed, it seems Apple moved freetype from /usr/X11/include to /opt/X11/include -- though that change goes back a long way, at least to Snow Leopard according to this:

    http://xquartz.macosforge.org/trac/wiki/DeveloperInfo

    Note that the X11 package needs to be installed to get the freetype library. Alternatively, MacPorts/fink/homebrew may be used to get freetype. But the base system does not have it.

    The following patch will make this work with the X11 package (without requiring MacPorts/fink/homebrew).

    diff --git a/setupext.py b/setupext.py
    index 19ec6e5..13756eb 100755
    --- a/setupext.py
    +++ b/setupext.py
    @@ -148,7 +148,7 @@ def get_base_dirs():
    
         basedir_map = {
             'win32': ['win32_static',],
    -        'darwin': ['/usr/local/', '/usr', '/usr/X11', '/opt/local'],
    +        'darwin': ['/usr/local/', '/usr', '/usr/X11', '/opt/X11', '/opt/local'],
             'sunos5': [os.getenv('MPLIB_BASE') or '/usr/local',],
             'gnu0': ['/usr'],
             'aix5': ['/usr/local'],
  4. jenshnielsen commented on Oct 22, 2014

    @jenshnielsen
    Member

    @mdboom Seems sensible. Should we add that to 1.4.2?

  5. tacaswell commented on Oct 22, 2014

    @tacaswell
    MemberAuthor

    👍 on getting that in for 1.4.2 That way we can blame the quick turn around an apple!

  6. orome commented on Oct 23, 2014

    @orome

    Full output. FWIW, I had --no-use-wheel.

  7. mdboom commented on Oct 23, 2014

    @mdboom
    Member

    @orome: With the patch above, are you able to build from source (not from pip)? Do you have at least one of X11, MacPorts, fink or homebrew installed? (For the latter three, also with the freetype package installed)?

  8. mdboom commented on Oct 23, 2014

    @mdboom
    Member

    Actually, it looks like that patch is already in the v1.4.x branch in the git repo -- if you check out from that, you shouldn't need to apply the patch.

  9. orome commented on Oct 23, 2014

    @orome

    @mdboom: Currently I use

    pip install -U --no-use-wheel matplotlib

    What, if anything, should I try differently?

    I have x11 (2.7.7), in /opt/X11/; no MackPort, fink, or homebrew. The last problem-free update of matplotlib was 1.4.0 under Mavericks using the command line above (though I think with ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future, which was necessary for a while and no seems unneeded).

    1.4.2 also fails the same as described.

  10. jenshnielsen commented on Oct 24, 2014

    @jenshnielsen
    Member

    @orome I guess that should work. Could you please attach the log output here?

    Any particular reason why you want to avoid wheels?

  11. orome commented on Oct 24, 2014

    @orome

    @jenshnielsen: See log above.

    Not sure why I avoid wheels. Security? Maybe just habit. Anyway I often get get all kinds of errors when I use wheels, and using --no-use-wheel always works fine.

  12. jenshnielsen commented on Oct 24, 2014

    @jenshnielsen
    Member

    Sorry missed that. Can you check if you have ft2build.h in /opt/X11/include/freetype2?

    I have never had any issues with the matplotlib wheel so if you can reproduce the problems it would be great if you could raises that as a new issue.

  13. orome commented on Oct 24, 2014

    @orome

    @jenshnielsen: Yes:

    /***************************************************************************/
    /*                                                                         */
    /*  ft2build.h                                                             */
    /*                                                                         */
    /*    FreeType 2 build and setup macros.                                   */
    /*                                                                         */
    /*  Copyright 1996-2001, 2006, 2013 by                                     */
    /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
    /*                                                                         */
    /*  This file is part of the FreeType project, and may only be used,       */
    /*  modified, and distributed under the terms of the FreeType project      */
    /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
    /*  this file you indicate that you have read the license and              */
    /*  understand and accept it fully.                                        */
    /*                                                                         */
    /***************************************************************************/
    
    
      /*************************************************************************/
      /*                                                                       */
      /* This is the `entry point' for FreeType header file inclusions.  It is */
      /* the only header file which should be included directly; all other     */
      /* FreeType header files should be accessed with macro names (after      */
      /* including `ft2build.h').                                              */
      /*                                                                       */
      /* A typical example is                                                  */
      /*                                                                       */
      /*   #include <ft2build.h>                                               */
      /*   #include FT_FREETYPE_H                                              */
      /*                                                                       */
      /*************************************************************************/
    
    
    #ifndef __FT2BUILD_H__
    #define __FT2BUILD_H__
    
    #include <config/ftheader.h>
    
    #endif /* __FT2BUILD_H__ */
    
    
    /* END */
    
    

    (The wheel issues don't just apply to matplotlib, I get them for a bunch of stuff. It's not really been a problem, since I prefer — for whatever reason I can't recall — to avoid them.)

  14. jenshnielsen commented on Oct 24, 2014

    @jenshnielsen
    Member

    I managed to reproduce your issue. Will se if I can find a fix

  15. orome commented on Oct 24, 2014

    @orome

    Thanks!

  16. jenshnielsen commented on Oct 24, 2014

    @jenshnielsen
    Member

    Looked a bit more into this. It happens when pkg-config is not available. The current logic tries /opt/X11/ft2build.h but not /opt/X11/freetype2/ft2build.h as is should.

  17. jenshnielsen commented on Oct 24, 2014

    @jenshnielsen
    Member

    The simple paths in #3713 gets it building without pkg-config for me.

  18. jenshnielsen commented on Oct 24, 2014

    @jenshnielsen
    Member

    Just checked that Ubuntu also stores the freetype headers in a freetype2 subdir of /usr/include

  19. tacaswell commented on Nov 25, 2014

    @tacaswell
    MemberAuthor

    Closing this issue as the title is misleading and there is a PR open to address a related bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions