Просмотр исходного кода

Worked through C++/C and a PHP

msmith-techempower 10 лет назад
Родитель
Сommit
0abd0a3549
42 измененных файлов с 344 добавлено и 216 удалено
  1. 1 1
      frameworks/C++/ULib/benchmark_config.json
  2. 2 6
      frameworks/C++/ULib/setup.sh
  3. 2 6
      frameworks/C++/ULib/setup_mysql.sh
  4. 2 2
      frameworks/C++/ULib/setup_postgres.sh
  5. 2 6
      frameworks/C++/ULib/setup_sqlite.sh
  6. 0 21
      frameworks/C++/cpoll_cppsp/install.sh
  7. 2 3
      frameworks/C++/cpoll_cppsp/setup.sh
  8. 8 0
      frameworks/C++/silicon/setup_epoll_mysql.sh
  9. 8 0
      frameworks/C++/silicon/setup_tpc_mysql.sh
  10. 0 3
      frameworks/C++/treefrog/install.sh
  11. 2 0
      frameworks/C++/treefrog/setup-thread.sh
  12. 2 0
      frameworks/C++/treefrog/setup.sh
  13. 0 13
      frameworks/C++/wt/install.sh
  14. 1 10
      frameworks/C++/wt/setup.sh
  15. 1 10
      frameworks/C++/wt/setup_postgres.sh
  16. 0 15
      frameworks/C/duda/install.sh
  17. 1 2
      frameworks/C/duda/setup.sh
  18. 0 5
      frameworks/C/haywire/install.sh
  19. 3 1
      frameworks/C/haywire/setup.sh
  20. 0 20
      frameworks/C/lwan/install.sh
  21. 1 6
      frameworks/C/lwan/setup-mysql.sh
  22. 1 6
      frameworks/C/lwan/setup.sh
  23. 0 3
      frameworks/C/onion/install.sh
  24. 2 2
      frameworks/C/onion/setup.sh
  25. 0 3
      frameworks/PHP/php-phalcon/install.sh
  26. 4 7
      frameworks/PHP/php-phalcon/setup.sh
  27. 1 1
      toolset/benchmark/framework_test.py
  28. 25 9
      toolset/setup/linux/frameworks/cphalcon.sh
  29. 26 0
      toolset/setup/linux/frameworks/cppsp.sh
  30. 14 7
      toolset/setup/linux/frameworks/duda.sh
  31. 16 0
      toolset/setup/linux/frameworks/haywire.sh
  32. 25 0
      toolset/setup/linux/frameworks/lwan.sh
  33. 10 3
      toolset/setup/linux/frameworks/onion.sh
  34. 17 0
      toolset/setup/linux/frameworks/silicon.sh
  35. 6 2
      toolset/setup/linux/frameworks/treefrog.sh
  36. 100 0
      toolset/setup/linux/frameworks/ulib.sh
  37. 25 4
      toolset/setup/linux/frameworks/wt.sh
  38. 0 20
      toolset/setup/linux/languages/cphalcon.sh
  39. 6 16
      toolset/setup/linux/languages/php.sh
  40. 2 1
      toolset/setup/linux/prerequisites.sh
  41. 20 0
      toolset/setup/linux/webservers/microhttpd.sh
  42. 6 2
      toolset/setup/linux/webservers/nginx.sh

+ 1 - 1
frameworks/C++/ULib/benchmark_config.json

