forked from zhanghang1989/fb-caffe-exts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install-dep-16.04.sh
executable file
·142 lines (115 loc) · 2.38 KB
/
install-dep-16.04.sh
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
echo
echo This script will install fblualib and all its dependencies.
echo It has been Ubuntu 16.04, Linux x86_64.
echo
set -e
set -x
if [[ $(arch) != 'x86_64' ]]; then
echo "x86_64 required" >&2
exit 1
fi
issue=$(cat /etc/issue)
extra_packages=
current=0
if [[ $issue =~ ^Ubuntu\ 16\.04 ]]; then
extra_packages=libiberty-dev
current=1
else
echo "Ubuntu 16.04 required" >&2
exit 1
fi
dir=$(mktemp --tmpdir -d fblualib-build.XXXXXX)
echo Working in $dir
echo
cd $dir
echo Installing required packages
echo
sudo apt-get install -y \
git \
curl \
wget \
g++ \
automake \
autoconf \
autoconf-archive \
libtool \
libboost-all-dev \
libevent-dev \
libdouble-conversion-dev \
libgoogle-glog-dev \
libgflags-dev \
liblz4-dev \
liblzma-dev \
libsnappy-dev \
make \
zlib1g-dev \
binutils-dev \
libjemalloc-dev \
$extra_packages \
flex \
bison \
libkrb5-dev \
libsasl2-dev \
libnuma-dev \
pkg-config \
libssl-dev \
libedit-dev \
libmatio-dev \
libpython-dev \
libpython3-dev \
python-numpy
echo
echo Cloning repositories
echo
git clone --depth 1 https://github.com/zhanghang1989/folly
git clone --depth 1 https://github.com/zhanghang1989/fbthrift
git clone https://github.com/facebook/thpp
git clone https://github.com/zhanghang1989/fblualib
git clone https://github.com/zhanghang1989/wangle
echo
echo Building folly
echo
cd $dir/folly/folly
autoreconf -ivf
./configure
make
sudo make install
sudo ldconfig
if [ $current -eq 1 ]; then
echo
echo Wangle
echo
cd $dir/wangle/wangle
cmake .
make
sudo make install
fi
echo
echo Building fbthrift
echo
cd $dir/fbthrift/thrift
autoreconf -ivf
./configure
make
sudo make install
echo
echo 'Installing TH++'
echo
cd $dir/thpp/thpp
./build.sh
echo
echo 'Installing FBLuaLib'
echo
cd $dir/fblualib/fblualib
./build.sh
cd $dir/fblualib/fblualib/python
luarocks make rockspec/fbpython-0.1-1.rockspec
echo
echo 'Almost done!'
echo
git clone https://github.com/torch/nn && ( cd nn && git checkout getParamsByDevice && luarocks make rocks/nn-scm-1.rockspec )
git clone https://github.com/facebook/fbtorch.git && ( cd fbtorch && luarocks make rocks/fbtorch-scm-1.rockspec )
git clone https://github.com/facebook/fbnn.git && ( cd fbnn && luarocks make rocks/fbnn-scm-1.rockspec )
echo
echo 'All done!'
echo