Skip to content

Building and installing HHVM on OSX 10.8

Sean Cannella edited this page Feb 3, 2014 · 101 revisions

Install with Homebrew

Install homebrew

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"

Tap additional repositories

brew tap homebrew/dupes
brew tap homebrew/versions
brew tap mcuadros/homebrew-hhvm

Install master HHVM version

brew install hhvm --HEAD

Install by hand

Install homebrew

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"

Tap additional repositories

brew tap homebrew/dupes
brew tap homebrew/versions

Install dependencies

brew install freetype gettext cmake git libtool mcrypt glog oniguruma re2c autoconf libelf readline automake mysql pcre gd icu4c libmemcached mysql-connector-c pkg-config tbb boost imagemagick mysql-connector-c++ binutils ncurses curl

Install GCC:

brew install --cc=llvm-gcc gcc48

Install some packages that are not (yet) part of homebrew:

brew install https://gist.github.com/danslo/5841970/raw/9177250ed1a7466f0acf3147c9c1ca0ff8ab233b/cclient.rb \
    https://gist.github.com/danslo/5621394/raw/7826e6046bf77bea549265099c306debfcbe6b04/libdwarf.rb \
    https://gist.github.com/danslo/5841552/raw/c3a7ecd45afa4a6b549c7d76c74f96e89d11de46/libeventfb.rb \
    https://gist.github.com/danslo/5881669/raw/8f487bbe8e9d196075d4a4cbb4797c68974c7c1a/boostfb.rb \
    https://gist.github.com/danslo/6034879/raw/00be8488d2dea232b750ab8207a788032d9135b6/jemallocfb.rb

Get HHVM

git clone --recursive git://github.com/facebook/hhvm.git

Build HHVM

cd hhvm
export HPHP_HOME=`pwd`
cmake . \
    -DCMAKE_CXX_COMPILER=$(brew --prefix gcc48)/bin/g++-4.8 \
    -DCMAKE_C_COMPILER=$(brew --prefix gcc48)/bin/gcc-4.8 \
    -DCMAKE_ASM_COMPILER=$(brew --prefix gcc48)/bin/gcc-4.8 \
    -DLIBIBERTY_LIB=$(brew --prefix gcc48)/lib/x86_64/libiberty-4.8.a \
    -DCMAKE_INCLUDE_PATH="/usr/local/include:/usr/include" \
    -DCMAKE_LIBRARY_PATH="/usr/local/lib:/usr/lib" \
    -DLIBEVENT_LIB=$(brew --prefix libeventfb)/lib/libevent.dylib \
    -DLIBEVENT_INCLUDE_DIR=$(brew --prefix libeventfb)/include \
    -DICU_INCLUDE_DIR=$(brew --prefix icu4c)/include \
    -DICU_LIBRARY=$(brew --prefix icu4c)/lib/libicuuc.dylib \
    -DICU_I18N_LIBRARY=$(brew --prefix icu4c)/lib/libicui18n.dylib \
    -DICU_DATA_LIBRARY=$(brew --prefix icu4c)/lib/libicudata.dylib \
    -DREADLINE_INCLUDE_DIR=$(brew --prefix readline)/include \
    -DREADLINE_LIBRARY=$(brew --prefix readline)/lib/libreadline.dylib \
    -DNCURSES_LIBRARY=$(brew --prefix ncurses)/lib/libncurses.dylib \
    -DCURL_INCLUDE_DIR=$(brew --prefix curl)/include \
    -DCURL_LIBRARY=$(brew --prefix curl)/lib/libcurl.dylib \
    -DBOOST_INCLUDEDIR=$(brew --prefix boostfb)/include \
    -DBOOST_LIBRARYDIR=$(brew --prefix boostfb)/lib \
    -DBoost_USE_STATIC_LIBS=ON \
    -DJEMALLOC_INCLUDE_DIR=$(brew --prefix jemallocfb)/include \
    -DJEMALLOC_LIB=$(brew --prefix jemallocfb)/lib/libjemalloc.dylib \
    -DLIBINTL_LIBRARIES=$(brew --prefix gettext)/lib/libintl.dylib \
    -DLIBINTL_INCLUDE_DIR=$(brew --prefix gettext)/include \
    -DLIBDWARF_LIBRARIES=$(brew --prefix libdwarf)/lib/libdwarf.3.dylib \
    -DLIBDWARF_INCLUDE_DIRS=$(brew --prefix libdwarf)/include
make -j4
Clone this wiki locally