@@ -1,5 +1,5 @@
 {
-  "framework": "ULib",
+  "framework": "ulib",
   "tests": [{
     "default": {
       "setup_file": "setup",

+ 2 - 6
frameworks/C++/ULib/setup.sh

@@ -1,13 +1,9 @@
 #!/bin/bash
 
-export ULIB_VERSION=1.4.2
-export ULIB_ROOT=$IROOT/ULib
-export ULIB_DOCUMENT_ROOT=${ULIB_ROOT}/ULIB_DOCUMENT_ROOT
-
-export UMEMPOOL="136,0,0,85,1160,155,-17,-22,40"
+fw_depends ulib
 
 # 1. Change ULib Server configuration
 sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD ${MAX_THREADS}|g" ${IROOT}/ULib/benchmark.cfg
 
 # 2. Start ULib Server (userver_tcp)
-${IROOT}/ULib/bin/userver_tcp -c ${IROOT}/ULib/benchmark.cfg &
+userver_tcp -c ${IROOT}/ULib/benchmark.cfg &

+ 2 - 6
frameworks/C++/ULib/setup_mysql.sh

@@ -1,16 +1,12 @@
 #!/bin/bash
 
-export ULIB_VERSION=1.4.2
-export ULIB_ROOT=$IROOT/ULib
-export ULIB_DOCUMENT_ROOT=${ULIB_ROOT}/ULIB_DOCUMENT_ROOT
-
 export ORM_DRIVER="mysql"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=hello_world"
 
-export UMEMPOOL="136,0,0,85,1160,155,-17,-22,40"
+fw_depends ulib
 
 # 1. Change ULib Server configuration
 sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD ${MAX_THREADS}|g" $IROOT/ULib/benchmark.cfg
 
 # 2. Start ULib Server (userver_tcp)
-$IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg &
+userver_tcp -c $IROOT/ULib/benchmark.cfg &

+ 2 - 2
frameworks/C++/ULib/setup_postgres.sh

@@ -3,10 +3,10 @@
 export ORM_DRIVER="pgsql"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world client_encoding=UTF8"
 
-export UMEMPOOL="136,0,0,85,1160,155,-17,-22,40"
+fw_depends ulib
 
 # 1. Change ULib Server configuration
 sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD ${MAX_THREADS}|g" $IROOT/ULib/benchmark.cfg
 
 # 2. Start ULib Server (userver_tcp)
-$IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg &
+userver_tcp -c $IROOT/ULib/benchmark.cfg &

+ 2 - 6
frameworks/C++/ULib/setup_sqlite.sh

@@ -1,16 +1,12 @@
 #!/bin/bash
 
-export ULIB_VERSION=1.4.2
-export ULIB_ROOT=$IROOT/ULib
-export ULIB_DOCUMENT_ROOT=${ULIB_ROOT}/ULIB_DOCUMENT_ROOT
-
 export ORM_DRIVER="sqlite"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=${ULIB_ROOT}/db/%.*s"
 
-export UMEMPOOL="136,0,0,85,1160,155,-17,-22,40"
+fw_depends ulib
 
 # 1. Change ULib Server configuration
 sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD ${MAX_THREADS}|g" ${IROOT}/ULib/benchmark.cfg
 
 # 2. Start ULib Server (userver_tcp)
-${IROOT}/ULib/bin/userver_tcp -c ${IROOT}/ULib/benchmark.cfg &
+userver_tcp -c ${IROOT}/ULib/benchmark.cfg &

+ 0 - 21
frameworks/C++/cpoll_cppsp/install.sh

@@ -1,21 +0,0 @@
-#!/bin/bash
-
-RETCODE=$(fw_exists ${IROOT}/cppsp.installed)
-[ ! "$RETCODE" == 0 ] || { return 0; }
-
-sudo apt-get install -y postgresql-server-dev-9.3 libpq-dev
-
-fw_get -O cppsp_0.2.3.tar.xz http://downloads.sourceforge.net/project/cpollcppsp/CPPSP%200.2%20%28testing%29/cppsp_0.2.3.tar.xz
-fw_untar cppsp_0.2.3.tar.xz
-
-# Using cp+rm over mv intentionally, because apparently this download
-# causes oddball issues when mv'ed around inside a folder mounted 
-# inside of VirtualBox (may have something to do with case-sensitive 
-# filesystems)
-cp -R cppsp_rel0.2.3/ ${IROOT}/cppsp_0.2.3
-rm -rf cppsp_rel0.2.3/
-
-sed -i 's|CXX := .*|CXX := g++-4.8|g' ${IROOT}/cppsp_0.2.3/makefile
-sed -i 's|-Wall|-w|g' ${IROOT}/cppsp_0.2.3/makefile
-
-touch ${IROOT}/cppsp.installed

+ 2 - 3
frameworks/C++/cpoll_cppsp/setup.sh

@@ -1,11 +1,10 @@
 #!/bin/bash
-export CPPSP_HOME=$IROOT/cppsp_0.2.3
 
 sed -i 's|#define BENCHMARK_DB_HOST ".*"|#define BENCHMARK_DB_HOST "'"$DBHOST"'"|g' www/connectioninfo.H
 
-export CPLUS_INCLUDE_PATH=/usr/include/postgresql:/usr/include/postgresql/9.3/server:$CPLUS_INCLUDE_PATH
+fw_depends cppsp
 
 make clean
 make
 cd $CPPSP_HOME
-./run_application $TROOT/www -g g++-4.8 -m /forcedynamic.cppsm &
+./run_application $TROOT/www -g g++-4.8 -m /forcedynamic.cppsm &

+ 8 - 0
frameworks/C++/silicon/setup_epoll_mysql.sh

@@ -1,3 +1,11 @@
 #! /bin/bash
 
+fw_depends silicon microhttpd
+
+rm -rf build
+mkdir build
+cd build
+cmake .. -DCMAKE_CXX_COMPILER=g++-4.9
+make silicon_epoll_mysql
+
 $TROOT/build/silicon_epoll_mysql ${DBHOST} 8080 &

+ 8 - 0
frameworks/C++/silicon/setup_tpc_mysql.sh

@@ -1,3 +1,11 @@
 #! /bin/bash
 
+fw_depends silicon microhttpd
+
+rm -rf build
+mkdir build
+cd build
+cmake .. -DCMAKE_CXX_COMPILER=g++-4.9
+make silicon_tpc_mysql
+
 $TROOT/build/silicon_tpc_mysql ${DBHOST} 8080 &

+ 0 - 3
frameworks/C++/treefrog/install.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-fw_depends treefrog

+ 2 - 0
frameworks/C++/treefrog/setup-thread.sh

@@ -3,6 +3,8 @@
 sed -i 's|HostName=.*|HostName='"$DBHOST"'|g' config/database.ini
 sed -i "s|MultiProcessingModule=.*|MultiProcessingModule=thread|g" config/application.ini
 
+fw_depends treefrog
+
 # 1. Generate Makefile
 qmake -r CONFIG+=release
 

+ 2 - 0
frameworks/C++/treefrog/setup.sh

@@ -3,6 +3,8 @@
 sed -i 's|HostName=.*|HostName='"$DBHOST"'|g' config/database.ini
 sed -i "s|MultiProcessingModule=.*|MultiProcessingModule=hybrid|g" config/application.ini
 
+fw_depends treefrog
+
 # 1. Generate Makefile
 qmake -r CONFIG+=release
 

+ 0 - 13
frameworks/C++/wt/install.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-export BOOST_ROOT=/usr/local
-export BOOST_INC=${BOOST_ROOT}/include
-export BOOST_LIB=${BOOST_ROOT}/lib
-
-export WT_ROOT=${IROOT}/wt
-export WT_LIB=${WT_ROOT}/lib
-export WT_INC=${WT_ROOT}/include
-
-export LD_LIBRARY_PATH="${BOOST_LIB}:${WT_LIB}:${LD_LIBRARY_PATH}"
-
-fw_depends apache wt

+ 1 - 10
frameworks/C++/wt/setup.sh

@@ -1,15 +1,6 @@
 #!/bin/bash
-export BOOST_ROOT=/usr/local
-export BOOST_INC=${BOOST_ROOT}/include
-export BOOST_LIB=${BOOST_ROOT}/lib
 
-export WT_ROOT=${IROOT}/wt
-export WT_LIB=${WT_ROOT}/lib
-export WT_INC=${WT_ROOT}/include
-
-# This has to be included here since it is one of the vars NOT copied from the original environment
-export LD_LIBRARY_PATH="${BOOST_LIB}:${WT_LIB}:${LD_LIBRARY_PATH}"
-export CPLUS_INCLUDE_PATH=/usr/include/postgresql:/usr/include/postgresql/9.3/server:$CPLUS_INCLUDE_PATH
+fw_depends apache wt
 
 sed -i 's|INSERT_DB_HOST_HERE|'"${DBHOST}"'|g' benchmark.cpp
 

+ 1 - 10
frameworks/C++/wt/setup_postgres.sh

@@ -1,15 +1,6 @@
 #!/bin/bash
-export BOOST_ROOT=/usr/local
-export BOOST_INC=${BOOST_ROOT}/include
-export BOOST_LIB=${BOOST_ROOT}/lib
 
-export WT_ROOT=${IROOT}/wt
-export WT_LIB=${WT_ROOT}/lib
-export WT_INC=${WT_ROOT}/include
-
-# This has to be included here since it is one of the vars NOT copied from the original environment
-export LD_LIBRARY_PATH="${BOOST_LIB}:${WT_LIB}:${LD_LIBRARY_PATH}"
-export CPLUS_INCLUDE_PATH=/usr/include/postgresql:/usr/include/postgresql/9.3/server:$CPLUS_INCLUDE_PATH
+fw_depends apache wt
 
 sed -i 's|INSERT_DB_HOST_HERE|'"${DBHOST}"'|g' benchmark.cpp
 

+ 0 - 15
frameworks/C/duda/install.sh

@@ -1,15 +0,0 @@
-#!/bin/bash
-
-RETCODE=$(fw_exists ${IROOT}/duda-0.23.installed)
-[ ! "$RETCODE" == 0 ] || { return 0; }
-
-fw_get http://duda.io/releases/duda-client/dudac-0.23.tar.gz -O dudac-0.23.tar.gz
-fw_untar dudac-0.23.tar.gz
-
-cd dudac-0.23
-
-./dudac -r
-./dudac -s
-
-cd ..
-touch ${IROOT}/duda-0.23.installed

+ 1 - 2
frameworks/C/duda/setup.sh

@@ -1,6 +1,5 @@
 #!/bin/bash
 
-export DUDA_HOME=${IROOT}/dudac-0.23
-export PATH=${DUDA_HOME}:$PATH
+fw_depends duda
 
 dudac -w $TROOT/webservice -p 2001 &

+ 0 - 5
frameworks/C/haywire/install.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
- 
-git clone https://github.com/kellabyte/Haywire.git
-cd $IROOT/Haywire
-./build.sh -c release

+ 3 - 1
frameworks/C/haywire/setup.sh

@@ -1,3 +1,5 @@
 #!/bin/bash
 
-$IROOT/Haywire/builds/unix/release/techempower_benchmark &
+fw_depends haywire
+
+techempower_benchmark &

+ 0 - 20
frameworks/C/lwan/install.sh

@@ -1,20 +0,0 @@
-#!/bin/bash
-
-REV='49607addb31879e2aa2b701317773674662315aa'
-
-INSTALLED_FILE="${IROOT}/lwan-${REV}.installed"
-RETCODE=$(fw_exists ${INSTALLED_FILE})
-[ ! "$RETCODE" == 0 ] || { return 0; }
-
-[ ! -e ${INSTALLED_FILE} -a -d ${IROOT}/lwan ] && rm -rf ${IROOT}/lwan
-
-# Lwan is only built during installation as a dependency sanity check.
-git clone git://github.com/lpereira/lwan.git
-cd lwan
-git checkout ${REV}
-mkdir build
-cd build
-cmake .. -DCMAKE_BUILD_TYPE=Release
-make techempower
-
-touch ${INSTALLED_FILE}

+ 1 - 6
frameworks/C/lwan/setup-mysql.sh

@@ -6,12 +6,7 @@ export MYSQL_PASS=benchmarkdbpass
 export MYSQL_HOST=$DBHOST
 export MYSQL_DB=hello_world
 
-export LWAN_ROOT=${IROOT}/lwan
-export LWAN_BUILD=${LWAN_ROOT}/build
+fw_depends lwan
 
-rm -rf ${LWAN_BUILD}
-mkdir -p ${LWAN_BUILD}
-cd ${LWAN_BUILD}
-cmake ${LWAN_ROOT} -DCMAKE_BUILD_TYPE=Release && make techempower
 cd $LWAN_ROOT/techempower
 $LWAN_BUILD/techempower/techempower &

+ 1 - 6
frameworks/C/lwan/setup.sh

@@ -1,11 +1,6 @@
 #!/bin/bash
 
-export LWAN_ROOT=${IROOT}/lwan
-export LWAN_BUILD=${LWAN_ROOT}/build
+fw_depends lwan
 
-rm -rf ${LWAN_BUILD}
-mkdir -p ${LWAN_BUILD}
-cd ${LWAN_BUILD}
-cmake ${LWAN_ROOT} -DCMAKE_BUILD_TYPE=Release && make techempower
 cd $LWAN_ROOT/techempower
 $LWAN_BUILD/techempower/techempower &

+ 0 - 3
frameworks/C/onion/install.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-fw_depends onion
-

+ 2 - 2
frameworks/C/onion/setup.sh

@@ -1,9 +1,9 @@
 #!/bin/bash
 
-export ONION_LOG=noinfo
+fw_depends onion
 
 make clean
 ln -s $IROOT/onion onion
 rm -f onion/build/CMakeCache.txt
 make
-./hello &
+./hello &

+ 0 - 3
frameworks/PHP/php-phalcon/install.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-fw_depends php cphalcon nginx

+ 4 - 7
frameworks/PHP/php-phalcon/setup.sh

@@ -1,14 +1,11 @@
 #!/bin/bash
-export PHP_HOME=${IROOT}/php-5.5.17
-export PHP_FPM=$PHP_HOME/sbin/php-fpm
-export NGINX_HOME=${IROOT}/nginx
+
+fw_depends php cphalcon nginx
 
 sed -i 's|mongodb://localhost|mongodb://'"${DBHOST}"'|g' app/config/config.php
 sed -i 's|localhost|'"${DBHOST}"'|g' app/config/config.php
 sed -i 's|root .*/FrameworkBenchmarks/php-phalcon|root '"${TROOT}"'|g' deploy/nginx.conf
 sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' deploy/nginx.conf
 
-export PATH="$PHP_HOME/bin:$PHP_HOME/sbin:$PATH"
-
-$PHP_FPM --fpm-config $FWROOT/config/php-fpm.conf -g $TROOT/deploy/php-fpm.pid
-$NGINX_HOME/sbin/nginx -c $TROOT/deploy/nginx.conf
+php-fpm --fpm-config $FWROOT/config/php-fpm.conf -g $TROOT/deploy/php-fpm.pid
+nginx -c $TROOT/deploy/nginx.conf

+ 1 - 1
toolset/benchmark/framework_test.py

@@ -259,7 +259,7 @@ class FrameworkTest:
       "%s: %s.sh and framework processes have terminated" % (self.name, self.setup_file))
 
     # Set a limit on total execution time of setup.sh
-    timeout = datetime.now() + timedelta(minutes = 20)
+    timeout = datetime.now() + timedelta(minutes = 30)
     time_remaining = timeout - datetime.now()
 
     # Need to print to stdout once every 10 minutes or Travis-CI will abort

+ 25 - 9
toolset/setup/linux/frameworks/cphalcon.sh

@@ -1,12 +1,28 @@
+#!/bin/bash
+
+CPHALCON=$IROOT/cphalcon
+RETCODE=$(fw_exists ${CPHALCON}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  # Load environment variables
+  source $CPHALCON.installed
+  return 0; }
+
+fw_depends php
+
 # phalcon.so
 #   The configure seems broken, does not respect prefix. If you 
 #   update the value of PATH then it finds the prefix from `which php`
-export PATH=$IROOT/php-5.5.17/bin:$IROOT/php-5.5.17/sbin:$PATH
-git clone git://github.com/phalcon/cphalcon.git
-cd cphalcon
-git checkout phalcon-v1.3.2
-cd build/64bits 
-$IROOT/php-5.5.17/bin/phpize
-./configure --prefix=$IROOT/php-5.5.17 --enable-phalcon
-make
-make install
+git clone --depth=1 --branch=phalcon-v1.3.2 --single-branch \
+  --quiet git://github.com/phalcon/cphalcon.git
+cd cphalcon/build/64bits 
+phpize
+# For some reason we have to point to php-config 
+# explicitly, it's not found by the prefix settings
+./configure --prefix=$PHP_HOME --exec-prefix=$PHP_HOME \
+  --with-php-config=$PHP_HOME/bin/php-config \
+  --enable-phalcon --quiet
+make --quiet
+make install
+
+# No variables to set with this framework.
+touch $CPHALCON.installed

+ 26 - 0
toolset/setup/linux/frameworks/cppsp.sh

@@ -0,0 +1,26 @@
+#!/bin/bash
+
+VERSION=0.2.3
+CPPSP_HOME=$IROOT/cppsp_$VERSION
+RETCODE=$(fw_exists ${IROOT}/cppsp.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $IROOT/cppsp.installed
+  return 0; }
+
+fw_get -O cppsp_$VERSION.tar.xz http://downloads.sourceforge.net/project/cpollcppsp/CPPSP%200.2%20%28testing%29/cppsp_$VERSION.tar.xz
+fw_untar cppsp_$VERSION.tar.xz
+
+# Using cp+rm over mv intentionally, because apparently this download
+# causes oddball issues when mv'ed around inside a folder mounted 
+# inside of VirtualBox (may have something to do with case-sensitive 
+# filesystems)
+cp -R cppsp_rel$VERSION/ $CPPSP_HOME
+rm -rf cppsp_rel$VERSION/
+
+sed -i 's|CXX := .*|CXX := g++-4.8|g' $CPPSP_HOME/makefile
+sed -i 's|-Wall|-w|g' $CPPSP_HOME/makefile
+
+echo "export CPPSP_HOME=${CPPSP_HOME}" > $IROOT/cppsp.installed
+echo "export CPLUS_INCLUDE_PATH=/usr/include/postgresql:/usr/include/postgresql/9.3/server:$CPLUS_INCLUDE_PATH" >> $IROOT/cppsp.installed
+
+source $IROOT/cppsp.installed

+ 14 - 7
toolset/setup/linux/frameworks/duda.sh

@@ -1,15 +1,22 @@
 #!/bin/bash
 
-RETCODE=$(fw_exists duda-0.23.installed)
-[ ! "$RETCODE" == 0 ] || { return 0; }
+VERSION=0.23
+DUDA=$IROOT/duda-$VERSION
+RETCODE=$(fw_exists ${DUDA}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $DUDA.installed
+  return 0; }
 
-fw_get http://duda.io/releases/duda-client/dudac-0.23.tar.gz -O dudac-0.23.tar.gz
-fw_untar dudac-0.23.tar.gz
+fw_get http://duda.io/releases/duda-client/dudac-$VERSION.tar.gz -O dudac-$VERSION.tar.gz
+fw_untar dudac-$VERSION.tar.gz
 
-cd dudac-0.23
+DUDA_HOME=$IROOT/dudac-$VERSION
+cd $DUDA_HOME
 
 ./dudac -r
 ./dudac -s
 
-cd ..
-touch duda-0.23.installed
+echo "export DUDA_HOME=${DUDA_HOME}" > $DUDA.installed
+echo "export PATH=${DUDA_HOME}:$PATH" >> $DUDA.installed
+
+source $DUDA.installed

+ 16 - 0
toolset/setup/linux/frameworks/haywire.sh

@@ -0,0 +1,16 @@
+#!/bin/bash
+
+HAYWIRE_HOME=$IROOT/Haywire
+RETCODE=$(fw_exists ${HAYWIRE_HOME}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  # Load environment variables
+  source $HAYWIRE_HOME.installed
+  return 0; }
+ 
+git clone https://github.com/kellabyte/Haywire.git
+cd $HAYWIRE_HOME
+./build.sh -c release
+
+echo "export PATH=${HAYWIRE_HOME}/builds/unix/release/:$PATH" > $HAYWIRE_HOME.installed
+
+source $HAYWIRE_HOME.installed

+ 25 - 0
toolset/setup/linux/frameworks/lwan.sh

@@ -0,0 +1,25 @@
+#!/bin/bash
+
+REV='49607addb31879e2aa2b701317773674662315aa'
+
+LWAN_HOME=$IROOT/lwan
+RETCODE=$(fw_exists ${LWAN_HOME}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $LWAN_HOME.installed
+  return 0; }
+
+[ ! -e $LWAN_HOME.installed -a -d $LWAN_HOME ] && rm -rf $LWAN_HOME
+
+# Lwan is only built during installation as a dependency sanity check.
+git clone git://github.com/lpereira/lwan.git
+cd $LWAN_HOME
+git checkout ${REV}
+mkdir build
+cd build
+cmake .. -DCMAKE_BUILD_TYPE=Release
+make techempower
+
+echo "export LWAN_ROOT=${LWAN_HOME}" > $LWAN_HOME.installed
+echo "export LWAN_BUILD=${LWAN_HOME}/build" >> $LWAN_HOME.installed
+
+source $LWAN_HOME.installed

+ 10 - 3
toolset/setup/linux/frameworks/onion.sh

@@ -1,10 +1,13 @@
 #!/bin/bash
 
-RETCODE=$(fw_exists onion)
-[ ! "$RETCODE" == 0 ] || { return 0; }
+ONION=$IROOT/onion
+RETCODE=$(fw_exists ${ONION}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $ONION.installed
+  return 0; }
 
 git clone https://github.com/davidmoreno/onion.git
-cd onion
+cd $ONION
 
 # Latest commit on master as of July 10 2014
 # This is post tag v0.7, but pre any later tags
@@ -14,3 +17,7 @@ mkdir -p build
 cd build
 cmake ..
 make
+
+echo "export ONION_LOG=noinfo" > $ONION.installed
+
+source $ONION.installed

+ 17 - 0
toolset/setup/linux/frameworks/silicon.sh

@@ -0,0 +1,17 @@
+#!/bin/bash
+
+SILICON=$IROOT/silicon
+RETCODE=$(fw_exists ${SILICON}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  # Load environment variables
+  source $SILICON.installed
+  return 0; }
+
+git clone https://github.com/matt-42/silicon.git
+cd silicon;
+git checkout df56f30f8db8d3be8305f56e198818e83a14c985
+CXX=/usr/bin/g++-4.9 ./install.sh $IROOT
+
+echo "" > $SILICON.installed
+
+source $SILICON.installed

+ 6 - 2
toolset/setup/linux/frameworks/treefrog.sh

@@ -1,7 +1,9 @@
 #!/bin/bash
 
 RETCODE=$(fw_exists ${IROOT}/treefrog.installed)
-[ ! "$RETCODE" == 0 ] || { return 0; }
+[ ! "$RETCODE" == 0 ] || { \
+  source $IROOT/treefrog.installed
+  return 0; }
 
 sudo apt-get install -y qt4-qmake libqt4-dev libqt4-sql-mysql libqt4-sql-psql g++
 
@@ -20,4 +22,6 @@ cd ../tools
 make -j4
 sudo make install
 
-touch $IROOT/treefrog.installed
+echo "" > $IROOT/treefrog.installed
+
+source $IROOT/treefrog.installed

+ 100 - 0
toolset/setup/linux/frameworks/ulib.sh

@@ -0,0 +1,100 @@
+#!/bin/bash
+
+ULIB_VERSION=1.4.2
+ULIB_ROOT=$IROOT/ULib
+ULIB_DOCUMENT_ROOT=${ULIB_ROOT}/ULIB_DOCUMENT_ROOT
+
+# Check if ULib is already installed
+ULIB_INSTALLED_FILE="${IROOT}/ULib-${ULIB_VERSION}.installed"
+RETCODE=$(fw_exists ${ULIB_INSTALLED_FILE})
+[ ! "$RETCODE" == 0 ] || { \
+  source $ULIB_INSTALLED_FILE
+  return 0; }
+
+# Create a run directory for ULIB
+[ ! -e ${ULIB_INSTALLED_FILE} -a -d ${IROOT}/ULib ] && rm -rf ${IROOT}/ULib*
+
+if [ ! -d "$ULIB_ROOT" ]; then
+  mkdir -p $ULIB_ROOT
+fi
+
+# AVOID "fatal error: postgres_fe.h: No such file or directory"
+sudo apt-get install -y postgresql-server-dev-all
+
+# Add a simple configuration file to it
+cd $ULIB_ROOT
+if [ ! -f "benchmark.cfg" ]; then
+  cat <<EOF >benchmark.cfg
+userver {
+ PORT 8080
+ PREFORK_CHILD 4
+ MAX_KEEP_ALIVE 1023
+ LISTEN_BACKLOG 16384
+ CLIENT_FOR_PARALLELIZATION 256
+ ORM_DRIVER "mysql pgsql sqlite"
+ DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT
+}
+EOF
+fi
+
+# 1. Download ULib
+cd $IROOT
+fw_get -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz 
+fw_untar  ULib-${ULIB_VERSION}.tar.gz
+
+# 2. Compile application (userver_tcp)
+cd ULib-$ULIB_VERSION
+
+# Check for the compiler support (We want at least g++ 4.8)
+CC=gcc  # C   compiler command
+CXX=g++ # C++ compiler command
+
+gcc_version=`g++ -dumpversion`
+
+case "$gcc_version" in
+  3*|4.0*|4.1*|4.2*|4.3*|4.4*|4.5*|4.6*|4.7*)
+    CC='gcc-4.8'
+   CXX='g++-4.8'
+  ;;
+esac
+
+export CC CXX
+
+# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
+find . -exec touch {} \;
+
+USP_FLAGS="-DAS_cpoll_cppsp_DO" \
+./configure --prefix=$ULIB_ROOT \
+   --disable-static --disable-examples \
+   --with-mysql --with-pgsql --with-sqlite3 \
+   --without-ssl --without-pcre --without-expat \
+   --without-libz --without-libuuid --without-magic --without-libares \
+   --enable-static-orm-driver='mysql pgsql sqlite' --enable-static-server-plugin=http
+#  --enable-debug \
+#USP_LIBS="-ljson" \
+
+make install
+cp -r tests/examples/benchmark/FrameworkBenchmarks/ULib/db ${ULIB_ROOT}
+
+cd examples/userver
+make install
+
+# 3. Compile usp pages for benchmark
+cd ../../src/ulib/net/server/plugin/usp
+make db.la fortune.la json.la plaintext.la query.la update.la
+
+# Check that compilation worked
+if [ ! -e .libs/db.so ]; then
+   exit 1
+fi
+
+mkdir -p $ULIB_DOCUMENT_ROOT
+cp .libs/db.so .libs/fortune.so .libs/json.so .libs/plaintext.so .libs/query.so .libs/update.so $ULIB_DOCUMENT_ROOT
+
+echo 'export UMEMPOOL="136,0,0,85,1160,155,-17,-22,40"' > $ULIB_INSTALLED_FILE
+echo "export PATH=${ULIB_ROOT}/bin:$PATH" >> $ULIB_INSTALLED_FILE
+echo "export ULIB_VERSION=${ULIB_VERSION}" >> $ULIB_INSTALLED_FILE
+echo "export ULIB_ROOT=${ULIB_ROOT}" >> $ULIB_INSTALLED_FILE
+echo "export ULIB_DOCUMENT_ROOT=${ULIB_DOCUMENT_ROOT}" >> $ULIB_INSTALLED_FILE
+
+source $ULIB_INSTALLED_FILE

+ 25 - 4
toolset/setup/linux/frameworks/wt.sh

@@ -1,7 +1,18 @@
 #!/bin/bash
 
-RETCODE=$(fw_exists wt.installed)
-[ ! "$RETCODE" == 0 ] || { return 0; }
+BOOST_ROOT=/usr/local
+BOOST_INC=${BOOST_ROOT}/include
+BOOST_LIB=${BOOST_ROOT}/lib
+WT_ROOT=${IROOT}/wt
+WT_LIB=${WT_ROOT}/lib
+WT_INC=${WT_ROOT}/include
+LD_LIBRARY_PATH="${BOOST_LIB}:${WT_LIB}:${LD_LIBRARY_PATH}"
+CPLUS_INCLUDE_PATH=/usr/include/postgresql:/usr/include/postgresql/9.3/server:$CPLUS_INCLUDE_PATH
+
+RETCODE=$(fw_exists ${IROOT}/wt.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $IROOT/wt.installed
+  return 0; }
 
 # The commented code works. While we would love to get boost from source
 # so we know exactly what we are getting, it just takes too long. Also, 
@@ -39,5 +50,15 @@ cmake .. -DWT_CPP_11_MODE=-std=c++0x -DCMAKE_BUILD_TYPE=Release \
 make
 make install
 
-cd ..
-touch wt.installed
+cd $IROOT
+
+echo "export BOOST_ROOT=${BOOST_ROOT}" > $IROOT/wt.installed
+echo "export BOOST_INC=${BOOST_INC}" >> $IROOT/wt.installed
+echo "export BOOST_LIB=${BOOST_LIB}" >> $IROOT/wt.installed
+echo "export WT_ROOT=${WT_ROOT}" >> $IROOT/wt.installed
+echo "export WT_LIB=${WT_LIB}" >> $IROOT/wt.installed
+echo "export WT_INC=${WT_INC}" >> $IROOT/wt.installed
+echo 'export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}' >> $IROOT/wt.installed
+echo "export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}" >> $IROOT/wt.installed
+
+source $IROOT/wt.installed

+ 0 - 20
toolset/setup/linux/languages/cphalcon.sh

@@ -1,20 +0,0 @@
-#!/bin/bash
-
-# phalcon.so
-#   The configure seems broken, does not respect prefix. If you 
-#   update the value of PATH then it finds the prefix from `which php`
-
-RETCODE=$(fw_exists ${IROOT}/cphalcon.installed)
-[ ! "$RETCODE" == 0 ] || { return 0; }
-
-export PATH=$IROOT/php-5.5.17/bin:$IROOT/php-5.5.17/sbin:$PATH
-git clone git://github.com/phalcon/cphalcon.git
-cd cphalcon
-git checkout phalcon-v1.3.2
-cd build/64bits 
-$IROOT/php-5.5.17/bin/phpize
-./configure --prefix=$IROOT/php-5.5.17 --enable-phalcon
-make
-make install
-
-touch ${IROOT}/cphalcon.installed

+ 6 - 16
toolset/setup/linux/languages/php.sh

@@ -9,9 +9,11 @@ RETCODE=$(fw_exists ${IROOT}/php.installed)
   echo "Moving PHP config files into place"; 
   sudo cp $FWROOT/config/php.ini /usr/local/lib/php.ini
   sudo cp $FWROOT/config/php-fpm.conf /usr/local/lib/php-fpm.conf
+  source $IROOT/php.installed
   return 0; }
 
 VERSION="5.5.17"
+PHP_HOME=$IROOT/php-$VERSION
 
 fw_get http://php.net/distributions/php-${VERSION}.tar.gz -O php-${VERSION}.tar.gz
 fw_untar php-${VERSION}.tar.gz
@@ -49,22 +51,10 @@ printf "\n" | $IROOT/php-${VERSION}/bin/pecl -q install -f redis
 # yaf.so
 printf "\n" | $IROOT/php-${VERSION}/bin/pecl -q install -f yaf
 
-# phalcon.so
-#   The configure seems broken, does not respect prefix. If you 
-#   update the value of PATH then it finds the prefix from `which php`
-git clone --depth=1 --branch=phalcon-v1.3.2 --single-branch \
-  --quiet git://github.com/phalcon/cphalcon.git
-cd cphalcon/build/64bits 
-$IROOT/php-5.5.17/bin/phpize
-# For some reason we have to point to php-config 
-# explicitly, it's not found by the prefix settings
-./configure --prefix=$IROOT/php-${VERSION} --exec-prefix=$IROOT/php-${VERSION} \
-  --with-php-config=$IROOT/php-${VERSION}/bin/php-config \
-  --enable-phalcon --quiet
-make --quiet
-make install
-
 # Clean up a bit
 rm -rf $IROOT/php
 
-touch $IROOT/php.installed
+echo "export PHP_HOME=${IROOT}/php-5.5.17" > $IROOT/php.installed
+echo "export PATH=${PHP_HOME}/bin:$PHP_HOME/sbin:$PATH" >> $IROOT/php.installed
+
+source $IROOT/php.installed

+ 2 - 1
toolset/setup/linux/prerequisites.sh

@@ -44,7 +44,8 @@ sudo apt-get -qqy install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options:
   cloc dstat                        `# Collect resource usage statistics` \
   libsasl2-dev                      `# Needed by mgo for go-mongodb test` \
   llvm-dev                          `# Required for correct Ruby installation` \
-  libboost-dev                      `# Silicon relies on boost::lexical_cast.`
+  libboost-dev                      `# Silicon relies on boost::lexical_cast.` \
+  postgresql-server-dev-9.3         `# Needed by cpoll.`
 
 # Install gcc-4.8 and gcc-4.9
 sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y

+ 20 - 0
toolset/setup/linux/webservers/microhttpd.sh

@@ -0,0 +1,20 @@
+#!/bin/bash
+
+VERSION=0.9.39
+MICROHTTPD=$IROOT/libmicrohttpd
+MICROHTTPD_HOME=$MICROHTTPD-$VERSION
+RETCODE=$(fw_exists ${MICROHTTPD}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  # Load environment variables
+  source $MICROHTTPD.installed
+  return 0; }
+
+fw_get http://mirror.ibcp.fr/pub/gnu/libmicrohttpd/libmicrohttpd-$VERSION.tar.gz
+fw_untar libmicrohttpd-$VERSION.tar.gz
+cd libmicrohttpd-$VERSION
+./configure --prefix=$IROOT
+make install
+
+echo "" > $MICROHTTPD.installed
+
+source $MICROHTTPD.installed

+ 6 - 2
toolset/setup/linux/webservers/nginx.sh

@@ -1,7 +1,9 @@
 #!/bin/bash
 
 RETCODE=$(fw_exists ${IROOT}/nginx.installed)
-[ ! "$RETCODE" == 0 ] || { return 0; }
+[ ! "$RETCODE" == 0 ] || { \
+  source $IROOT/nginx.installed
+  return 0; }
 
 fw_get http://nginx.org/download/nginx-1.4.1.tar.gz
 fw_untar nginx-1.4.1.tar.gz
@@ -15,4 +17,6 @@ echo "Compiling and installing nginx..."
 make --quiet
 make --quiet install
 
-touch ${IROOT}/nginx.installed
+echo "export PATH=${IROOT}/nginx/sbin:${PATH}" > ${IROOT}/nginx.installed
+
+source $IROOT/nginx.installed