Skip to content

Building and installing HHVM on CentOS 6.4

ptarjan edited this page Mar 20, 2014 · 26 revisions

WORK IN PROGRESS

Packages installation

sudo yum install git svn cpp make autoconf automake libtool patch memcached gcc-c++ cmake wget boost-devel mysql-devel pcre-devel gd-devel libxml2-devel expat-devel libicu-devel bzip2-devel oniguruma-devel openldap-devel readline-devel libc-client-devel libcap-devel binutils-devel pam-devel elfutils-libelf-devel ImageMagick-devel libxslt-devel

Getting HHVM

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

cmake

wget http://www.cmake.org/files/v2.8/cmake-2.8.12.tar.gz
tar zxvf cmake-2.8.12.tar.gz
cd cmake-2.8.12
./configure
nano Source/CMakeFiles/ccmake.dir/link.txt # add "-ltinfo" to the end of the only line 
make
sudo make install
PATH=/usr/local/cmake/bin:$PATH
cd ..

boost (Request version 1.50+)

wget http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download -O boost_1_55_0.tar.gz
tar xvzf boost_1_55_0.tar.gz
cd boost_1_55_0
./bootstrap.sh --prefix=$CMAKE_PREFIX_PATH --libdir=$CMAKE_PREFIX_PATH/lib
./b2 --layout=system install
export Boost_LIBRARYDIR=$CMAKE_PREFIX_PATH/include/boost/
cd ..

libevent (Optional if you want builtin web-server support)

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=$CMAKE_PREFIX_PATH
make
make install
cd ..

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=$CMAKE_PREFIX_PATH
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 ..

JEMalloc 3.0

wget http://www.canonware.com/download/jemalloc/jemalloc-3.0.0.tar.bz2
tar xjvf jemalloc-3.0.0.tar.bz2
cd jemalloc-3.0.0
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..

Building HipHop

cd hhvm
git submodule update --init
cmake .
make

--

Used LLVM

GCC for VPS many memory usage, am using llvm speed-time and memory usage Install RHEL + EPEL

# yum install llvm clang
# clang --version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-redhat-linux-gnu
Thread model: posix
# cmake \ 
 -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
 -DCMAKE_C_COMPILER=/usr/bin/clang \
 -DCMAKE_ASM_COMPILER=/usr/bin/clang .
Clone this wiki locally