Last active
August 29, 2015 14:04
-
-
Save nlamprian/113ae06addaa96444693 to your computer and use it in GitHub Desktop.
A script to install GLUT, GLEW, libfreenect, OpenCV, and OpenCL (AMD SDK) on Ubuntu 14.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NC=`nproc` | |
sudo apt-get install -y git-core cmake libglew-dev | |
# OpenCV | |
# https://help.ubuntu.com/community/OpenCV | |
read -n 1 -s -p "Press a key to continue with OpenCV... " | |
echo "" | |
cd ~ | |
git clone https://github.com/jayrambhia/Install-OpenCV.git | |
cd Install-OpenCV/Ubuntu | |
chmod +x opencv_*.sh | |
./opencv_latest.sh | |
cd ~ | |
rm -rf Install-OpenCV | |
# libusb | |
# http://libusb.info | |
echo "" &&read -n 1 -s -p "Press a key to continue with libusb (libfreenect dependency)... " | |
echo "" | |
sudo apt-get install libudev-dev | |
echo "" && echo -e "Please download the library from http://sourceforge.net/projects/libusb/files/" | |
read -n 1 -s -p "Place the file in your ~/Downloads folder. Proceed... " | |
echo "" | |
tar xvjf libusb*.tar.bz2 -C ~ | |
rm libusb*.tar.bz2 | |
cd ~/libusb*/ | |
./configure | |
make -j$NC | |
make check | |
sudo make install | |
# libfreenect | |
# http://openkinect.org/wiki/Getting_Started | |
echo "" && read -n 1 -s -p "Press a key to continue with libfreenect... " | |
echo "" | |
sudo apt-get install -y freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev # libusb-1.0-0-dev | |
cd ~ | |
git clone https://github.com/OpenKinect/libfreenect.git | |
cd libfreenect/ | |
mkdir build && cd build | |
cmake -L .. | |
make -j$NC | |
sudo make install | |
sudo adduser $USER video | |
sudo adduser $USER plugdev | |
sudo sh -c "echo '/usr/local/lib64\n/usr/local/lib' > /etc/ld.so.conf.d/usr-local-libs.conf" | |
sudo /sbin/ldconfig -v | |
sudo sh -c "echo '#Rules for Kinect ####################################################\nSYSFS{idVendor}==\"045e\", SYSFS{idProduct}==\"02ae\", MODE=\"0660\", GROUP=\"video\"\nSYSFS{idVendor}==\"045e\", SYSFS{idProduct}==\"02ad\", MODE=\"0660\", GROUP=\"video\"\nSYSFS{idVendor}==\"045e\", SYSFS{idProduct}==\"02b0\", MODE=\"0660\", GROUP=\"video\"\n### END #############################################################' > /etc/udev/rules.d/66-kinect.rules" | |
sudo cp ~/libfreenect/platform/linux/udev/51-kinect.rules /etc/udev/rules.d | |
# OpenCL | |
# http://developer.amd.com/tools-and-sdks/opencl-zone/ | |
echo "" && read -n 1 -s -p "Press a key to continue with OpenCL (AMD SDK)... " | |
sudo apt-get install -y libglu1-mesa-dev g++-multilib lib32bz2-1.0 libtifiles2-9 | |
echo "" && echo -e "Please download the OpenCL SDK from http://developer.amd.com/tools-and-sdks/opencl-zone/opencl-tools-sdks/amd-accelerated-parallel-processing-app-sdk/" | |
read -n 1 -s -p "Place the file in your ~/Downloads folder. Proceed... " | |
echo "" | |
cd ~/Downloads | |
tar -xvjf AMD-APP-SDK*.tar.bz2 | |
sudo ./AMD-APP-SDK*.sh | |
echo -e "\nexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/fglrx\n" >> ~/.bashrc | |
source ~/.bashrc | |
rm -f AMD-APP-SDK*.tar.bz2 AMD-APP-SDK*.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment