get-and-compile-power-utility.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Some useful environment variables
  2. POWER_REPO="https://andreagus@bitbucket.org/zanella_michele/odroid_smartpower_bridge.git"
  3. BASE_DIR=`pwd`
  4. # Output message for the user
  5. echo "We are retrieving, building and installing the pocl power measurement utility"
  6. sleep 10
  7. # Check if the build direcroty already exists, otherwise create it
  8. if [ ! -d "build" ]; then
  9. mkdir build
  10. fi
  11. cd build
  12. # Output message for the user
  13. echo "Please be aware that by default we are trying to clone the repository from my account of bitbucket, remember to replace the POWER_REPO variable in the script with the real reference from which you want to clone the repository"
  14. # Clone the repo containg the power measurement tool
  15. if [ ! -d "odroid_smartpower_bridge" ]; then
  16. git clone $POWER_REPO
  17. fi
  18. cd odroid_smartpower_bridge
  19. # Checkout on the branch where we disabled all qt dependencies as possible (to cluttering the board with the entire KDE platform)
  20. git checkout no_qt
  21. # Compile the support library for ARM (the software comes with the library compiled for x86, so when linking we get some errors)
  22. cd HIDAPI
  23. qmake
  24. make clean
  25. make
  26. # Now compile the power measurement utility
  27. cd ../
  28. cd smartpower
  29. qmake
  30. make clean
  31. make
  32. # Copy the obtained executable at the top level and in the folder containing the benchmarks
  33. cp linux/SmartPower $BASE_DIR/build
  34. cp linux/SmartPower $BASE_DIR/build/rodinia-benchmark/
  35. # Add an udev rule that allows to communicate with the power measurement device even if the user is not root
  36. cd $BASE_DIR
  37. sudo cp deploy/libusb.rules /etc/udev/rules.d/99-hiid.rules