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

hhvm doesn't build on osx using homebrew #1580

Closed
evert opened this issue Jan 16, 2014 · 16 comments
Closed

hhvm doesn't build on osx using homebrew #1580

evert opened this issue Jan 16, 2014 · 16 comments
Labels

Comments

@evert
Copy link
Contributor

evert commented Jan 16, 2014

I've been updating to the latest HEAD every few days, hoping this was a temporary issue. But since about 2 weeks I have not been able to install hhvm using brew.

I'm following these instructions:

https://github.com/facebook/hhvm/wiki/Building-and-installing-HHVM-on-OSX-10.9

The error plus some additional info:

In file included from /tmp/hhvm-30TM/hphp/runtime/ext/gd/libgd/gdft.cpp:65:0:
/usr/X11R6/include/freetype2/freetype/freetype.h:32:22: fatal error: ft2build.h: No such file or directory
 #include <ft2build.h>
                      ^
compilation terminated.
make[2]: *** [hphp/runtime/CMakeFiles/hphp_runtime_static.dir/ext/gd/libgd/gdft.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [hphp/runtime/CMakeFiles/hphp_runtime_static.dir/all] Error 2
make: *** [all] Error 2
==> Formula
Tap: mcuadros/hhvm
Path: /usr/local/Library/Taps/mcuadros-hhvm/Formula/hhvm.rb
==> Configuration
HOMEBREW_VERSION: 0.9.5
HEAD: 13ce75adba711d9b2def7061125e260ccd182e6e
CPU: quad-core 64-bit haswell
OS X: 10.9.1-x86_64
Xcode: 5.0.2
CLT: 5.0.1.0.1.1382131676
X11  2.7.5 => /opt/X11

Let me know if you need anything else :)

@scannell
Copy link
Contributor

@demon was still having this problem too. I've built fine so I'm not sure what it is. @danslo, did you figure out a way around this? I thought you saw it and then fixed it.

@danslo
Copy link
Contributor

danslo commented Jan 16, 2014

@scannell Nope. I can build fine too. :-(

@evert
Copy link
Contributor Author

evert commented Jan 16, 2014

I wonder if it's trying to use the system freetype rather than the brew one. Going to try reinstalling brew freetype and see what happens.

I wish I was better versed in the gnu tools ecosystem :)

@danslo
Copy link
Contributor

danslo commented Jan 16, 2014

@evert That may very well be (maybe for some people it's being pulled in as a dependency for another package).

If installing freetype doesn't work, can you give us a gist with the contents of brew list?

@danslo
Copy link
Contributor

danslo commented Jan 16, 2014

What I believe is going on is this:

  • HHVM requires newer freetype
  • PHP installed through homebrew depends on libpng
  • libpng depends on freetype

What ends up happening is people that installed PHP through homebrew have the proper dependencies, and others do not. I've updated the wiki to hold this dependency. I'll bump @mcuadros to update his formula.

danslo added a commit to danslo/homebrew-hhvm that referenced this issue Jan 16, 2014
This dependency is already installed if users install PHP through homebrew, but for users that did not do this, it will look at the outdated OSX headers causing build failures.

See facebook/hhvm#1580
@evert
Copy link
Contributor Author

evert commented Jan 16, 2014

brew uninstall freetype && brew install freetype unfortunately did not fix that.

My limited understanding is that brew packages are supposed to install in /usr/local

However, even after (re-)installing freetype using brew, the file that it looks for first has this path:

/usr/X11R6/include/freetype2/freetype/freetype.h:32:22: fatal error: ft2build.h: No such file or directory

Do you guys know any way I can force brew to use the one from /use/local (provided my assumptions are correct).

@danslo
Copy link
Contributor

danslo commented Jan 16, 2014

We definitely needed that dependency, so the wiki and homebrew update should still be ok.

It's quite curious that installing that did not fix your problem though. The build should always be looking into that directory first, due to cmake setting: -DCMAKE_INCLUDE_PATH="/usr/local/include:/usr/include" \.

@evert
Copy link
Contributor Author

evert commented Jan 16, 2014

/usr/X11R6 was a symlink to /opt/X11. This probably happened while installing XQuartz.

I removed the symlinks and now re-trying the build.

@mcuadros
Copy link

now is fixed on brew, thanks @danslo

@evert
Copy link
Contributor Author

evert commented Jan 16, 2014

Removing quartz indeed fixed my problem. Perhaps it's worth making a note of this?

@danslo
Copy link
Contributor

danslo commented Jan 16, 2014

@evert: I think the problem is that pkg-config is reporting that X11R6 directory.

However, /usr/local/lib/pkgconfig/freetype2.pc should be providing it with proper paths...

@scannell
Copy link
Contributor

I'm going to close this as there's no action for us to take -- feel free to continue the discussion here. Thanks @danslo!

@evert
Copy link
Contributor Author

evert commented Jan 16, 2014

K I'm not entirely sure what that implies for me @danslo :)

I do think other people can run into this that have quartz installed before installing hhvm.

@demon
Copy link
Contributor

demon commented Jan 16, 2014

I've got the package working just fine, so I think we've solved this pretty well.

I've still got some unrelated problems when building from source, but they're...not related to this :)

@smoya
Copy link

smoya commented Feb 11, 2014

I fixed this problem removing the links that @evert said.

Thanks.

@eistrati
Copy link

I had the same error, so thanks a lot for making my life easier by identifying the Quartz conflict! I was able to install hhvm 2.4.0 after removing Quartz as stated here: https://discussions.apple.com/thread/4162096

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants