Skip to content

Building and installing HHVM on CentOS 6.4

Shahyar G edited this page Mar 12, 2015 · 26 revisions

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 libevent-devel libcurl-devel libmcrypt-devel tbb-devel libdwarf-devel ncurses-devel python-devel

Getting HHVM

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

cmake

wget http://www.cmake.org/files/v3.0/cmake-3.0.2.tar.gz
tar xzvf cmake-3.0.2.tar.gz
cd cmake-3.0.2
./configure
nano Source/CMakeFiles/cmake.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 xzvf 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 ..

Google glog

wget https://google-glog.googlecode.com/files/glog-0.3.3.tar.gz
tar xzvf 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/1.0.18/+download/libmemcached-1.0.18.tar.gz
tar xzvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..

JEMalloc 3.0

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

sqlite 3.7.15.2

wget http://ftp.osuosl.org/pub/blfs/conglomeration/sqlite/sqlite-autoconf-3071502.tar.gz
tar xzvf sqlite-autoconf-3071502.tar.gz
cd sqlite-autoconf-3071502
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..

Building HipHop

cd hhvm
git submodule update --init --recursive
cmake .
sed -i -e 's/$/..\/..\/..\/lib\/libmemcached.so/g' hphp/hhvm/CMakeFiles/hhvm.dir/link.txt
make

--

Used LLVM

gcc vps uses excessive amounts of memory when building hhvm, llvm can significantly speed up the Assembly and to eliminate the overhead of memory

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