Building Hip-Hop, first steps

Submitted by Frederic Marand on

In case you somehow managed to miss today's announcement, Facebook's Hip-Hop is now available, along with a wiki to show how to build it, and an issue tracker, all on Github.

This revealed something rather funny: they chose to use the excellent Oniguruma regexp library, more typical of Ruby than of PHP, along with PCRE (and Boost): both libraries are actually needed to achieve the build process.

Trying to build on Ubuntu Karmic, you will find:

  • most packages are already available
  • for the two patched libraries, (libevent and libcurl), you will need the source packages, which are not available in the usual Synaptic list, and need to be fetched using sudo apt-get source <package> instead
  • libicu4.2 is currently only available in the Lucid Lynx branch, and needs to be compiled separately

This allows the pre-build step (cmake) to complete, but the actual compile process fails rather early if you are trying to build a 32-bit version: various types need a 64-bit address space to be overload-compatible. This is a known bug in the initial version, not likely to be fixed soon. Which makes sense, since no problem for which Hip-Hop PHP is a solution is likely to be ran on 32-bit systems.