forked from BVLC/caffe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_apt.html
157 lines (121 loc) · 5.89 KB
/
install_apt.html
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!doctype html>
<html>
<head>
<!-- MathJax -->
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>
Caffe | Installation: Ubuntu
</title>
<link rel="icon" type="image/png" href="/images/caffeine-icon.png">
<link rel="stylesheet" href="/stylesheets/reset.css">
<link rel="stylesheet" href="/stylesheets/styles.css">
<link rel="stylesheet" href="/stylesheets/pygment_trac.css">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46255508-1', 'daggerfs.com');
ga('send', 'pageview');
</script>
<div class="wrapper">
<header>
<h1 class="header"><a href="/">Caffe</a></h1>
<p class="header">
Deep learning framework by <a class="header name" href="http://bair.berkeley.edu/">BAIR</a>
</p>
<p class="header">
Created by
<br>
<a class="header name" href="http://daggerfs.com/">Yangqing Jia</a>
<br>
Lead Developer
<br>
<a class="header name" href="http://imaginarynumber.net/">Evan Shelhamer</a>
<ul>
<li>
<a class="buttons github" href="https://github.com/BVLC/caffe">View On GitHub</a>
</li>
</ul>
</header>
<section>
<h1 id="ubuntu-installation">Ubuntu Installation</h1>
<h3 id="for-ubuntu--1704">For Ubuntu (>= 17.04)</h3>
<p><strong>Installing pre-compiled Caffe</strong></p>
<p>Everything including caffe itself is packaged in 17.04 and higher versions.
To install pre-compiled Caffe package, just do it by</p>
<div class="highlighter-rouge"><pre class="highlight"><code>sudo apt install caffe-cpu
</code></pre>
</div>
<p>for CPU-only version, or</p>
<div class="highlighter-rouge"><pre class="highlight"><code>sudo apt install caffe-cuda
</code></pre>
</div>
<p>for CUDA version. Note, the cuda version may break if your NVIDIA driver
and CUDA toolkit are not installed by APT.</p>
<p><a href="https://launchpad.net/ubuntu/+source/caffe">Package status of CPU-only version</a></p>
<p><a href="https://launchpad.net/ubuntu/+source/caffe-contrib">Package status of CUDA version</a></p>
<p><strong>Installing Caffe from source</strong></p>
<p>We may install the dependencies by merely one line</p>
<div class="highlighter-rouge"><pre class="highlight"><code>sudo apt build-dep caffe-cpu # dependencies for CPU-only version
sudo apt build-dep caffe-cuda # dependencies for CUDA version
</code></pre>
</div>
<p>It requires a <code class="highlighter-rouge">deb-src</code> line in your <code class="highlighter-rouge">sources.list</code>.
Continue with <a href="installation.html#compilation">compilation</a>.</p>
<h3 id="for-ubuntu--1704-1">For Ubuntu (< 17.04)</h3>
<p><strong>General dependencies</strong></p>
<div class="highlighter-rouge"><pre class="highlight"><code>sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
</code></pre>
</div>
<p><strong>CUDA</strong>: Install by <code class="highlighter-rouge">apt-get</code> or the NVIDIA <code class="highlighter-rouge">.run</code> package.
The NVIDIA package tends to follow more recent library and driver versions, but the installation is more manual.
If installing from packages, install the library and latest driver separately; the driver bundled with the library is usually out-of-date.
This can be skipped for CPU-only installation.</p>
<p><strong>BLAS</strong>: install ATLAS by <code class="highlighter-rouge">sudo apt-get install libatlas-base-dev</code> or install OpenBLAS by <code class="highlighter-rouge">sudo apt-get install libopenblas-dev</code> or MKL for better CPU performance.</p>
<p><strong>Python</strong> (optional): if you use the default Python you will need to <code class="highlighter-rouge">sudo apt-get install</code> the <code class="highlighter-rouge">python-dev</code> package to have the Python headers for building the pycaffe interface.</p>
<p><strong>Compatibility notes, 16.04</strong></p>
<p>CUDA 8 is required on Ubuntu 16.04.</p>
<p><strong>Remaining dependencies, 14.04</strong></p>
<p>Everything is packaged in 14.04.</p>
<div class="highlighter-rouge"><pre class="highlight"><code>sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
</code></pre>
</div>
<p><strong>Remaining dependencies, 12.04</strong></p>
<p>These dependencies need manual installation in 12.04.</p>
<div class="highlighter-rouge"><pre class="highlight"><code># glog
wget https://github.com/google/glog/archive/v0.3.3.tar.gz
tar zxvf v0.3.3.tar.gz
cd glog-0.3.3
./configure
make && make install
# gflags
wget https://github.com/schuhschuh/gflags/archive/master.zip
unzip master.zip
cd gflags-master
mkdir build && cd build
export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
make && make install
# lmdb
git clone https://github.com/LMDB/lmdb
cd lmdb/libraries/liblmdb
make && make install
</code></pre>
</div>
<p>Note that glog does not compile with the most recent gflags version (2.1), so before that is resolved you will need to build with glog first.</p>
<p>Continue with <a href="installation.html#compilation">compilation</a>.</p>
</section>
</div>
</body>
</html>