Skip to content

Building and Installing on Ubuntu 11.10

kyleboddy edited this page Sep 19, 2012 · 34 revisions

Packages installation

Using sudo or as root user:

As outlined in the 11.04 instructions plus the addition of the required libcloog-ppl0 package for 11.10

sudo apt-get install git-core cmake g++ libboost-dev libmysqlclient-dev libxml2-dev libmcrypt-dev libicu-dev openssl build-essential binutils-dev libcap-dev libgd2-xpm-dev zlib1g-dev libtbb-dev libonig-dev libpcre3-dev autoconf libtool libcurl4-openssl-dev libboost-system-dev libboost-program-options-dev libboost-filesystem-dev wget memcached libreadline-dev libncurses-dev libmemcached-dev libbz2-dev libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev libcloog-ppl0 libdwarf-dev libelf-dev

Getting HipHop source-code

mkdir dev
cd dev
git clone git://github.com/facebook/hiphop-php.git
cd hiphop-php
export CMAKE_PREFIX_PATH=`/bin/pwd`/../
export HPHP_HOME=`/bin/pwd`
export HPHP_LIB=`/bin/pwd`/bin
cd ..

Building third-party libraries

libevent

wget http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
tar -xzvf libevent-1.4.14b-stable.tar.gz
cd libevent-1.4.14b-stable
cp ../hiphop-php/src/third_party/libevent-1.4.14.fb-changes.diff .
patch -p1 < libevent-1.4.14.fb-changes.diff
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..

libCurl

Make sure that your system time is correct, otherwise ./configure will fail.

wget http://curl.haxx.se/download/curl-7.21.2.tar.gz
tar -xvzf curl-7.21.2.tar.gz
cd curl-7.21.2
cp ../hiphop-php/src/third_party/libcurl.fb-changes.diff .
patch -p1 < libcurl.fb-changes.diff
./configure --prefix=$CMAKE_PREFIX_PATH

As per: https://github.com/bagder/curl/commit/26b487a5d6ed9da5bc8e4a134a88d3125884b852

  • Edit lib/ssluse.c

As per: https://github.com/facebook/hiphop-php/issues/319#issuecomment-1445537

  • Edit runtime/ext/extension.cpp
make
make install
cd ..

libmemcached

wget http://launchpad.net/libmemcached/1.0/0.49/+download/libmemcached-0.49.tar.gz
tar -xzvf libmemcached-0.49.tar.gz
cd libmemcached-0.49
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..

libunwind

wget 'http://download.savannah.gnu.org/releases/libunwind/libunwind-1.0.1.tar.gz'
tar -zxf libunwind-1.0.1.tar.gz
cd libunwind-1.0.1
autoreconf -i -f
./configure --prefix=$CMAKE_PREFIX_PATH
make CFLAGS=-U_FORTIFY_SOURCE
make install
cd ..

Building HipHop

cd hiphop-php
git submodule init
git submodule update
export HPHP_HOME=`pwd`
export HPHP_LIB=`pwd`/bin
cmake .
make

hphp binary can be found in src/hphp folder and is called hphp

If any errors occur, it may be required to remove the CMakeCache.txt directory in the checkout.

If your failure was on the make command, try to correct the error and run make again, it should restart from the point it stops. If don’t, try to remove as explained above.

(Optional) To build the older non-HHVM version

We’re still working on getting HHVM building smoothly on all platforms, if you run into trouble you can’t resolve, try reverting to an older version of the codebase using:

git checkout pre-hhvm
Clone this wiki locally