-
Notifications
You must be signed in to change notification settings - Fork 6
/
from_source.html
385 lines (301 loc) · 16.2 KB
/
from_source.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta name="msapplication-config" content="/browserconfig.xml"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta charset="utf-8"/>
<link rel="apple-touch-icon" type="image/png" href="/apple-touch-icon.png"/>
<link rel="manifest" type="application/manifest+json" href="/site.webmanifest"/>
<link rel="mask-icon" type="image/svg+xml" href="/mask-icon.svg" color="#990000"/>
<link rel="shortcut icon" type="image/png" href="/favicon.png"/>
<title>Drake: Source Installation</title>
<meta
name="description"
content="Drake ("dragon" in Middle English) is a C++ toolbox started by the Robot
Locomotion Group at the MIT Computer Science and Artificial Intelligence
Lab (CSAIL). The development team has now grown significantly, with core
development led by the Toyota Research Institute. It is a collection of
tools for analyzing the dynamics of our robots and building control
systems for them, with a heavy emphasis on optimization-based design/
analysis.
"/>
<!--
The "Work Sans" font is licensed under the SIL Open Font License (OFL). For
more information, see:
- https://fonts.google.com/specimen/Work+Sans?preview.text_type=custom#about
- https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
-->
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Work+Sans:wght@300;400;600;700;800&display=swap" rel="stylesheet"/>
<link rel="stylesheet" href="/third_party/github-styling/github-markdown.css"/>
<link rel="stylesheet" href="/third_party/dracula/syntax.css"/>
<link rel="stylesheet" href="/third_party/pylons/pylons.css"/>
<link rel="stylesheet" href="/assets/css/main.css"/>
</head>
<body>
<header class="site-header">
<div class="site-header-inner contain">
<a href="/" class="drake-logo">
<img src="/images/drake-logo-white.svg">
</a>
<div class="menu-mobile-toggle">
<span></span>
</div>
<nav class="site-menu">
<ul>
<li class="site-menu-item site-menu-item-main">
<a href="/" class="site-menu-item">Home</a>
</li>
<li class="site-menu-item site-menu-item-main">
<a href="/installation.html" class="site-menu-item">Installation</a>
</li>
<li class="site-menu-item site-menu-item-main">
<a href="/gallery.html" class="site-menu-item">Gallery</a>
</li>
<li class="site-menu-item site-menu-item-main">
API Documentation
<div class="sub">
<a href="/doxygen_cxx/index.html" class="site-menu-item">C++</a>
<a href="/pydrake/index.html" class="site-menu-item">Python</a>
</div>
</li>
<li class="site-menu-item site-menu-item-main">
Resources
<div class="sub">
<a href="/getting_help.html" class="site-menu-item">Getting Help</a>
<a href="https://deepnote.com/workspace/Drake-0b3b2c53-a7ad-441b-80f8-bf8350752305/project/Tutorials-2b4fc509-aef2-417d-a40d-6071dfed9199/%2Findex.ipynb" class="site-menu-item">Tutorials</a>
<a href="/python_bindings.html" class="site-menu-item">Python Bindings</a>
<a href="/developers.html" class="site-menu-item">For Developers</a>
<a href="/credits.html" class="site-menu-item">Credits</a>
</div>
</li>
<li class="search">
<div class="search-icon">
<!-- This is an inline SVG image of a magnifying glass. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 374.9 374.84">
<path d="M235 270a148.74 148.74 0 1 1 35-35l97.74 97.74a24.37 24.37 0 0 1 0 34.58l-.4.4a24.47 24.47 0 0 1-34.58 0L235 270Zm-86.22-7.47A113.75 113.75 0 1 0 35 148.75 113.75 113.75 0 0 0 148.75 262.5Z"/>
</svg>
</div>
<div class="search-bar">
<form id="search_form" action="https://google.com/search" method="get">
<input type="text" name="q" placeholder="Search all of Drake…" />
<input type="hidden" name="q" value="site:drake.mit.edu OR site:underactuated.csail.mit.edu OR site:manipulation.csail.mit.edu" />
</form>
<div class="search-close">
<!-- This is an inline SVG image of an "X". -->
<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 373.61 373.57">
<path d="M219.71 186.77 366.71 40a23.43 23.43 0 1 0-33.13-33.13l-146.77 147-146.77-147A23.43 23.43 0 0 0 6.9 40l147 146.77-147 146.77a23.43 23.43 0 1 0 33.14 33.13l146.77-147 146.77 147a23.43 23.43 0 1 0 33.13-33.13Z"/>
</svg>
</div>
</div>
<ul id="results-container"></ul>
</li>
<li class="github-link">
<a href="https://github.com/RobotLocomotion/drake" class="site-menu-item">GitHub <img src="/third_party/images/GitHub-Mark-Light-64px.png" /></a>
</li>
</ul>
</nav>
</div>
</header>
<div class="page">
<div class="content">
<div class="drake-page">
<header class="drake-page-header">
<div class="contain">
<h1>Source Installation</h1>
</div>
</header>
<section class="padding">
<div class="contain">
<article class="markdown-body">
<h1 id="supported-configurations">Supported Configurations</h1>
<p>The following table shows the configurations and platforms that Drake
officially supports:</p>
<!-- The operating system requirements should match those listed in the root
CMakeLists.txt. -->
<!-- The minimum compiler versions should match those listed in both the root
CMakeLists.txt and tools/workspace/cc/repository.bzl. -->
<table>
<thead>
<tr>
<th>Operating System ⁽¹⁾</th>
<th>Architecture</th>
<th>Python ⁽²⁾</th>
<th>Bazel</th>
<th>CMake</th>
<th>C/C++ Compiler ⁽³⁾</th>
<th>Java</th>
</tr>
</thead>
<tbody>
<tr>
<td>Ubuntu 22.04 LTS (Jammy Jellyfish)</td>
<td>x86_64</td>
<td>3.10</td>
<td>7.4</td>
<td>3.22</td>
<td>GCC 11 (default) or Clang 15</td>
<td>OpenJDK 11</td>
</tr>
<tr>
<td>Ubuntu 24.04 LTS (Noble Numbat)</td>
<td>x86_64</td>
<td>3.12</td>
<td>7.4</td>
<td>3.28</td>
<td>GCC 13 (default) or Clang 15</td>
<td>OpenJDK 21</td>
</tr>
<tr>
<td>macOS Sonoma (14)</td>
<td>arm64</td>
<td>3.12</td>
<td>7.4</td>
<td>3.28</td>
<td>Apple LLVM 15 (Xcode 15)</td>
<td>AdoptOpenJDK 16 (HotSpot JVM)</td>
</tr>
<tr>
<td>macOS Sequoia (15)</td>
<td>arm64</td>
<td>TBD</td>
<td>TBD</td>
<td>TBD</td>
<td>TBD</td>
<td>TBD</td>
</tr>
</tbody>
</table>
<p>“Official support” means that we have Continuous Integration test coverage to
notice regressions, so if it doesn’t work for you then please file a bug report.</p>
<p>Unofficially, Drake is also likely to be compatible with newer versions of
Ubuntu or macOS than what are listed, or with Ubuntu running on arm64, or
with other versions of Python or Java. However, these are not supported so if it
doesn’t work for you then please file a pull request with the fix, not a bug
report.</p>
<p>All else being equal, we would recommend developers use Ubuntu 22.04 (Jammy).</p>
<p>⁽¹⁾ Drake features that perform image rendering (e.g., camera simulation)
require a working display server. Most personal computers will have this
already built in, but some cloud or docker environments may require extra
setup steps.</p>
<p>⁽²⁾ CPython is the only Python implementation supported.</p>
<p>⁽³⁾ Drake requires a compiler running in C++20 (or greater) mode.</p>
<h1 id="getting-drake">Getting Drake</h1>
<p>Run:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone --filter=blob:none https://github.com/RobotLocomotion/drake.git
</code></pre></div></div>
<p>Note: we suggest you keep the default clone directory name (<code class="language-plaintext highlighter-rouge">drake</code>) and not
rename it (such as <code class="language-plaintext highlighter-rouge">drake2</code>). The CLion integration will suffer if the
checkout directory is not named <code class="language-plaintext highlighter-rouge">drake</code>. (See <a href="clion.html">CLion IDE setup</a> for details.)</p>
<p>Note: the build process may encounter problems if you have unusual characters
like parentheses in the absolute path to the drake directory
(see <a href="https://github.com/RobotLocomotion/drake/issues/394">#394</a>).</p>
<h2 id="using-a-fork-of-drake">Using a fork of Drake</h2>
<p>The above <code class="language-plaintext highlighter-rouge">git clone</code> command will configure Drake’s primary repository as a
remote called <code class="language-plaintext highlighter-rouge">origin</code>. If you plan to fork Drake for development, we
recommend that you configure your fork of Drake’s primary repository as the
<code class="language-plaintext highlighter-rouge">origin</code> remote and Drake’s primary repository as the <code class="language-plaintext highlighter-rouge">upstream</code>
remote. This can be done by executing the following commands:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cd drake
git remote set-url origin [email protected]:[your github user name]/drake.git
git remote add upstream https://github.com/RobotLocomotion/drake.git
git remote set-url --push upstream no_push
</code></pre></div></div>
<p>We recommend that you
<a href="https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/">setup SSH access to github.com</a>
to avoid needing to type your password each time you access it.</p>
<h1 id="mandatory-platform-specific-instructions">Mandatory platform-specific instructions</h1>
<p>Before running the build, you must follow some one-time platform-specific
setup steps.</p>
<p><em>Ubuntu:</em></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo ./setup/ubuntu/install_prereqs.sh
</code></pre></div></div>
<p><em>macOS:</em></p>
<p>We assume that you have already installed Xcode
(<a href="https://itunes.apple.com/us/app/xcode/id497799835">from the Mac App Store</a>).</p>
<p>After that, run:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./setup/mac/install_prereqs.sh
</code></pre></div></div>
<h1 id="build-with-bazel">Build with Bazel</h1>
<p>For instructions, jump to
<a href="/bazel.html#developing-drake-using-bazel">Developing Drake using Bazel</a>,
or check out the full details at:</p>
<ul>
<li><a href="/bazel.html">Bazel build system</a></li>
</ul>
<h2 id="building-the-python-bindings">Building the Python Bindings</h2>
<p>To use the Python bindings from Drake externally, we recommend using CMake.
As an example:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/RobotLocomotion/drake.git
<span class="nb">mkdir </span>drake-build
<span class="nb">cd </span>drake-build
cmake ../drake
make <span class="nb">install</span>
</code></pre></div></div>
<p>Note that a concurrency limit passed to <code class="language-plaintext highlighter-rouge">make</code> (e.g., <code class="language-plaintext highlighter-rouge">make -j 2</code>) has almost no
effect on the Drake build. You might need to add a bazel configuration dotfile
to your home directory if your build is running out of memory. See the
<a href="/troubleshooting.html#build-oom">troubleshooting</a> page for details.</p>
<p>Be aware that repeatedly running <code class="language-plaintext highlighter-rouge">make install</code> will install the recompiled
version of Drake <em>on top of</em> the prior version. This will lead to disaster
unless the set of installed filenames is exactly the same (because old files
will be hanging around polluting your PYTHONPATH). It is safe if you are merely
tweaking a source code file and repeatedly installing, without any changes to
the build system. For any kind of larger change (e.g., upgrading to a newer
Drake), we strongly advise that you delete the prior tree (within the <code class="language-plaintext highlighter-rouge">install</code>
sub-directory) before running <code class="language-plaintext highlighter-rouge">make</code>.</p>
<p>Please note the additional CMake options which affect the Python bindings:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">-DWITH_GUROBI={ON, [OFF]}</code> - Build with Gurobi enabled.</li>
<li><code class="language-plaintext highlighter-rouge">-DWITH_MOSEK={ON, [OFF]}</code> - Build with MOSEK<a href="/tm.html">™</a> enabled.</li>
<li><code class="language-plaintext highlighter-rouge">-DWITH_SNOPT={ON, [OFF]}</code> - Build with SNOPT enabled.</li>
</ul>
<p><code class="language-plaintext highlighter-rouge">{...}</code> means a list of options, and the option surrounded by <code class="language-plaintext highlighter-rouge">[...]</code> is
the default option. An example of building <code class="language-plaintext highlighter-rouge">pydrake</code> with both Gurobi and
MOSEK<a href="/tm.html">™</a>, without building tests:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cmake <span class="nt">-DWITH_GUROBI</span><span class="o">=</span>ON <span class="nt">-DWITH_MOSEK</span><span class="o">=</span>ON ../drake
</code></pre></div></div>
<p>You will also need to have your <code class="language-plaintext highlighter-rouge">PYTHONPATH</code> configured correctly.</p>
<p><em>Ubuntu 22.04 (Jammy):</em></p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd </span>drake-build
<span class="nb">export </span><span class="nv">PYTHONPATH</span><span class="o">=</span><span class="k">${</span><span class="nv">PWD</span><span class="k">}</span>/install/lib/python3.10/site-packages:<span class="k">${</span><span class="nv">PYTHONPATH</span><span class="k">}</span>
</code></pre></div></div>
<p><em>Ubuntu 24.04 (Jammy):</em></p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd </span>drake-build
<span class="nb">export </span><span class="nv">PYTHONPATH</span><span class="o">=</span><span class="k">${</span><span class="nv">PWD</span><span class="k">}</span>/install/lib/python3.12/site-packages:<span class="k">${</span><span class="nv">PYTHONPATH</span><span class="k">}</span>
</code></pre></div></div>
<p><em>macOS:</em></p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd </span>drake-build
<span class="nb">export </span><span class="nv">PYTHONPATH</span><span class="o">=</span><span class="k">${</span><span class="nv">PWD</span><span class="k">}</span>/install/lib/python3.12/site-packages:<span class="k">${</span><span class="nv">PYTHONPATH</span><span class="k">}</span>
</code></pre></div></div>
</article>
</div>
</section>
</div>
<footer class="site-footer padding">
<div class="contain">
<a href="/" class="drake-logo">
<img src="/images/drake-logo.svg">
</a>
<div class="footer-menu">
<ul>
<li>
<a href="/doxygen_cxx/index.html" class="site-menu-item">C++</a>
</li>
<li>
<a href="/pydrake/index.html" class="site-menu-item">Python</a>
</li>
<li class="github-link">
<a href="https://github.com/RobotLocomotion/drake" class="site-menu-item">GitHub <img src="/third_party/images/GitHub-Mark-64px.png" /></a>
</li>
</ul>
</div>
</div>
<!-- TODO(eric.cousineau): Consider placing copyright here. -->
</footer>
</div>
</div>
<script src="/assets/js/mobile.js"></script>
<!-- Search -->
<script src="/assets/js/search.js"></script>
</body>
</html>