Fix a bug when lookupClsMethodHelper needs to fatal
[hiphop-php.git] / configure_ubuntu_12.04.sh
blob63e44a6213d04990814798b49a24a0c62cf5323c
1 #########################################
2 #
3 # Install all the dependancies for HipHop
5 #########################################
7 SCRIPT_NAME='./configure_ubuntu_12.04.sh'
8 if [ "$0" != "$SCRIPT_NAME" ]; then
9 echo "Run the script from the hiphop-php directory like:"
10 echo " $SCRIPT_NAME"
11 exit 1
14 if [ "x${TRAVIS}" != "x" ]; then
15 # Collect some stats for use in tuning build later on
16 free
17 CPUS=`cat /proc/cpuinfo | grep -E '^processor' | tail -1 | cut -d : -f 2`
18 CPUS=`expr ${CPUS} + 1`
19 echo "CPUs: ${CPUS}"
22 export CMAKE_PREFIX_PATH=`/bin/pwd`/..
23 export HPHP_HOME=`/bin/pwd`
25 # install apt-fast to speedup later dependency installation
26 sudo add-apt-repository -y ppa:apt-fast/stable
27 sudo apt-get update
28 sudo apt-get install apt-fast
30 # install the actual dependencies
31 sudo apt-fast -y update
32 sudo apt-fast -y install git-core cmake g++ libboost1.48-dev libmysqlclient-dev \
33 libxml2-dev libmcrypt-dev libicu-dev openssl build-essential binutils-dev \
34 libcap-dev libgd2-xpm-dev zlib1g-dev libtbb-dev libonig-dev libpcre3-dev \
35 autoconf libtool libcurl4-openssl-dev libboost-regex1.48-dev libboost-system1.48-dev \
36 libboost-program-options1.48-dev libboost-filesystem1.48-dev wget memcached \
37 libreadline-dev libncurses-dev libmemcached-dev libbz2-dev \
38 libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev \
39 libcloog-ppl0 libelf-dev libdwarf-dev libunwind7-dev subversion \
40 python-software-properties &
42 git clone git://github.com/libevent/libevent.git --quiet &
43 git clone git://github.com/bagder/curl.git --quiet &
44 svn checkout http://google-glog.googlecode.com/svn/trunk/ google-glog --quiet &
45 wget http://www.canonware.com/download/jemalloc/jemalloc-3.0.0.tar.bz2 --quiet &
47 # wait until all background processes finished
48 FAIL=0
50 for job in `jobs -p`
52 echo "waiting for background job $job"
53 wait $job || let "FAIL+=1"
54 done
56 if [ "$FAIL" == "0" ];
57 then
58 echo "all downloads finished"
59 else
60 echo "$FAIL errors while downloading!"
61 exit 100
62 fi
64 # Leave this install till after the main parallel package install above
65 # since it adds a non-12.04 package repo and we don't want to
66 # pull EVERYTHING in, just the newer gcc compiler (and toolchain)
67 GCC_VER=4.7
68 if [ "x${TRAVIS}" != "x" ]; then
69 GCC_VER=4.8
71 sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
72 sudo apt-get -y update
73 sudo apt-get -y install gcc-${GCC_VER} g++-${GCC_VER}
74 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VER} 60 \
75 --slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_VER}
76 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 40 \
77 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
78 sudo update-alternatives --set gcc /usr/bin/gcc-${GCC_VER}
80 # libevent
81 cd libevent
82 git checkout release-1.4.14b-stable
83 cat ../hphp/third_party/libevent-1.4.14.fb-changes.diff | patch -p1
84 ./autogen.sh
85 ./configure --prefix=$CMAKE_PREFIX_PATH
86 make
87 make install
88 cd ..
90 # curl
91 cd curl
92 ./buildconf
93 ./configure --prefix=$CMAKE_PREFIX_PATH
94 make
95 make install
96 cd ..
98 # glog
99 cd google-glog
100 ./configure --prefix=$CMAKE_PREFIX_PATH
101 make
102 make install
103 cd ..
105 # jemaloc
106 tar xjvf jemalloc-3.0.0.tar.bz2
107 cd jemalloc-3.0.0
108 ./configure --prefix=$CMAKE_PREFIX_PATH
109 make
110 make install
111 cd ..
113 # cleanup
114 rm -rf libevent curl google-glog jemalloc-3.0.0.tar.bz2 jemalloc-3.0.0
116 # hphp
117 cmake .
119 echo "-------------------------------------------------------------------------"
120 echo "Done. Now run:"
121 echo " CMAKE_PREFIX_PATH=\`pwd\`/.. HPHP_HOME=\`pwd\` make"