Recommend spinning up a c3.8xlarge instance that gives you 32 cores and 60gigs of memory to compile the libraries. Once you are done installing, you can downsize the box and continue using HHVM.
Note: Replace 32 with the number of cores you have available on the machine.