Эх сурвалжийг харах

SCRIPTS: Refactored deploy procedure

Now the deploy procedure is refactored in multiple scripts, each one
invoked by the Makefile. In this way we can as before deploy everything
by simply typing make, or instead get and compiled only the desiderated
part using the right target.
Andrea Gus 8 жил өмнө
parent
commit
69ef8607d4

+ 1 - 0
utils/.gitignore

@@ -0,0 +1 @@
+build/*

+ 15 - 4
utils/Makefile

@@ -1,7 +1,18 @@
-.PHONY: clean all 
+.PHONY: requirements runtime benchmark power_measurement
 
-all:
-	        ./deploy.sh
+all: requirements runtime benchmark power_measurement
+
+requirements:
+					./install-requirements.sh
+
+runtime:
+					./get-and-compile-runtime.sh
+
+benchmark:
+					./get-and-compile-benchmark.sh
+
+power_measurement:
+					./get-and-compile-power-utility.sh
 
 clean:
-	        rm -rf runtime rodinia-benchmark
+	        rm -rf build

+ 25 - 0
utils/get-and-compile-benchmark.sh

@@ -0,0 +1,25 @@
+# Some useful environment variables
+BENCHMARK_REPO="https://gogs.heisenberg.ovh/andreagus/rodinia-benchmark.git"
+BASE_DIR=`pwd`
+
+# Check if the build direcroty already exists, otherwise create it
+if [ ! -d "build" ]; then
+    mkdir build
+fi
+
+cd build
+
+# Create the needed folders
+if [ ! -d "rodinia-benchmark" ]; then
+    git clone $BENCHMARK_REPO
+fi
+
+cd rodinia-benchmark
+git checkout wip/platform-unification
+
+# Copy the script that time the benchmark in the benchmark directory
+cp $BASE_DIR/time-and-save.sh .
+
+# Compile the benchmarks
+make clean
+make OPENCL -j8

+ 41 - 0
utils/get-and-compile-power-utility.sh

@@ -0,0 +1,41 @@
+# Some useful environment variables
+POWER_REPO="https://andreagus@bitbucket.org/zanella_michele/odroid_smartpower_bridge.git"
+BASE_DIR=`pwd`
+
+# Check if the build direcroty already exists, otherwise create it
+if [ ! -d "build" ]; then
+    mkdir build
+fi
+
+cd build
+
+# Clone the repo containg the power measurement tool
+if [ ! -d "odroid_smartpower_bridge" ]; then
+    git clone $POWER_REPO
+fi
+
+cd odroid_smartpower_bridge
+
+# Checkout on the branch where we disabled all qt dependencies as possible (to cluttering the board with the entire KDE platform)
+git checkout no_qt
+
+# Compile the support library for ARM (the software comes with the library compiled for x86, so when linking we get some errors)
+cd HIDAPI
+qmake
+make clean
+make
+
+# Now compile the power measurement utility
+cd ../
+cd smartpower
+qmake
+make clean
+make
+
+# Copy the obtained executable at the top level and in the folder containing the benchmarks
+cp linux/SmartPower $BASE_DIR/build
+cp linux/SmartPower $BASE_DIR/build/rodinia-benchmark/
+
+# Add an udev rule that allows to communicate with the power measurement device even if the user is not root
+cd $BASE_DIR
+sudo cp libusb.rules /etc/udev/rules.d/99-hiid.rules

+ 33 - 0
utils/get-and-compile-runtime.sh

@@ -0,0 +1,33 @@
+# Some useful environment variables
+RUNTIME_LINK="http://portablecl.org/downloads/pocl-0.14.tar.gz"
+BASE_DIR=`pwd`
+
+# Check if the build direcroty already exists, otherwise create it
+if [ ! -d "build" ]; then
+    mkdir build
+fi
+
+cd build
+
+# Create the needed folders
+if [ ! -d "runtime" ]; then
+    mkdir runtime
+    wget -qO- $RUNTIME_LINK | tar xzvf - -C runtime/
+fi
+
+RUNTIME_DIR=runtime/`ls runtime`
+
+if [ ! -d "$RUNTIME_DIR/build" ]; then
+    mkdir $RUNTIME_DIR/build
+fi
+
+# Compile the runtime
+cd $RUNTIME_DIR/build
+make clean
+cmake -DLLC_HOST_CPU=cortex-a15 ../
+make clean
+make -j8
+#sudo make install
+
+# Add the .icd file that enable the ocl-icd loader to identify the mali platform
+echo "/usr/lib/arm-linux-gnueabihf/mali-egl/libOpenCL.so" | sudo tee /etc/OpenCL/vendors/mali.icd

+ 3 - 0
utils/install-requirements.sh

@@ -0,0 +1,3 @@
+# Install all the dependencies needed for compiling the runtime
+sudo apt-get update && sudo apt-get upgrade -y
+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