【失敗(´・ω・`)】HHVMをインストールするまでの道のりは険しい……
-----------------------------
結論から言えば、このエントリの内容は「うまくいかなかったよ」って話なので、無駄な時間を過ごさないように注意すること。
-----------------------------
ちょっと興味本位でHHVM関連のことを調べていたら、Mac OS X Mavericksにもインストールできるらしいってことが分かった。ので、試してみた。その記録がこのエントリ。
えっと、上記を見ると分かるんだけど、このエントリを書いている時点で「Mac OS X installation is currently EXPERIMENTAL and UNSUPPORTED.」ってことなのでその点注意されたし。それに「Currently Mac OS X has only interpreted support for HHVM (i.e., the JIT is not available).」ってことなので、まあ実用的かといわれると微妙なステータスな気もする。
ボクの場合、純粋な興味でやっているのでこれらは問題にならないけども、普通に使いたい人はちゃんとしたものが動く環境(*1)を用意した方がいいと思う。
ちなみに構築手順については、facebook/hhvmのBuilding and installing HHVM on OSX 10.9ってのを参照しながらやっているよ。
【失敗(´・ω・`)】手動でHHVMをインストールしてみる
必要な環境はHomebrewを使って整えるらしい。ボクはHomebrew自体インストール済み。その辺りの話は下記エントリを参照。
一応書いておくと、インストール自体は下記コマンドでいける。
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
続いて下記コマンドを実行しレポジトリを追加しろと書いてある。ボクの環境の場合は下記の通り表示された。追加済みだそうな。
$ brew tap homebrew/versions Warning: Already tapped!
これで準備が整ったので、必要なパッケージを入れていく。
$ 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 (中略) ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-2.0.4.mavericks.bottle.tar.gz ######################################################################## 100.0% ==> Pouring git-2.0.4.mavericks.bottle.tar.gz ==> Caveats The OS X keychain credential helper has been installed to: /usr/local/bin/git-credential-osxkeychain The 'contrib' directory has been installed to: /usr/local/share/git-core/contrib Bash completion has been installed to: /usr/local/etc/bash_completion.d zsh completion has been installed to: /usr/local/share/zsh/site-functions Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/git Target /usr/local/bin/git already exists. You may want to remove it: rm /usr/local/bin/git To force the link and overwrite all conflicting files: brew link --overwrite git To list all files that would be deleted: brew link --overwrite --dry-run git (後略)
どうやらGitのインストール(正確に言えば、/usr/local/binへのシンボリックリンク作成)でエラーになったらしい。ボクの環境ではGitHub for Macをインストールしているから(ってか「Install Command Line Tools」をクリックしてたから)、バッティングしたらしい。
ひとまず「$ brew uninstall git」で中途半端にインストールされたgitを削除(*2)して、git抜きで関連コマンドのインストールを続けてみる。
$ brew install freetype gettext cmake 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 (後略)
結構時間かかるので、気長に待ってみる。エラー無く終了すればOK。
おもいっきり余談なんだけど。ボクはMacbook Air(11-inch, Mid 2013)でお試ししてる。gccの「make bootstrap」が始まって50分弱かかった。途中でファンがすげぇ勢いで回転しだして、底がスゴイ熱くなったのでMacbook Proがほしいです。
続いてglogとboostをインストールする。ソースからだね。
$ brew install --build-from-source --cc=gcc-4.8 glog boost (後略)
これも少々時間がかかるので、気長に待ってみる。手元の環境で30分程度。エラー無く終了すればOK。
最後に下記コマンドを実行すればおわり。これはサクッと終わる。
$ brew install https://gist.github.com/slbmeh/9059260/raw/1cbf0f6f5639b4a066395bedb702cdd6bd895d15/libdwarf.rb (後略)
ここまでにスゴイ時間かかったけど、HHVMをビルドする環境は整ったはず。
【失敗(´・ω・`)】HHVMをビルドするドン!
さてここからがメインディッシュだ。gitでHHVMのコードを持ってくるので、適当なディレクトリに「cd」して「git clone」する。
$ cd /path/to/dir/git $ git clone --recursive git://github.com/facebook/hhvm.git (後略)
すると「hhvm」という名前のディレクトリができるので、そこに「cd」して、長ったらしいコマンドをアレする。下記をコマンドラインにそのままコピペするとおかしくなるから、適当な名前でシェルスクリプト作って実行することにしてみた。「./configure」相当の処理になるのかな?
$ 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 -DLIBMEMCACHED_LIBRARY=$(brew --prefix libmemcached)/lib -DLIBMEMCACHED_INCLUDE_DIR=$(brew --prefix libmemcached)/include -DLIBELF_LIBRARIES=$(brew --prefix libelf)/lib -DLIBELF_INCLUDE_DIRS=$(brew --prefix libelf)/include -DLIBGLOG_LIBRARY=$(brew --prefix glog)/lib -DLIBGLOG_INCLUDE_DIR=$(brew --prefix glog)/include -DPCRE_LIBRARY=$(brew --prefix pcre)/lib -DPCRE_INCLUDE_DIR=$(brew --prefix pcre)/include -DTBB_INSTALL_DIR=$(brew --prefix tbb) -DLIBSQLITE3_INCLUDE_DIR=$(brew --prefix sqlite)/include -DLIBSQLITE3_LIBRARY=$(brew --prefix sqlite)/lib/libsqlite3.0.dylib (後略)
ふむ、なにかwarningはでてるっぽいけど、いい感じにいけてるっぽい。
最後にビルドしますよ。少々時間がかかるので気長に待ちます。
$ make -j4 (後略)
エラー無く終わればOK……なんだけど、下記のようなエラーが出てうまくいかない。
(前略) [ 25%] Building CXX object hphp/tools/bootstrap/CMakeFiles/gen-ext-hhvm.dir/idl.cpp.o Linking CXX executable gen-infotabs Undefined symbols for architecture x86_64: "google::LogMessage::stream()", referenced from: folly::dynamic::destroy() in gen-infotabs.cpp.o HPHP::IDL::PhpFunc::~PhpFunc() in gen-infotabs.cpp.o HPHP::IDL::PhpClass::~PhpClass() in gen-infotabs.cpp.o folly::TypeError::TypeError(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, folly::dynamic::Type) in idl.cpp.o folly::dynamic::destroy() in idl.cpp.o folly::dynamic::operator=(folly::dynamic const&) in idl.cpp.o folly::dynamic::operator<(folly::dynamic const&) const in idl.cpp.o ... "google::LogMessageFatal::LogMessageFatal(char const*, int)", referenced from: folly::dynamic::destroy() in gen-infotabs.cpp.o HPHP::IDL::PhpFunc::~PhpFunc() in gen-infotabs.cpp.o HPHP::IDL::PhpClass::~PhpClass() in gen-infotabs.cpp.o folly::TypeError::TypeError(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, folly::dynamic::Type) in idl.cpp.o folly::dynamic::destroy() in idl.cpp.o folly::dynamic::operator=(folly::dynamic const&) in idl.cpp.o folly::dynamic::operator<(folly::dynamic const&) const in idl.cpp.o ... "google::LogMessageFatal::~LogMessageFatal()", referenced from: folly::dynamic::destroy() in gen-infotabs.cpp.o HPHP::IDL::PhpFunc::~PhpFunc() in gen-infotabs.cpp.o HPHP::IDL::PhpClass::~PhpClass() in gen-infotabs.cpp.o folly::TypeError::TypeError(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, folly::dynamic::Type) in idl.cpp.o folly::dynamic::destroy() in idl.cpp.o folly::dynamic::operator=(folly::dynamic const&) in idl.cpp.o folly::dynamic::operator<(folly::dynamic const&) const in idl.cpp.o ... ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status make[2]: *** [hphp/tools/bootstrap/gen-infotabs] Error 1 make[1]: *** [hphp/tools/bootstrap/CMakeFiles/gen-infotabs.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... Linking CXX executable gen-class-map Undefined symbols for architecture x86_64: "google::LogMessage::stream()", referenced from: folly::TypeError::TypeError(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, folly::dynamic::Type) in gen-class-map.cpp.o folly::dynamic::destroy() in gen-class-map.cpp.o folly::dynamic::operator=(folly::dynamic const&) in gen-class-map.cpp.o folly::dynamic::operator<(folly::dynamic const&) const in gen-class-map.cpp.o std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> > >::value, void>::type folly::toAppend<folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >, double>(double, folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in gen-class-map.cpp.o std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::value, void>::type folly::toAppend<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, double>(double, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in gen-class-map.cpp.o std::_Hashtable<folly::dynamic, std::pair<folly::dynamic const, folly::dynamic>, std::allocator<std::pair<folly::dynamic const, folly::dynamic> >, std::__detail::_Select1st, std::equal_to<folly::dynamic>, std::hash<folly::dynamic>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::find(folly::dynamic const&) const in gen-class-map.cpp.o ... "google::LogMessageFatal::LogMessageFatal(char const*, int)", referenced from: folly::TypeError::TypeError(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, folly::dynamic::Type) in gen-class-map.cpp.o folly::dynamic::destroy() in gen-class-map.cpp.o folly::dynamic::operator=(folly::dynamic const&) in gen-class-map.cpp.o folly::dynamic::operator<(folly::dynamic const&) const in gen-class-map.cpp.o std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> > >::value, void>::type folly::toAppend<folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >, double>(double, folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in gen-class-map.cpp.o std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::value, void>::type folly::toAppend<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, double>(double, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in gen-class-map.cpp.o std::_Hashtable<folly::dynamic, std::pair<folly::dynamic const, folly::dynamic>, std::allocator<std::pair<folly::dynamic const, folly::dynamic> >, std::__detail::_Select1st, std::equal_to<folly::dynamic>, std::hash<folly::dynamic>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::find(folly::dynamic const&) const in gen-class-map.cpp.o ... "google::LogMessageFatal::~LogMessageFatal()", referenced from: folly::TypeError::TypeError(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, folly::dynamic::Type) in gen-class-map.cpp.o folly::dynamic::destroy() in gen-class-map.cpp.o folly::dynamic::operator=(folly::dynamic const&) in gen-class-map.cpp.o folly::dynamic::operator<(folly::dynamic const&) const in gen-class-map.cpp.o std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> > >::value, void>::type folly::toAppend<folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >, double>(double, folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in gen-class-map.cpp.o std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::value, void>::type folly::toAppend<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, double>(double, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in gen-class-map.cpp.o std::_Hashtable<folly::dynamic, std::pair<folly::dynamic const, folly::dynamic>, std::allocator<std::pair<folly::dynamic const, folly::dynamic> >, std::__detail::_Select1st, std::equal_to<folly::dynamic>, std::hash<folly::dynamic>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::find(folly::dynamic const&) const in gen-class-map.cpp.o ... ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status make[2]: *** [hphp/tools/bootstrap/gen-class-map] Error 1 make[1]: *** [hphp/tools/bootstrap/CMakeFiles/gen-class-map.dir/all] Error 2 Linking CXX executable gen-ext-hhvm Undefined symbols for architecture x86_64: "google::LogMessage::stream()", referenced from: folly::TypeError::TypeError(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, folly::dynamic::Type) in gen-ext-hhvm.cpp.o folly::dynamic::destroy() in gen-ext-hhvm.cpp.o folly::dynamic::operator=(folly::dynamic const&) in gen-ext-hhvm.cpp.o folly::BaseFormatter<folly::Formatter<false, folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> > const&>, false, folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> > const&>::handleFormatStrError() const in gen-ext-hhvm.cpp.o folly::BaseFormatter<folly::Formatter<false, char const*&, int>, false, char const*&, int>::handleFormatStrError() const in gen-ext-hhvm.cpp.o std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> > >::value, void>::type folly::toAppend<folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >, double>(double, folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in gen-ext-hhvm.cpp.o std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::value, void>::type folly::toAppend<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, double>(double, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in gen-ext-hhvm.cpp.o ... "google::LogMessageFatal::LogMessageFatal(char const*, int)", referenced from: folly::TypeError::TypeError(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, folly::dynamic::Type) in gen-ext-hhvm.cpp.o folly::dynamic::destroy() in gen-ext-hhvm.cpp.o folly::dynamic::operator=(folly::dynamic const&) in gen-ext-hhvm.cpp.o folly::BaseFormatter<folly::Formatter<false, folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> > const&>, false, folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> > const&>::handleFormatStrError() const in gen-ext-hhvm.cpp.o folly::BaseFormatter<folly::Formatter<false, char const*&, int>, false, char const*&, int>::handleFormatStrError() const in gen-ext-hhvm.cpp.o std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> > >::value, void>::type folly::toAppend<folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >, double>(double, folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in gen-ext-hhvm.cpp.o std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::value, void>::type folly::toAppend<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, double>(double, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in gen-ext-hhvm.cpp.o ... "google::LogMessageFatal::~LogMessageFatal()", referenced from: folly::TypeError::TypeError(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, folly::dynamic::Type) in gen-ext-hhvm.cpp.o folly::dynamic::destroy() in gen-ext-hhvm.cpp.o folly::dynamic::operator=(folly::dynamic const&) in gen-ext-hhvm.cpp.o folly::BaseFormatter<folly::Formatter<false, folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> > const&>, false, folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> > const&>::handleFormatStrError() const in gen-ext-hhvm.cpp.o folly::BaseFormatter<folly::Formatter<false, char const*&, int>, false, char const*&, int>::handleFormatStrError() const in gen-ext-hhvm.cpp.o std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> > >::value, void>::type folly::toAppend<folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >, double>(double, folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in gen-ext-hhvm.cpp.o std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::value, void>::type folly::toAppend<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, double>(double, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in gen-ext-hhvm.cpp.o ... ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status make[2]: *** [hphp/tools/bootstrap/gen-ext-hhvm] Error 1 make[1]: *** [hphp/tools/bootstrap/CMakeFiles/gen-ext-hhvm.dir/all] Error 2 make: *** [all] Error 2
ちなみにこの「make -j4」の間に
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:
みたいなエラーがでたら、
$ brew remove boost (中略) $ brew install --build-from-source --cc=gcc-4.8 boost (後略)
してboostを再インストールした後に、「make -j4」をやり直せという指示がある。
手元の環境で出たエラーとちょっと違うのだけど、ダメ元でそれを試してみるけどダメ。まあ、ダメだよね普通に。
ちなみエラーメッセージでググってみたら、「OS X 10.9.4 Broken build #3548」ってIssueが見つかった。なるほど、現状うまくいかないって報告が上がっているのか。
うーん、この方法は断念しよう……。
ここまでの間にいろいろHomebrewでインストールしちゃってるので、いったんそれらを削除しておくことに。ってか一旦Homebrewを消して、使う奴だけ入れ直した。ディスクのムダ遣いだし(つ_T)
【失敗(´・ω・`)】Homebrew経由でHHVMをインストールしてみる
がっくりしながらいろいろググってみたら「mcuadros/homebrew-hhvm」なるものを発見。最後にこれをお試ししてみることに。
下記のコマンドを順番に入れていけばOKらしいというシンプルな感じ。「brew install hhvm --HEAD」がうまくいかなければ、「brew install hhvm」を試してみるとよいとのこと。最新の安定版が落ちてくるらしいので。
$ brew tap homebrew/dupes (中略) $ brew tap homebrew/versions (中略) $ brew tap mcuadros/homebrew-hhvm (中略) $ brew install hhvm --with-system-mysql (後略)
例によってgitが自動的にインストールされるのだけれど、GitHub for Macをインストールしているから、バッティングしてしまう。
良い機会なので……というか面倒くさくなったのでGitHub for Macをアンインストールして、「brew install hhvm」を再実行。たぶんGitHub for Macの残骸が残っていてエラーが出るので、手動で削除していく。
ボクみたいにMySQLをインストール済みの人は「--with-system-mysql」オプションをお忘れ無く。未インストールの人は付けないでね!(*3)
で、結果はというと……「brew install hhvm --HEAD」と「brew install hhvm」の両方を試してみたけど下記のエラーが出てビルドできなかった。
ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status make[2]: *** [hphp/hhvm/hhvm] Error 1 make[1]: *** [hphp/hhvm/CMakeFiles/hhvm.dir/all] Error 2 make: *** [all] Error 2
【結論】
Ubuntuあたりでやりましょう。
*1:Ubuntuとか
*2:バージョン的にはHomebrewで入れようとした方が新しいんだけど、GitHub for Macの動きがおかしくなっても困るし、git cloneできれば良いんだろ的なアレでこうした
*3:インストールされるパスが違ったりするので、問題にならないケースの方が多い気もする