Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client_sdk / doc_generated / sdk / download.html
1 {{+bindTo:partials.standard_nacl_article}}
2
3 <section id="download-the-native-client-sdk">
4 <span id="download"></span><h1 id="download-the-native-client-sdk"><span id="download"></span>Download the Native Client SDK</h1>
5 <p>To build Native Client modules, you must download and install the Native
6 Client Software Development Kit (SDK). This page provides an overview
7 of the Native Client SDK, and instructions for how to download and
8 install the SDK.</p>
9 <h2 id="overview">Overview</h2>
10 <p>The Native Client SDK includes the following:</p>
11 <dl class="docutils">
12 <dt>support for multiple Pepper versions</dt>
13 <dd>The SDK contains <strong>bundles</strong> that let you compile Native Client modules
14 using different versions of the
15 <a class="reference internal" href="/native-client/overview.html#link-pepper"><em>Pepper Plugin API</em></a> (e.g., Pepper 31 or Pepper Canary). Review the
16 <a class="reference internal" href="/native-client/sdk/release-notes.html"><em>Release Notes</em></a> for a description of the new features
17 included in each Pepper version to help you decide which bundle to
18 use to develop your application. In general, Native Client modules
19 compiled using a particular Pepper version will work in
20 corresponding versions of Chrome and higher. For example, a module
21 compiled using the Pepper 31 bundle will work in Chrome 31 and
22 higher.</dd>
23 <dt>update utility</dt>
24 <dd>The <code>naclsdk</code> utility (<code>naclsdk.bat</code> on Windows) lets you download new
25 bundles that are available, as well as new versions of existing bundles.</dd>
26 <dt>toolchains</dt>
27 <dd>Each platform includes three toolchains: one for compiling
28 Portable Native Client (PNaCl) applications, one for compiling
29 architecture-specific Native Client applications with newlib, and
30 one for compiling architecture-specific Native Client applications with glibc.
31 Newlib and glibc are two different implementations
32 of the C standard library. All three toolchains contain
33 Native Client-compatible versions of standard compilers, linkers,
34 and other tools. See <a class="reference internal" href="/native-client/nacl-and-pnacl.html"><em>NaCl and PNaCl</em></a> to help
35 you choose the right toolchain.</dd>
36 <dt>examples</dt>
37 <dd>Each example in the SDK includes C or C++ source files and header files
38 illustrating how to use NaCl and Pepper, along with a Makefile to build
39 the example using each of the toolchains.</dd>
40 <dt>tools</dt>
41 <dd>The SDK includes a number of additional tools that you can use for
42 tasks such as validating Native Client modules and running modules
43 from the command line.</dd>
44 </dl>
45 <p>Follow the steps below to download and install the Native Client SDK.</p>
46 <h2 id="prerequisites">Prerequisites</h2>
47 <ul class="small-gap">
48 <li><p class="first"><strong>Python:</strong> Make sure you have Python 2.6 or 2.7 installed, and that the
49 Python executable is in your path.</p>
50 <ul class="small-gap">
51 <li>On Mac/Linux, Python is likely preinstalled. Run the command <code>&quot;python
52 -V</code>&#8221; in a terminal window, and make sure that the version of Python you
53 have is 2.6.x or 2.7.x (if it&#8217;s not, upgrade to one of those versions).</li>
54 <li>On Windows, you may need to install Python. Go to
55 <a class="reference external" href="http://www.python.org/download/">http://www.python.org/download/</a> and
56 select the latest 2.x version. In addition, be sure to add the Python
57 directory (for example, <code>C:\python27</code>) to the PATH <a class="reference external" href="http://en.wikipedia.org/wiki/Environment_variable">environment
58 variable</a>. After
59 you&#8217;ve installed Python, run the command <code>&quot;python -V</code>&#8221; in a Command
60 Prompt window and verify that the version of Python you have is 2.6.x or
61 2.7.x.</li>
62 <li>Note that Python 3.x is not yet supported.</li>
63 </ul>
64 </li>
65 <li><strong>Make:</strong> On the Mac, you need to install the <code>make</code> command on your system
66 before you can build and run the examples in the SDK. One easy way to get
67 <code>make</code>, along with several other useful tools, is to install
68 <a class="reference external" href="https://developer.apple.com/technologies/tools/">Xcode Developer Tools</a>.
69 After installing Xcode, go to the Preferences menu, select
70 Downloads and Components, and verify that Command Line Tools are installed.
71 If you&#8217;d rather not install Xcode, you can download and build an
72 <a class="reference external" href="http://mac.softpedia.com/dyn-postdownload.php?p=44632&amp;t=4&amp;i=1">open source version</a> of
73 <code>make</code>. In order to build the command you may also need to download and
74 install a copy of <a class="reference external" href="https://github.com/kennethreitz/osx-gcc-installer">gcc</a>.</li>
75 </ul>
76 <h2 id="download-and-install-the-sdk">Download and install the SDK</h2>
77 <ol class="arabic">
78 <li><p class="first">Download the SDK update utility: <a class="reference external" href="http://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip">nacl_sdk.zip</a>.</p>
79 </li>
80 <li><p class="first">Unzip the SDK update utility:</p>
81 <ul class="small-gap">
82 <li><p class="first">On Mac/Linux, run the command &#8220;<code>unzip nacl_sdk.zip</code>&#8221; in a terminal
83 window.</p>
84 </li>
85 <li><p class="first">On Windows, right-click on the .zip file and select &#8220;Extract All...&#8221;. A
86 dialog box will open; enter a location and click &#8220;Extract&#8221;.</p>
87 </li>
88 </ul>
89 <p>Unzipping the SDK update utility creates a directory called <code>nacl_sdk</code> with
90 the following files and directories:</p>
91 <ul class="small-gap">
92 <li><p class="first"><code>naclsdk</code> (and <code>naclsdk.bat</code> for Windows) &#8212; the front end of the update
93 utility, i.e., the command you run to download the latest bundles</p>
94 </li>
95 <li><p class="first"><code>sdk_cache</code> &#8212; a directory with a manifest file that lists the bundles
96 you have already downloaded</p>
97 </li>
98 <li><p class="first"><code>sdk_tools</code> &#8212; the back end of the update utility, also known as the
99 &#8220;sdk_tools&#8221; bundle</p>
100 </li>
101 </ul>
102 </li>
103 <li><p class="first">To see the SDK bundles that are available for download, go to the <code>nacl_sdk</code>
104 directory and run <code>naclsdk</code> with the <code>&quot;list&quot;</code> command.
105 The SDK includes a separate bundle for each version of Chrome/Pepper.</p>
106 <p>On Mac/Linux:</p>
107 <pre class="prettyprint">
108 $ cd nacl_sdk
109 $ ./naclsdk list
110 </pre>
111 <p>On Windows:</p>
112 <pre class="prettyprint">
113 &gt; cd nacl_sdk
114 &gt; naclsdk list
115 </pre>
116 <p>You should see output similar to this:</p>
117 <pre class="prettyprint">
118 Bundles:
119  I: installed
120  *: update available
121
122   I  sdk_tools (stable)
123      vs_addin (dev)
124      pepper_27 (post_stable)
125      pepper_28 (post_stable)
126      pepper_29 (post_stable)
127      pepper_30 (post_stable)
128      pepper_31 (stable)
129      pepper_32 (beta)
130      pepper_canary (canary)
131 </pre>
132 <p>The sample output above shows that there are a number of bundles available
133 for download, and that you have already installed the latest revision of the
134 <code>sdk_tools</code> bundle (it was included in the zip file you downloaded).
135 Each bundle is labeled post-stable, stable, beta, dev, or canary.
136 These labels usually correspond to the current versions of
137 Chrome. (In the example above, Chrome 31 is stable, Chrome 32 is beta, etc.).
138 We generally recommend that you download and use a &#8220;stable&#8221; bundle,
139 as applications developed with &#8220;stable&#8221; bundles can be used by all current
140 Chrome users. This is because Native Client is designed to be
141 backward-compatible (for example, applications developed with the
142 <code>pepper_31</code> bundle can run in Chrome 31, Chrome 32, etc.).
143 Thus in the example above, <code>pepper_31</code> is the recommended bundle to use.</p>
144 </li>
145 <li><p class="first">Run <code>naclsdk</code> with the &#8220;update&#8221; command to download recommended bundles.</p>
146 <p>On Mac/Linux:</p>
147 <pre class="prettyprint">
148 $ ./naclsdk update
149 </pre>
150 <p>On Windows:</p>
151 <pre class="prettyprint">
152 &gt; naclsdk update
153 </pre>
154 <p>By default, <code>naclsdk</code> only downloads bundles that are
155 recommended&#8212;generally those that are &#8220;stable.&#8221; Continuing with the earlier example, the
156 &#8220;update&#8221; command would only download the <code>pepper_31</code>
157 bundle, since the bundles <code>pepper_32</code> and greater are not yet stable.
158 If you want the <code>pepper_32</code> bundle, you must ask for it explicitly:</p>
159 <pre class="prettyprint">
160 $ ./naclsdk update pepper_32
161 </pre>
162 <p>Note that you never need to update the <code>sdk_tools</code> bundle&#8212;it is
163 updated automatically (if necessary) whenever you run <code>naclsdk</code>.</p>
164 </li>
165 </ol>
166 <aside class="note">
167 The minimum SDK bundle that supports PNaCl is <code>pepper_31</code>.
168 </aside>
169 <h2 id="staying-up-to-date-and-getting-new-versions-of-bundles">Staying up-to-date and getting new versions of bundles</h2>
170 <ol class="arabic">
171 <li><p class="first">Run <code>naclsdk</code> with the &#8220;list&#8221; command again; this will show you the list of
172 available bundles and verify which bundles you have installed.</p>
173 <p>On Mac/Linux:</p>
174 <pre class="prettyprint">
175 $ ./naclsdk list
176 </pre>
177 <p>On Windows:</p>
178 <pre class="prettyprint">
179 &gt; naclsdk list
180 </pre>
181 <p>Continuing with the earlier example, if you previously downloaded the
182 <code>pepper_31</code> bundle, you should see output similar to this:</p>
183 <pre class="prettyprint">
184 Bundles:
185  I: installed
186  *: update available
187
188   I  sdk_tools (stable)
189      vs_addin (dev)
190      pepper_27 (post_stable)
191      pepper_28 (post_stable)
192      pepper_29 (post_stable)
193      pepper_30 (post_stable)
194   I  pepper_31 (stable)
195      pepper_32 (beta)
196      pepper_canary (canary)
197 </pre>
198 </li>
199 <li><p class="first">Running <code>naclsdk</code> with the &#8220;update&#8221; command again will verify that your
200 bundles are up-to-date, or warn if you there are new versions of previously
201 installed bundles.</p>
202 <p>On Mac/Linux:</p>
203 <pre class="prettyprint">
204 $ ./naclsdk update
205 </pre>
206 <p>On Windows:</p>
207 <pre class="prettyprint">
208 &gt; naclsdk update
209 </pre>
210 <p>Continuing with the earlier example, you should see output similar to this:</p>
211 <pre class="prettyprint">
212 pepper_31 is already up-to-date.
213 </pre>
214 </li>
215 <li><p class="first">To check if there is a new version of a previously installed bundle, you can
216 run the &#8220;list&#8221; command again:</p>
217 <pre class="prettyprint">
218 Bundles:
219  I: installed
220  *: update available
221
222   I  sdk_tools (stable)
223      vs_addin (dev)
224      pepper_27 (post_stable)
225      pepper_28 (post_stable)
226      pepper_29 (post_stable)
227      pepper_30 (post_stable)
228   I* pepper_31 (stable)
229      pepper_32 (beta)
230      pepper_canary (canary)
231 </pre>
232 <p>An asterisk next to a bundle indicates that there is an update
233 available for that bundle. If you run  the &#8220;update&#8221; command now,
234 <code>naclsdk</code> will warn you with a message similar to this:</p>
235 <pre class="prettyprint">
236 WARNING: pepper_31 already exists, but has an update available.
237 Run update with the --force option to overwrite the existing directory.
238 Warning: This will overwrite any modifications you have made within this directory.
239 </pre>
240 <p>To dowload the new version of a bundle and overwrite the existing directory
241 for that bundle, run <code>naclsdk</code> with the <code>--force</code> option.</p>
242 <p>On Mac/Linux:</p>
243 <pre class="prettyprint">
244 $ ./naclsdk update --force
245 </pre>
246 <p>On Windows:</p>
247 <pre class="prettyprint">
248 &gt; naclsdk update --force
249 </pre>
250 </li>
251 <li><p class="first">For more information about the <code>naclsdk</code> utility, run:</p>
252 <p>On Mac/Linux:</p>
253 <pre class="prettyprint">
254 $ ./naclsdk help
255 </pre>
256 <p>On Windows:</p>
257 <pre class="prettyprint">
258 &gt; naclsdk help
259 </pre>
260 </li>
261 </ol>
262 <p>Next steps:</p>
263 <ul class="small-gap">
264 <li>Browse through the <a class="reference internal" href="/native-client/sdk/release-notes.html"><em>Release Notes</em></a> for important
265 information about the SDK and new bundles.</li>
266 <li>If you&#8217;re just getting started with Native Client, we recommend reading
267 the <a class="reference internal" href="/native-client/overview.html"><em>Technical Overview</em></a> and walking through the
268 <a class="reference internal" href="/native-client/devguide/tutorial/tutorial-part1.html"><em>Getting Started Tutorial</em></a>.</li>
269 <li>If you&#8217;d rather dive into information about the toolchains, see
270 <a class="reference internal" href="/native-client/devguide/devcycle/building.html"><em>Building Native Client Modules</em></a>.</li>
271 </ul>
272 </section>
273
274 {{/partials.standard_nacl_article}}