Building and installing HHVM on OSX 10.10 with MacPorts

Yo-An Lin edited this page May 12, 2017 · 3 revisions

Mac OS X Macports

Using Macports is unsupported (Homebrew is recommended), but should work and require Mac OS X 10.10 or higher.

Dependencies

sudo port -v install autoconf automake binutils bison boost clang-3.6 cmake \
  elftoolchain gawk google-glog jemalloc libelf libjpeg-turbo libmcrypt \
  libmemcached libpng md5sha1sum ocaml oniguruma5 readline tbb

Currently clang-3.6 is not supported on macOS Sierra or newer on Macports.

Error: clang-3.6 is not supported on macOS Sierra or newer.
Error: Failed to fetch clang-3.6: unsupported platform

Clone HHVM

git clone https://github.com/facebook/hhvm.git
cd hhvm
git submodule update --init --recursive

Build

cmake \
 -DCMAKE_C_COMPILER=clang-mp-3.6 -DCMAKE_CXX_COMPILER=clang++-mp-3.6 -DCMAKE_ASM_COMPILER=clang-mp-3.6 \
 -DCMAKE_C_FLAGS="-isystem/opt/local/include" -DCMAKE_CXX_FLAGS="-isystem/opt/local/include" \
 -DENABLE_MCROUTER=0 -DENABLE_EXTENSION_MCROUTER=Off -DENABLE_EXTENSION_IMAGICK=Off \
 -DMYSQL_UNIX_SOCK_ADDR=/dev/null \
 -DLIBDWARF_LIBRARIES="/opt/local/lib/elftoolchain/libdwarf.3.dylib" \
 -DLIBDWARF_INCLUDE_DIRS="/opt/local/include/elftoolchain/"

Run

./hphp/hhvm/hhvm --version
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.