deploy.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. # Some useful environment variables
  3. RUNTIME_LINK="http://portablecl.org/downloads/pocl-0.14.tar.gz"
  4. BENCHMARK_REPO="http://gogs.heisenberg.ovh/andreagus/rodinia-benchmark.git"
  5. POWER_REPO="https://andreagus@bitbucket.org/zanella_michele/odroid_smartpower_bridge.git"
  6. BASE_DIR=`pwd`
  7. # Install all the dependencies needed for compiling the runtime
  8. sudo apt-get update && sudo apt-get upgrade -y
  9. sudo apt-get install -y vim build-essential flex bison libtool libncurses5* git-core htop cmake libhwloc-dev libclang-3.8-dev clang-3.8 and llvm-3.8-dev zlib1g ocl-icd-libopencl1 clinfo libglew-dev time gnuplot clinfo ocl-icd-dev ocl-icd-opencl-dev qt4-qmake libqt4-dev libusb-1.0-0-dev
  10. # Create the needed folders
  11. if [ ! -d "runtime" ]; then
  12. mkdir runtime
  13. wget -qO- $RUNTIME_LINK | tar xzvf - -C runtime/
  14. fi
  15. if [ ! -d "rodinia-benchmark" ]; then
  16. git clone $BENCHMARK_REPO
  17. fi
  18. RUNTIME_DIR=runtime/`ls runtime`
  19. BENCHMARK_DIR=benchmark/`ls benchmark`
  20. echo $RUNTIME_DIR
  21. echo $BENCHMARK_DIR
  22. if [ ! -d "$RUNTIME_DIR/build" ]; then
  23. mkdir $RUNTIME_DIR/build
  24. fi
  25. # Compile the runtime
  26. cd $RUNTIME_DIR/build
  27. make clean
  28. cmake -DLLC_HOST_CPU=cortex-a15 ../
  29. make clean
  30. make -j8
  31. # Add the .icd file that enable the ocl-icd loader to identify the mali platform
  32. echo "/usr/lib/arm-linux-gnueabihf/mali-egl/libOpenCL.so" | sudo tee /etc/OpenCL/vendors/mali.icd
  33. # Add an udev rule that allows to communicate with the power measurement device even if the user is not root
  34. cd $BASE_DIR
  35. sudo cp libusb.rules /etc/udev/rules.d/99-hiid.rules
  36. # Clone the repo containg the power measurement tool
  37. if [ ! -d "odroid_smartpower_bridge" ]; then
  38. git clone $POWER_REPO
  39. fi