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

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