Skip to content

Building and installing HHVM on OSX 10.8 With Homebrew

c9s edited this page Sep 15, 2014 · 1 revision

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 libxslt

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/sgolemon/8fdc7e2afcd73a960b9c/raw/1211e21151ed3443dbc027e5383fb49e9eb1ab91/jemallocfb.rb

Get HHVM

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

Build HHVM

cd hhvm
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 \
    -DLIBMAGICKWAND_INCLUDE_DIRS=$(brew --prefix imagemagick)/include/ImageMagick-6 \
    -DLIBMAGICKWAND_LIBRARIES=$(brew --prefix imagemagick)/lib/libMagickWand-6.Q16.dylib \
    -DMYSQL_INCLUDE_DIR=$(brew --prefix mysql-connector-c)/include \
    -DMYSQL_LIB=$(brew --prefix mysql-connector-c)/lib
make -j4
Clone this wiki locally