prerequisites.sh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. set -x
  3. export DEBIAN_FRONTEND=noninteractive
  4. # One -q produces output suitable for logging (mostly hides
  5. # progress indicators)
  6. sudo apt-get -yq update
  7. # WARNING: DONT PUT A SPACE AFTER ANY BACKSLASH OR APT WILL BREAK
  8. sudo apt-get -qqy install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
  9. cmake build-essential automake `# Needed for building code` \
  10. curl wget unzip `# Common tools` \
  11. software-properties-common `# Needed for add-apt-repository` \
  12. git-core mercurial `# Version control systems` \
  13. libpcre3 libpcre3-dev libpcrecpp0 `# Regular expression support` \
  14. libssl-dev libcurl4-openssl-dev `# SSL libraries` \
  15. libmysqlclient-dev \
  16. zlib1g-dev python-software-properties \
  17. libreadline6-dev \
  18. libbz2-dev \
  19. libyaml-dev libxml2-dev \
  20. libxslt-dev libgdbm-dev ncurses-dev \
  21. libffi-dev htop libtool bison libevent-dev \
  22. libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
  23. liborc-0.4-0 libwxbase2.8-0 libwxgtk2.8-0 libgnutls-dev \
  24. libjson0-dev libmcrypt-dev libicu-dev gettext \
  25. libpq-dev mlton \
  26. cloc dstat `# Collect resource usage statistics` \
  27. python-dev \
  28. python-pip re2c libnuma-dev
  29. sudo pip install colorama==0.3.1
  30. # Version 2.3 has a nice Counter() and other features
  31. # but it requires --allow-external and --allow-unverified
  32. sudo pip install progressbar==2.2
  33. sudo pip install requests
  34. # Get the ulimit from the benchmark config
  35. if [ -f benchmark.cfg ]; then
  36. FILE=benchmark.cfg
  37. else
  38. FILE=benchmark.cfg.example
  39. fi
  40. ULIMIT=$(grep '^ulimit=' $FILE | grep -Po '[0-9]+')
  41. if [ ! $ULIMIT ]; then ULIMIT=200000; fi;
  42. sudo sh -c "echo '* - nofile ${ULIMIT}' >> /etc/security/limits.conf"
  43. sudo sh -c "echo '* hard rtprio 99' >> /etc/security/limits.conf"
  44. sudo sh -c "echo '* soft rtprio 99' >> /etc/security/limits.conf"
  45. # Create a tfb command alias for running the toolset
  46. # For now, this still ensures you have to be in the framework root to run it
  47. sudo tee /etc/profile.d/tfb.sh <<EOF
  48. #!/bin/bash
  49. tfb() {
  50. $(pwd)/toolset/run-tests.py "\$@"
  51. }
  52. EOF
  53. source /etc/profile.d/tfb.sh