-
Notifications
You must be signed in to change notification settings - Fork 3k
Building and installing HHVM on OSX 10.9
Daniel Sloof edited this page Aug 11, 2014
·
78 revisions
Unfortunately the fully automated Homebrew package is broken at this point. Try the "install by hand" below.
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
brew tap homebrew/versions
Because of a current bug in 3.8.5, we need to downgrade to 3.8.4. This bug has been solved in the next release.
cd $(brew --prefix)
git checkout 274d475 /usr/local/Library/Formula/sqlite.rb
brew install freetype gettext cmake git libtool mcrypt oniguruma re2c \
autoconf libelf readline automake mysql-connector-c pcre \
gd icu4c libmemcached pkg-config tbb imagemagick binutils \
curl imap-uw libxslt libevent sqlite homebrew/versions/gcc48
brew install --build-from-source --cc=gcc-4.8 glog boost
Install some packages that are not (yet) part of homebrew:
brew install \
https://gist.github.com/slbmeh/9059260/raw/1cbf0f6f5639b4a066395bedb702cdd6bd895d15/libdwarf.rb \
https://gist.github.com/danslo/6034879/raw/00be8488d2dea232b750ab8207a788032d9135b6/jemallocfb.rb
git clone --recursive git://github.com/facebook/hhvm.git
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 libevent)/lib/libevent.dylib \
-DLIBEVENT_INCLUDE_DIR=$(brew --prefix libevent)/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 \
-DCURL_INCLUDE_DIR=$(brew --prefix curl)/include \
-DCURL_LIBRARY=$(brew --prefix curl)/lib/libcurl.dylib \
-DBOOST_INCLUDEDIR=$(brew --prefix boost)/include \
-DBOOST_LIBRARYDIR=$(brew --prefix boost)/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 \
-DFREETYPE_INCLUDE_DIRS=$(brew --prefix freetype)/include/freetype2 \
-DFREETYPE_LIBRARIES=$(brew --prefix freetype)/lib/libfreetype.dylib \
-DLIBSQLITE3_INCLUDE_DIR=$(brew --prefix sqlite)/include \
-DLIBSQLITE3_LIBRARY=$(brew --prefix sqlite)/lib/libsqlite3.0.dylib
make -j4
If you see errors like this
Linking CXX executable hhvm
Undefined symbols for architecture x86_64:
"boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > const&)", referenced from:
during the make -j4
try uninstalling and reinstalling Boost.
Unistall Boost
brew remove boost
Reinstall Boost
brew install --build-from-source --cc=gcc-4.8 boost
Then re-run the make
make -j4