-
Notifications
You must be signed in to change notification settings - Fork 0
Building and Installing on FreeBSD 8.2
This walkthrough was tested with 64-bit 8.1, 8.2 and 9.0, but generally any FreeBSD with gcc46 should do.
mkdir -p /usr/src/lib/libc/gen
freebsd-update fetch
freebsd-update install
pkg_add -r cmake flex bison re2c openssl gd libxml2 pcre oniguruma boost-libs libmemcached libmcrypt binutils expat mysql50-client wget tbb icu openldap24-client libexecinfo gcc46 gawk git cclient mc autoconf gmake
cd /usr/src/contrib/ git clone git://canonware.com/jemalloc.git cd jemalloc autoconf ./configure --prefix=/usr/local gmake gmake install
cd /usr/local/lib ln -s libc-client4.so libc-client.so
mkdir ~/hhbuild cd ~/hhbuild mkdir libs
git clone git://github.com/facebook/hhvm.git cd hhvm git submodule init git submodule update
You'll have to do this every time you're going to use HipHop.
setenv CC /usr/local/bin/gcc46 setenv CXX /usr/local/bin/g++46 setenv HPHP_HOME `pwd` setenv HPHP_LIB `pwd`/bin setenv CMAKE_PREFIX_PATH `pwd`/../libs
setenv CC /usr/bin/clang setenv CXX /usr/bin/clang++ setenv HPHP_HOME `pwd` setenv HPHP_LIB `pwd`/bin setenv CMAKE_PREFIX_PATH `pwd`/../libs
cd .. fetch https://github.com/downloads/libevent/libevent/libevent-1.4.14b-stable.tar.gz tar -zxf libevent-1.4.14b-stable.tar.gz cd libevent-1.4.14b-stable patch -p1 < ../hhvm/hphp/third_party/libevent-1.4.14.fb-changes.diff ./configure --prefix=$CMAKE_PREFIX_PATH make make install cd .. rm -rf libevent-1.4.14b-stable
fetch http://curl.haxx.se/download/curl-7.20.0.tar.gz tar -zxf curl-7.20.0.tar.gz cd curl-7.20.0 patch -p1 < ../hhvm/hphp/third_party/libcurl.fb-changes.diff ./configure --prefix=$CMAKE_PREFIX_PATH make make install cd .. rm -rf curl-7.20.0
fetch http://cpp.in/dev/hphp-freebsd-20120214.patch cd hhvm patch < ../hphp-freebsd-20120214.patch
For FreeBSD 9.0 you're also need to apply libmemcached-1.0 support patch:
cd .. fetch http://cpp.in/dev/hphp-libmemcached-1.0.patch cd hhvm patch < ../hphp-libmemcached-1.0.patch
Since HipHop is compiled with non-base gcc, you should make HipHop to use specific libstdc++. Put this to /etc/libmap.conf:
[hhvm] libstdc++.so.6 gcc46/libstdc++.so.6 [program] libstdc++.so.6 gcc46/libstdc++.so.6
cmake . make
hhvm binary can be found in hphp/hhvm folder and is called hhvm
In case you're expiriencing occasional segfaults with 8.1, you should apply the patch from this PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=154073