Skip to content

Instantly share code, notes, and snippets.

@shivaas
Last active August 29, 2015 13:56
Show Gist options
  • Save shivaas/8952079 to your computer and use it in GitHub Desktop.
Save shivaas/8952079 to your computer and use it in GitHub Desktop.

Recommend spinning up a c3.8xlarge instance that gives you 32 cores and 60gigs of memory to compile the libraries. Once you are done installing, you can downsize the box and continue using HHVM.

Note: Replace 32 with the number of cores you have available on the machine.


Dependencies

sudo yum -y update && \
sudo yum -y install \
	autoconf \
	automake \
	binutils-devel \
	boost-devel \
	bzip2-devel \
	chrpath \
	cmake \
	cpp \
	curl-devel \
	elfutils-libelf-devel \
	expat-devel \
	gd-devel \
	git \
	gcc47-c++ \
	jemalloc-devel \
	libc-client-devel \
	libcap-devel \
	libicu-devel \
	libIDL-devel \
	libmcrypt-devel \
	libmemcached-devel \
	libtool \
	libxml2-devel \
	make \
	memcached \
	mysql-devel \
	oniguruma-devel \
	openldap-devel \
	pam-devel \
	patch \
	pcre-devel \
	readline-devel \
	svn \
	wget \
;

Download HHVM

cd ~ && \
git clone git://github.com/facebook/hhvm.git && \
cd hhvm && \
git checkout HHVM-2.4.1 && \
git submodule init && \
git submodule update && \
export CMAKE_PREFIX_PATH=`pwd`/.. && \
export HPHP_HOME=`pwd` && \
cd ..

Intel Thread Building Blocks (tbb) (4.0 or newer)

wget https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb42_20130725oss_src.tgz && \
tar zxvf tbb42*.tgz && \
cd tbb42* && \
cd src && \
make -j 32 

cd .. && \
sudo mkdir -p /usr/include/serial && \
sudo cp -a include/serial/* /usr/include/serial/ && \
sudo mkdir -p /usr/include/tbb && \
sudo cp -a include/tbb/* /usr/include/tbb/ && \
sudo cp build/linux_intel64*/libtbb.so.2 /usr/lib64/ && \
sudo ln -s /usr/lib64/libtbb.so.2 /usr/lib64/libtbb.so && \
cd ..

Install libdwarf

git clone git://libdwarf.git.sourceforge.net/gitroot/libdwarf/libdwarf && \
cd libdwarf/libdwarf && \
git checkout 20120410 && \
./configure && \
make -j 32 && \
sudo cp libdwarf.a /usr/lib64/ && \
sudo cp libdwarf.h /usr/include/ && \
sudo cp dwarf.h /usr/include/ && \
cd ../..

You don't need libevent if running HHVM as a fastcgi proxy.

git clone git://github.com/libevent/libevent.git && \
cd libevent && \
git checkout release-1.4.14b-stable && \
cat ../hhvm/hphp/third_party/libevent-1.4.14.fb-changes.diff | patch -p1 && \
./autogen.sh && \
./configure --prefix=/usr && \
make -j 32 && \
sudo make install && \
cd ..

If you are not installing libevent per the above instructions, then you need to update the CMake config so it can look for the system libevent in the right path. Edit /hhvm/CMake/FindLibEvent.cmake and add the following on line 12 (after the endforeach)

list(APPEND LibEvent_INCLUDE_PATHS "/usr/include")
list(APPEND LibEvent_LIB_PATHS "/usr/lib64")

Install Google Glog

wget https://google-glog.googlecode.com/files/glog-0.3.3.tar.gz && \
tar zxvf glog-0.3.3.tar.gz && \
svn checkout http://google-glog.googlecode.com/svn/trunk/ google-glog && \
cd google-glog && \
./configure --prefix=/usr && \
make -j 32 && \
sudo make install && \
cd ..
sudo ldconfig

Make & Install HHVM

cd hhvm && \
export HPHP_HOME=`pwd`

cmake -j 32 .

make -j 32

sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment