Skip to content

Building and installing

messer edited this page Sep 13, 2010 · 44 revisions

HipHop has been developed on CentOS and Fedora, building on other operating systems may not currently be functional. Support will be added as soon as its ready.

Prequisites

The prequisites for HipHop are extensive due to the need to build everything statically, most packages can be installed directly from your distributions package management system.

Required Packages

  • cmake 2.6 is the minimum version
  • g++/gcc 4.1 is the minimum version
  • Boost 1.37 is the minimum version
  • flex
  • bison
  • re2c 0.13.0 is the minimum version
  • libmysql
  • libxml2
  • libmcrypt
  • libicu 4.2 is the minimum version
  • openssl
  • binutils and binutils-dev
  • libcap
  • gd
  • zlib
  • tbb Intel’s Thread Building Blocks
  • libmbfl: git clone git://github.com/scottmac/libmbfl.git
  • Oniguruma
  • libpcre3
  • libexpat

Custom Packages

The following packages have had slight modifications added to them, patches are provided and should be made against the current source copies.

  • libcurl src/third_party/libcurl.fb-changes.diff
  • libevent 1.4 src/third_party/libevent.fb-changes.diff

To apply the patches, supposed your build environement is:
curl-7.20.0 hiphop-php libevent-1.4.13-stable

Enter the following commands:
cd libevent-1.4.13-stable
cp ../hiphop-php/src/third_party/libevent.fb-changes.diff .
patch < libevent.fb-changes.diff
cd ..
cd curl-7.20.0
cp ../hiphop-php/src/third_party/libcurl.fb-changes.diff .
patch -p0 < libcurl.fb-changes.diff

If you do not enter -p0 you will get an error during patching process.

Bundled Packages

  • src/third_party
    • libafdt
    • libmbfl
    • sqlite3
    • timelib

Building

Using Intel TBB from source

If you build TBB from source or install the binaries manually you’ll need to export a few variables to hint to the version and location.

export TBB_INSTALL_DIR="/home/user/tbb22_012oss"
export TBB_ARCH_PLATFORM="intel64/cc4.1.2_libc2.5_kernel2.6.20"

The aim is that ls $TBB_INSTALL_DIR/$TBB_ARCH_PLATFORM shows the files to link against.

Building

CMake is the current build tool of choice.

You may need to point CMake to the location of your custom libcurl and libevent or any other libraries which needed to be installed. The CMAKE_PREFIX_PATH variable is used to hint to the location.

export CMAKE_PREFIX_PATH=/home/user

To build HipHop use the following

cd /home/user/hiphop
git clone git://github.com/facebook/hiphop-php.git
cd hiphop-php
git submodule init
git submodule update
export HPHP_HOME=`pwd`
export HPHP_LIB=`pwd`/bin
cmake .

Once this is done you can generate the build file and this will return you to the shell, finally to build run make, if any errors occur it may be required to remove the CMakeCache.txt directory in the checkout.

make