2017-03-13 21:43:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#==============================================================================
|
|
|
|
# Title: install.sh
|
|
|
|
# Description: Install everything necessary for OpenFace to compile.
|
|
|
|
# Author: Daniyal Shahrokhian <daniyal@kth.se>
|
2017-05-01 07:34:07 +00:00
|
|
|
# Date: 20170428
|
|
|
|
# Version : 1.01
|
2017-03-13 21:43:59 +00:00
|
|
|
# Usage: bash install.sh
|
|
|
|
# NOTES: There are certain steps to be taken in the system before installing
|
|
|
|
# via this script (refer to README): Run
|
|
|
|
# `sudo gedit /etc/apt/sources.list` and change the line
|
|
|
|
# `deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted` to
|
|
|
|
# `deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe`
|
|
|
|
#==============================================================================
|
|
|
|
|
|
|
|
# Exit script if any command fails
|
|
|
|
set -e
|
|
|
|
set -o pipefail
|
|
|
|
|
2017-05-01 07:34:07 +00:00
|
|
|
if [ $# -ne 0 ]
|
2017-03-13 21:43:59 +00:00
|
|
|
then
|
2017-05-01 07:34:07 +00:00
|
|
|
echo "Usage: install.sh"
|
2017-03-13 21:43:59 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Essential Dependencies
|
|
|
|
echo "Installing Essential dependencies..."
|
2017-05-01 07:34:07 +00:00
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install build-essential
|
|
|
|
sudo apt-get -y install llvm
|
|
|
|
sudo apt-get -y install clang-3.7 libc++-dev libc++abi-dev
|
|
|
|
sudo apt-get -y install cmake
|
|
|
|
sudo apt-get -y install libopenblas-dev liblapack-dev
|
|
|
|
sudo apt-get -y install git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
|
|
|
|
sudo apt-get -y install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev checkinstall
|
2017-03-13 21:43:59 +00:00
|
|
|
echo "Essential dependencies installed."
|
|
|
|
|
|
|
|
# OpenCV Dependency
|
|
|
|
echo "Downloading OpenCV..."
|
2018-02-02 17:31:14 +00:00
|
|
|
wget https://github.com/opencv/opencv/archive/3.4.0.zip
|
|
|
|
unzip 3.4.0.zip
|
|
|
|
cd opencv-3.4.0
|
2017-05-01 07:34:07 +00:00
|
|
|
mkdir -p build
|
2017-03-13 21:43:59 +00:00
|
|
|
cd build
|
|
|
|
echo "Installing OpenCV..."
|
2018-02-02 17:31:14 +00:00
|
|
|
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_CUDA=OFF -D BUILD_SHARED_LIBS=OFF ..
|
2017-03-13 21:43:59 +00:00
|
|
|
make -j4
|
|
|
|
sudo make install
|
2017-05-01 07:34:07 +00:00
|
|
|
cd ../..
|
2018-02-02 17:31:14 +00:00
|
|
|
rm 3.4.0.zip
|
|
|
|
sudo rm -r opencv-3.4.0
|
2017-03-13 21:43:59 +00:00
|
|
|
echo "OpenCV installed."
|
|
|
|
|
|
|
|
# Boost C++ Dependency
|
|
|
|
echo "Installing Boost..."
|
|
|
|
sudo apt-get install libboost-all-dev
|
|
|
|
echo "Boost installed."
|
|
|
|
|
|
|
|
# OpenFace installation
|
|
|
|
echo "Installing OpenFace..."
|
2017-05-01 07:34:07 +00:00
|
|
|
mkdir -p build
|
|
|
|
cd build
|
2017-03-13 21:43:59 +00:00
|
|
|
cmake -D CMAKE_BUILD_TYPE=RELEASE ..
|
|
|
|
make
|
2017-05-01 07:34:07 +00:00
|
|
|
cd ..
|
|
|
|
echo "OpenFace successfully installed."
|