get-and-compile-runtime.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Some useful environment variables
  2. RUNTIME_LINK="http://portablecl.org/downloads/pocl-0.14.tar.gz"
  3. BASE_DIR=`pwd`
  4. # Output message for the user
  5. echo "We are retrieving, building and installing the pocl runtime"
  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. # Create the needed folders
  13. if [ ! -d "runtime" ]; then
  14. mkdir runtime
  15. wget -qO- $RUNTIME_LINK | tar xzvf - -C runtime/
  16. fi
  17. RUNTIME_DIR=runtime/`ls runtime`
  18. if [ ! -d "$RUNTIME_DIR/build" ]; then
  19. mkdir $RUNTIME_DIR/build
  20. fi
  21. # Compile the runtime
  22. cd $RUNTIME_DIR/build
  23. make clean
  24. cmake -DLLC_HOST_CPU=cortex-a15 ../
  25. make clean
  26. make -j8
  27. # Require user intervent to install the runtime
  28. read -p "Press enter to continue and install the runtime in the default path on the system, otherwise interrupt the process"
  29. sudo make install
  30. # Add the .icd file that enable the ocl-icd loader to identify the mali platform
  31. echo "/usr/lib/arm-linux-gnueabihf/mali-egl/libOpenCL.so" | sudo tee /etc/OpenCL/vendors/mali.icd