hashdist / hashstack

Collection of software profiles for HashDist
https://hashdist.github.io/
51 stars 60 forks source link

matplotlib 1.3.1 failing on some osx machines #223

Closed cekees closed 10 years ago

cekees commented 10 years ago

From the proteus 10.9 buildbot:

building 'matplotlib.ft2font' extension creating build/temp.macosx-10.9-x86_64-2.7 creating build/temp.macosx-10.9-x86_64-2.7/src creating build/temp.macosx-10.9-x86_64-2.7/CXX gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/buildslave/.hashdist/bld/host-freetype/xvdgkg57odip/include -I/Users/buildslave/.hashdist/bld/numpy/wcwyzwc5bz4o/include -I/Users/buildslave/.hashdist/bld/png/2yhivqd7xkic/include -I/Users/buildslave/.hashdist/bld/python/bqs5q7lugmgr/include -I/Users/buildslave/.hashdist/bld/setuptools/rdmsm2qxfhqh/include -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/Users/buildslave/.hashdist/bld/numpy/wcwyzwc5bz4o/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I/usr/X11/include -I. -I/usr/local/Cellar/freetype/2.5.1/include/freetype2 -I/Users/buildslave/.hashdist/bld/python/bqs5q7lugmgr/include/python2.7 -c src/ft2font.cpp -o build/temp.macosx-10.9-x86_64-2.7/src/ft2font.o In file included from src/ft2font.cpp:3: In file included from src/ft2font.h:6: In file included from ./CXX/Extensions.hxx:40: In file included from ./CXX/Python2/Extensions.hxx:52: ./CXX/Python2/Objects.hxx:1133:23: warning: implicit conversion of NULL constant to 'int' [-Wnull-conversion] , offset( NULL ) ~ ^~~~ 0 In file included from src/ft2font.cpp:3: In file included from src/ft2font.h:16: /usr/X11/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not found

include <freetype/config/ftheader.h>

     ^

1 warning and 1 error generated. error: command 'gcc' failed with exit status 1 Command '[u'/bin/bash', '_hashdist/build.sh']' returned non-zero exit status 1 command failed (code=1); raising

ahmadia commented 10 years ago

Freetype is there, and matplotlib doesn't know how to find it:

https://stackoverflow.com/questions/20572366/sudo-pip-install-matplotlib-fails-to-find-freetype-headers-os-x-mavericks

For whatever reason, this hasn't been an issue on my own Mac, but it sounds like we should just build freetype on OS X.

ahmadia commented 10 years ago

This is passing on my OS X.9 machine. I declare myself master of the Proteus example on OS X, and merge this on my own awesomeness.

ahmadia commented 10 years ago

I meant to post that in the PR :(

certik commented 10 years ago

Hm, I guess this line here:

https://github.com/hashdist/hashstack/blob/master/pkgs/matplotlib/matplotlib.yaml#L16

didn't work for hosted freetype?

ahmadia commented 10 years ago

@certik - That looks like the likely culprit. On my system it "just works", so it's hard to understand what's going wrong here.

certik commented 10 years ago

I think the problem is really simple. If you look at host-freetype:

https://github.com/hashdist/hashstack/blob/master/pkgs/host-freetype.yaml

it doesn't make sure that $FREETYPE_DIR/lib/pkgconfig points to pkgconfig. In particular, it doesn't point to it at all! So it can't work, unless matplotlib finds the libs in default locations.

ahmadia commented 10 years ago

Full build here: https://proteus.usace.army.mil/buildbot/builders/minikees.erdc-OSX10.9%2Bdarwin/builds/216/steps/shell_1/logs/stdio

ahmadia commented 10 years ago

I'm looking into it.

ahmadia commented 10 years ago

So my system has a freetype installed in X11 :)

~/p/stack git:remotes/origin/master ❯❯❯ which freetype-config
/opt/X11/bin/freetype-config

I suspect that the hashstack freetype install on OS X is not correctly placing its include headers or reporting its pkg configuration correctly.

I'm tempted to temporarily disable my system's freetype...

ahmadia commented 10 years ago

I have a suspicion. We don't prepend the location of freetype-config to the PATH before we build matplotlib, so I believe that the system-installed freetype-config is getting picked up first. @certik - I don't know how pkg-config works, but is it a dependency that would need to be installed for the environment variable you're setting to work?

ahmadia commented 10 years ago

Testing on:

https://proteus.usace.army.mil/buildbot/builders/xserve-hs.erdc-OSX10.8%2Bdarwin/builds/172

and

https://proteus.usace.army.mil/buildbot/builders/minikees.erdc-OSX10.9%2Bdarwin/builds/217

ahmadia commented 10 years ago

@cekees - This fixes the freetype issue. Something must have bumped in matplotlib 1.3 in terms of looking for freetype-config, relying us to prepend freetype-config to the PATH.

cekees commented 10 years ago

Thanks! I guess we can file matplotlib in the class of packages that won't easily build unless we have the build dependencies manipulate the path.

On Tue, Apr 15, 2014 at 3:50 PM, Aron Ahmadia notifications@github.comwrote:

@cekees https://github.com/cekees - This fixes the freetype issue. Something must have bumped in matplotlib 1.3 in terms of looking for freetype-config, relying us to prepend freetype-config to the PATH.

— Reply to this email directly or view it on GitHubhttps://github.com/hashdist/hashstack/issues/223#issuecomment-40532480 .

ahmadia commented 10 years ago

Possibly, I'm not very familiar with matplotlib's build system. I'd welcome feedback from someone who has a better idea of what's going on there.

certik commented 10 years ago

I didn't try the new matplotlib much. The old one did find the freetype-config as long as you specified the proper PKG_CONFIG_PATH path as we do. It turned out to be pretty much the only way to force matplotlib to use our packages as opposed to the system ones. The build system is pretty hackish, so I am not surprised that it stopped working. I personally use cmake for linking C/C++ libraries, together with Python code. Anyway, if prepending PATH work, then good, let's use it.