forked from torch/ezinstall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-deps
executable file
·81 lines (72 loc) · 2.46 KB
/
install-deps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env bash
######################################################################
# This script installs required dependencies for Torch7
######################################################################
# Based on Platform:
if [[ `uname` == 'Darwin' ]]; then
# GCC?
if [[ `which gcc` == '' ]]; then
echo "MacOS doesn't come with GCC: please install XCode and the command line tools."
exit
fi
# Install Homebrew (pkg manager):
if [[ `which brew` == '' ]]; then
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/mxcl/homebrew/go/install)"
fi
# Install dependencies:
brew update
brew install git readline cmake wget qt
brew install libjpeg imagemagick zeromq
brew link readline --force
brew remove gnuplot
brew install gnuplot --wx --cairo --pdf --with-x
elif [[ `uname` == 'Linux' ]]; then
# Aptitude?
if [[ `which apt-get` == '' ]]; then
echo '==> apt-get not found, platform not supported'
exit
fi
# Install dependencies for Torch:
sudo apt-get install -y python-software-properties
sudo add-apt-repository ppa:chris-lea/zeromq
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y gcc g++
sudo apt-get install -y cmake
sudo apt-get install -y curl
sudo apt-get install -y libreadline-dev
sudo apt-get install -y git-core
sudo apt-get install -y libqt4-core libqt4-gui libqt4-dev
sudo apt-get install -y libjpeg-dev
sudo apt-get install -y libpng-dev
sudo apt-get install -y ncurses-dev
sudo apt-get install -y imagemagick
sudo apt-get install -y libzmq-dev
sudo apt-get install -y gfortran
sudo apt-get install -y unzip
sudo apt-get install -y gnuplot
sudo apt-get install -y gnuplot-x11
sudo add-apt-repository ppa:chris-lea/zeromq
sudo apt-get update
# Get and build OpenBlas (Torch is much better with a decent Blas)
cd /tmp/
git clone https://github.com/xianyi/OpenBLAS.git
cd OpenBLAS
make NO_AFFINITY=1 USE_OPENMP=1
RET=$?; if [ $RET -ne 0 ]; then
echo "Error. OpenBLAS could not be compiled";
exit $RET;
fi
sudo make install
RET=$?; if [ $RET -ne 0 ]; then
echo "Error. OpenBLAS could not be compiled";
exit $RET;
fi
else
# Unsupported
echo '==> platform not supported, aborting'
exit
fi
# Done.
echo "==> Torch7's dependencies have been installed"