Skip to content

Building and installing HHVM on Ubuntu 13.04

Paul Tarjan edited this page May 15, 2013 · 10 revisions

Packages installation

Using sudo or as root user: (you may have to run sudo apt-get update first)

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 \
  libelf-dev libdwarf-dev libunwind8-dev subversion \
  libboost-regex-dev libcurl4-openssl-dev libgoogle-glog-dev libjemalloc-dev

Getting HipHop source-code

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

Building third-party libraries

libevent

git clone git://github.com/libevent/libevent.git
cd libevent
git checkout release-1.4.14b-stable
cat ../hiphop-php/hphp/third_party/libevent-1.4.14.fb-changes.diff | patch -p1
./autogen.sh
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..

Building HipHop

cd hiphop-php
export HPHP_HOME=`pwd`
cmake .
make

Running programs

The hhvm binary can be found in hphp/hhvm/hhvm.

Errors

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.