Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac yosemite seems to have broken things #3694

Closed
tacaswell opened this issue Oct 22, 2014 · 19 comments
Closed

mac yosemite seems to have broken things #3694

tacaswell opened this issue Oct 22, 2014 · 19 comments

Comments

@matthew-brett
Copy link
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?

@mdboom
Copy link
Member

mdboom commented Oct 22, 2014

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.

@mdboom
Copy link
Member

mdboom commented Oct 22, 2014

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'],

@jenshnielsen
Copy link
Member

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

@tacaswell
Copy link
Member Author

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

@orome
Copy link

orome commented Oct 23, 2014

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

@mdboom
Copy link
Member

mdboom commented Oct 23, 2014

@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)?

@mdboom
Copy link
Member

mdboom commented Oct 23, 2014

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.

@orome
Copy link

orome commented Oct 23, 2014

@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.

@jenshnielsen
Copy link
Member

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

Any particular reason why you want to avoid wheels?

@orome
Copy link

orome commented Oct 24, 2014

@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.

@jenshnielsen
Copy link
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.

@orome
Copy link

orome commented Oct 24, 2014

@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.)

@jenshnielsen
Copy link
Member

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

@orome
Copy link

orome commented Oct 24, 2014

Thanks!

@jenshnielsen
Copy link
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.

@jenshnielsen
Copy link
Member

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

@jenshnielsen
Copy link
Member

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

@tacaswell
Copy link
Member Author

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
Projects
None yet
Development

No branches or pull requests

5 participants