月度归档:2012年12月

Facebook HipHop on ubuntu 12.04安装笔记 [转]

最近看n多报道说facebook的HipHop的VM性能已经超过的编译版的,所以特意尝试了下Facebook的HipHop,现在把安装笔记记录一下。

 

本次安装在buntu 12.04 x86_64版本上进行,目前hiphop仅支持64bit版本:

  1. 有Internet联网电脑一台;
  2. ubuntu-12.04 x86_64 OS;
  3. 编译时间较长,需要有耐心。

升级ubuntu:

sudo apt-get update
sudo apt-get dist-upgrade

安装必要依赖包:

sudo apt-get install git-core cmake g++ libboost-dev libmysqlclient-dev libxml2-dev libmcrypt-dev libicu-dev openssl build-essential binutils-dev libcap-dev libgd2-xpm-dev zlib1g-dev libtbb-dev libonig-dev libpcre3-dev autoconf libtool libcurl4-openssl-dev libboost-system-dev libboost-program-options-dev libboost-filesystem-dev wget memcached libreadline-dev libncurses-dev libmemcached-dev libbz2-dev libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev libcloog-ppl0 libelf-dev libdwarf-dev libunwind7-dev

git检出hiphop代码:

mkdir dev
cd dev

git clone git://github.com/facebook/hiphop-php.git
cd hiphop-php
export CMAKE_PREFIX_PATH=`/bin/pwd`/..
export HPHP_HOME=`/bin/pwd`
export HPHP_LIB=`/bin/pwd`/bin
cd ..

libevent需要重新patch:

git clone git://github.com/libevent/libevent.git
cd libevent
git checkout release-1.4.14b-stable
cat ../hiphop-php/src/third_party/libevent-1.4.14.fb-changes.diff | patch -p1
./autogen.sh
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..

libcurl需要重新patch:

git clone git://github.com/libevent/libevent.git
cd libevent
git checkout release-1.4.14b-stable
cat ../hiphop-php/src/third_party/libevent-1.4.14.fb-changes.diff | patch -p1
./autogen.sh
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..

编译jemalloc:

wget http://www.canonware.com/download/jemalloc/jemalloc-3.0.0.tar.bz2
tar xjvf jemalloc-3.0.0.tar.bz2
cd jemalloc-3.0.0
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
cd ..

以上准备工作就绪,现在开始编译hihop,本次安装是使用的hhvm模式:

cd hiphop-php
git submodule init
git submodule update
export HPHP_HOME=`pwd`
export HPHP_LIB=`pwd`/bin
export USE_HHVM=1
cmake .
make

大功告成,进入src/hhvm里,hhvm文件即是。

PS,ubuntu安装极其简单,但在一台centos6.3上装了n次才搞定。

开源一个学习java中的练习作品

作品名:多用户通讯录

主要功能:vcard导入与导出、联系人新建、编辑、删除和列表分页功能

采用的框架和开源库:spring3.1 + springmvc + ibatis2 + maven3 + hibernate-validator + commons-fileupload + cardme

下载地址:book

部分截图