Having hacked with PHP every now and then, and running my blog on wordpress I wanted to give hack-lang a spin. Obviously wanting to be bleeding edge I decided to build hhvm from source on my Ubuntu 16.10 machine. It almost worked straight out the box but some poking was needed as I first encountered an error on the build following the instructions on the page. Here is what got me past the initial errors.
Install the packages documented on the page, but using gcc-4.9
$ sudo apt install autoconf automake binutils-dev build-essential cmake g++-4.9 gcc-4.9 gawk git libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libboost-system-dev libboost-thread-dev libboost-context-dev libbz2-dev libc-client-dev libldap2-dev libc-client2007e-dev libcap-dev libcurl4-openssl-dev libdwarf-dev libelf-dev libexpat-dev libgd2-xpm-dev libgoogle-glog-dev libgoogle-perftools-dev libicu-dev libjemalloc-dev libmcrypt-dev libmemcached-dev libmysqlclient-dev libncurses-dev libonig-dev libpcre3-dev libreadline-dev libtbb-dev libtool libxml2-dev zlib1g-dev libevent-dev libmagickwand-dev libinotifytools0-dev libiconv-hook-dev libedit-dev libiberty-dev libxslt1-dev ocaml-native-compilers libsqlite3-dev libyaml-dev libgmp3-dev gperf libkrb5-dev libnotify-dev libpq-dev
Checkout the hhvm source from github
$ git clone git://github.com/facebook/hhvm.git --depth=1 $ cd hhvm $ git submodule update --init --recursive
I updated the submodules and they are now at the following versions for me
$ git submodule status --recursive af252b08f715a0e348175d0754d533949f2e390c third-party (af252b0) 98ed7a23a83d64133b0a36a884e489bffb0eb864 third-party/brotli/src (v0.3.0) 8bb673f4410819df06920fdcfd24e18d235d84f7 third-party/brotli/src/terryfy (third-15-g8bb673f) f1b955eee1cb94c51074878264aecdd6ee1350dd third-party/double-conversion (v1.1-86-gf1b955e) f1217348a868bdb9ee0730244475aee05ab329c5 third-party/fastlz/src (heads/master) e21df038e0b58855ef9344d1a3a4389e03ba2cc7 third-party/fatal (0.2-573-ge21df03) 1d2d4f326acc0825690c151c38ac92d146b78146 third-party/folly/src (v2016.11.07.00-21-g1d2d4f3) eb021a100e761616b35ad62c910d6c336e0711d2 third-party/libafdt/src (heads/master) 1d8b1ac4d20b8ef8d3f5d496dabebaa0ff9019ff third-party/libzip/src (rel-1-1-3-3-g1d8b1ac) d86dc916771c126afb797637dda9f6421c0cb998 third-party/lz4/src (r131) dbf8878c0136e5f94e4bb0aef6f931d5aecfa74d third-party/mcrouter/src (v0.34.0-2-gdbf8878) 931a3231375201ee58fb495f4fad0d8fdfc36251 third-party/proxygen/src (v0.32.0-410-g931a323) 718df09610fee584c9038d8d519697e507e09c9b third-party/re2/src (2016-07-01-6-g718df09) 8468f07fcc8d96b4af69f1c8b75d404458f8e6b4 third-party/squangle/src (8468f07) 5e5773be567eeb53a75565a911ece7de2c89ee2b third-party/thrift/src (v2016.11.07.00-8-g5e5773b) 34a04f01668ae88f0dd7ca18aedf50e41689e8f9 third-party/wangle/src (v2016.11.21.00) a9e580b5a0baa768210ef10544c8fab52003ec0b third-party/webscalesqlclient/mysql-5.6 (a9e580b) dcc898b0215cee3b1baa88149c1f39e37e9bfd09 third-party/webscalesqlclient/mysql-5.6/rocksdb (rocksdb-3.13-431-gdcc898b)
with those versions building with gcc-4.9 seems to work fine
$ cmake -DCMAKE_C_COMPILER=/usr/bin/gcc-4.9 -DCMAKE_CXX_COMPILER=/usr/bin/g++-4.9 -DMYSQL_UNIX_SOCK_ADDR=/var/run/mysqld/mysqld.sock . $ make -j <number of cores for me 4>
Happy hack-ing!