1<!DOCTYPE html> 2<html lang="en" data-accent-color="violet" data-content_root="../../"> 3<head> 4 <meta charset="utf-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Download and install - Emscripten 6.0.11-git (dev) documentation</title><link rel="shortcut icon" href="../../_static/emscripten.ico"/><link rel="index" title="Index" href="../../genindex.html" /><link rel="search" title="Search" href="../../search.html" /><link rel="next" title="Emscripten Tutorial" href="Tutorial.html" /><link rel="prev" title="Getting Started" href="index.html" />
5<script> 6 function setColorMode(t){let e=document.documentElement;e.setAttribute("data-color-mode",t);let a=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,s=t;"auto"===t&&(s=a?"dark":"light"),"light"===s?(e.classList.remove("dark"),e.classList.add("light")):(e.classList.remove("light"),e.classList.add("dark"))} 7 setColorMode(localStorage._theme||"auto"); 8 </script>
8<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=182acb26" /> 9 <link rel="stylesheet" type="text/css" href="../../_static/shibuya.css?v=9454f7d5" /> 10 <link rel="stylesheet" type="text/css" href="../../_static/sphinx-design.min.css?v=95c83b7e" /> 11 <link media="print" rel="stylesheet" type="text/css" href="../../_static/print.css?v=20ff2c19" /> 12 <link rel="preconnect" href="https://fonts.googleapis.com"> 13<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> 14<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"> 15<style> 16:root { 17 --sy-f-text: "Inter", var(--sy-f-sys), var(--sy-f-cjk), sans-serif; 18 --sy-f-heading: "Inter", var(--sy-f-sys), var(--sy-f-cjk), sans-serif; 19} 20</style> 21 22 <meta property="og:type" content="website"/><meta property="og:title" content="Download and install"/> 23 <meta name="twitter:card" content="summary"/> 24 </head> 25<body><div class="sy-head"> 26 <div class="sy-head-blur"></div> 27 <div class="sy-head-inner sy-container mx-auto"> 28 <a class="sy-head-brand" href="../../index.html"> 29 <img class="light-logo" src="../../_static/emscripten_logo_full.svg" alt="Emscripten" height="28" loading="lazy" /> 30 <img class="dark-logo" src="../../_static/emscripten_logo_full.svg" alt="Emscripten" height="28" loading="lazy" /> 31 <strong>Emscripten</strong> 32 </a> 33 <div class="sy-head-nav" id="head-nav"> 34 <nav class="sy-head-links"><ul> 35 <li class="link"><a class="js-menu" href="../index.html" id="nav-trigger-1" aria-controls="nav-children-1"> 36 <span>Documentation</span> 37 <i class="i-lucide chevron-down"></i> 38 </a> 39 <ul id="nav-children-1" aria-labelledby="nav-trigger-1"><li><a href="#">Downloads</a></li><li><a href="bug_reports.html">Report Bug</a></li><li><a href="../introducing_emscripten/emscripten_license.html">Licensing</a></li><li><a href="../contributing/contributing.html">Contributing</a></li><li><a href="../introducing_emscripten/release_notes.html">Release Notes</a></li></ul> 40 </li> 41 <li class="link"><a class="js-menu" href="../introducing_emscripten/community.html" id="nav-trigger-2" aria-controls="nav-children-2"> 42 <span>Community</span> 43 <i class="i-lucide chevron-down"></i> 44 </a> 45 <ul id="nav-children-2" aria-labelledby="nav-trigger-2"><li><a href="https://groups.google.com/forum/#!forum/emscripten-discuss">Mailing List</a></li><li><a href="https://github.com/emscripten-core/emscripten/wiki">Wiki</a></li></ul> 46 </li></ul></nav> 47 <div class="sy-head-extra flex items-center print:hidden"><form class="searchbox flex items-center" action="../../search.html" method="get"> 48 <input type="text" name="q" placeholder="Search" /> 49 <kbd>/</kbd> 50</form><div class="sy-head-socials"> 51 <a href="https://github.com/emscripten-core/emscripten" aria-label="GitHub"> 52 <iconify-icon icon="simple-icons:github"></iconify-icon> 53 </a> 54 <a href="https://discord.gg/53u3EKq" aria-label="Discord"> 55 <iconify-icon icon="simple-icons:discord"></iconify-icon> 56 </a></div></div> 57 </div> 58 <div class="sy-head-actions flex items-center shrink-0 print:hidden"><button class="js-theme theme-switch flex items-center" 59data-aria-auto="Switch to light color mode" 60data-aria-light="Switch to dark color mode" 61data-aria-dark="Switch to auto color mode"> 62<i class="i-lucide theme-icon"></i> 63</button><button class="md:hidden flex items-center js-menu" aria-label="Menu" type="button" aria-controls="head-nav" aria-expanded="false"> 64 <div class="hamburger"> 65 <span class="hamburger_1"></span> 66 <span class="hamburger_2"></span> 67 <span class="hamburger_3"></span> 68 </div> 69 </button> 70 </div> 71 </div> 72</div> 73<div class="sy-page sy-container flex mx-auto"> 74 <aside id="lside" class="sy-lside md:w-72 md:shrink-0 print:hidden"> 75 <div class="sy-lside-inner md:sticky"> 76 <div class="sy-scrollbar p-6"><div class="sidebar-links"> 77 <ul> 78 <li><a class="icon-link" href="https://github.com/emscripten-core/emscripten/discussions"> 79 <span class="icon"> 80 <svg viewBox="0 0 24 24" fill="none"> 81 <path fill="var(--accent-9)" fill-rule="evenodd" clip-rule="evenodd" d="M11 5a6 6 0 0 0-4.687 9.746c.215.27.315.62.231.954l-.514 2.058a1 1 0 0 0 1.485 1.1l2.848-1.71c.174-.104.374-.15.576-.148H13a6 6 0 0 0 0-12h-2Z"/> 82 <circle fill="white" cx="12" cy="11" r="1"/> 83 <circle fill="white" cx="9" cy="11" r="1"/> 84 <circle fill="white" cx="15" cy="11" r="1"/> 85 </svg> 86 </span> 87 <span class="text">Discussion</span> 88</a></li> 89 </ul> 90</div> 91 <div class="globaltoc" data-expand-depth="0"><ul class="current"> 92<li class="toctree-l1"><a class="reference internal" href="../introducing_emscripten/index.html">Introducing Emscripten</a><ul> 93<li class="toctree-l2"><a class="reference internal" href="../introducing_emscripten/about_emscripten.html">About Emscripten</a></li> 94<li class="toctree-l2"><a class="reference internal" href="../introducing_emscripten/community.html">Community</a></li> 95<li class="toctree-l2"><a class="reference internal" href="../introducing_emscripten/emscripten_license.html">Open Source License</a></li> 96<li class="toctree-l2"><a class="reference internal" href="../introducing_emscripten/release_notes.html">Release Notes</a></li> 97<li class="toctree-l2"><a class="reference internal" href="../introducing_emscripten/Talks-and-Publications.html">Talks and Publications</a></li> 98</ul> 99</li> 100<li class="toctree-l1 current"><a class="reference internal" href="index.html">Getting Started</a><ul class="current"> 101<li class="toctree-l2 current"><a class="current reference internal" href="#">Download and install</a></li> 102<li class="toctree-l2"><a class="reference internal" href="Tutorial.html">
102Emscripten Tutorial</a></li> 103<li class="toctree-l2"><a class="reference internal" href="test-suite.html">Emscripten Test Suite</a></li> 104<li class="toctree-l2"><a class="reference internal" href="bug_reports.html">Bug Reporting</a></li> 105<li class="toctree-l2"><a class="reference internal" href="FAQ.html">FAQ</a></li> 106</ul> 107</li> 108<li class="toctree-l1"><a class="reference internal" href="../compiling/index.html">Compiling and Running Projects</a><ul> 109<li class="toctree-l2"><a class="reference internal" href="../compiling/Building-Projects.html">Building Projects</a></li> 110<li class="toctree-l2"><a class="reference internal" href="../compiling/WebAssembly.html">Building to WebAssembly</a></li> 111<li class="toctree-l2"><a class="reference internal" href="../compiling/Modularized-Output.html">Modularized Output</a></li> 112<li class="toctree-l2"><a class="reference internal" href="../compiling/Dynamic-Linking.html">Dynamic Linking</a></li> 113<li class="toctree-l2"><a class="reference internal" href="../compiling/Running-html-files-with-emrun.html">Running HTML files with emrun</a></li> 114<li class="toctree-l2"><a class="reference internal" href="../compiling/Deploying-Pages.html">Deploying Emscripten Compiled Pages</a></li> 115<li class="toctree-l2"><a class="reference internal" href="../compiling/GitLab.html">Building and Deploying on GitLab</a></li> 116<li class="toctree-l2"><a class="reference internal" href="../compiling/Contrib-Ports.html">Emscripten Contrib Ports</a></li> 117<li class="toctree-l2"><a class="reference internal" href="../compiling/CrossOriginStorage.html">Cross-Origin Storage (COS)</a></li> 118</ul> 119</li> 120<li class="toctree-l1"><a class="reference internal" href="../porting/index.html">Porting</a><ul> 121<li class="toctree-l2"><a class="reference internal" href="../porting/guidelines/index.html">Code Portability and Limitations</a><ul> 122<li class="toctree-l3"><a class="reference internal" href="../porting/guidelines/portability_guidelines.html">Portability Guidelines</a></li> 123<li class="toctree-l3"><a class="reference internal" href="../porting/guidelines/api_limitations.html">API Limitations</a></li> 124<li class="toctree-l3"><a class="reference internal" href="../porting/guidelines/function_pointer_issues.html">Function Pointer Issues</a></li> 125<li class="toctree-l3"><a class="reference internal" href="../porting/guidelines/browser_limitations.html">Specific Browser Limitations</a></li> 126</ul> 127</li> 128<li class="toctree-l2"><a class="reference internal" href="../porting/emscripten-runtime-environment.html">Emscripten Runtime Environment</a></li> 129<li class="toctree-l2"><a class="reference internal" href="../porting/connecting_cpp_and_javascript/index.html">Connecting C++ and JavaScript</a><ul> 130<li class="toctree-l3"><a class="reference internal" href="../porting/connecting_cpp_and_javascript/Interacting-with-code.html">Interacting with code</a></li> 131<li class="toctree-l3"><a class="reference internal" href="../porting/connecting_cpp_and_javascript/embind.html">Embind</a></li> 132<li class="toctree-l3"><a class="reference internal" href="../porting/connecting_cpp_and_javascript/WebIDL-Binder.html">WebIDL Binder</a></li> 133</ul> 134</li> 135<li class="toctree-l2"><a class="reference internal" href="../porting/files/index.html">Files and File Systems</a><ul> 136<li class="toctree-l3"><a class="reference internal" href="../porting/files/file_systems_overview.html">File System Overview</a></li> 137<li class="toctree-l3"><a class="reference internal" href="../porting/files/packaging_files.html">Packaging Files</a></li> 138<li class="toctree-l3"><a class="reference internal" href="../porting/files/Synchronous-Virtual-XHR-Backed-File-System-Usage.html">Synchronous Virtual XHR Backed File System Usage</a></li> 139</ul> 140</li> 141<li class="toctree-l2"><a class="reference internal" href="../porting/multimedia_and_graphics/index.html">Multimedia and Graphics</a><ul> 142<li class="toctree-l3"><a class="reference internal" href="../porting/multimedia_and_graphics/WebGPU-support.html">Using WebGPU in Emscripten</a></li> 143<li class="toctree-l3"><a class="reference internal" href="../porting/multimedia_and_graphics/EGL-Support-in-Emscripten.html">EGL Support in Emscripten</a></li> 144<li class="toctree-l3"><a class="reference internal" href="../porting/multimedia_and_graphics/OpenGL-support.html">OpenGL support in Emscripten</a></li> 145</ul> 146</li> 147<li class="toctree-l2"><a class="reference internal" href="../porting/Audio.html">Audio</a></li> 148<li class="toctree-l2"><a class="reference internal" href="../porting/Debugging.html">Debugging</a></li> 149<li class="toctree-l2"><a class="reference internal" href="../porting/pthreads.html">Pthreads support</a></li> 150<li class="toctree-l2"><a class="reference internal" href="../porting/networking.html">Networking</a></li> 151<li class="toctree-l2"><a class="reference internal" href="../porting/simd.html">Using SIMD with WebAssembly</a></li> 152<li class="toctree-l2"><a class="reference internal" href="../porting/exceptions.html">C++ Exceptions Support</a></li> 153<li class="toctree-l2"><a class="reference internal" href="../porting/setjmp-longjmp.html">C setjmp-longjmp Support</a></li> 154<li class="toctree-l2"><a class="reference internal" href="../porting/asyncify.html">Asynchronous Code</a></li> 155<li class="toctree-l2"><a class="reference internal" href="../compiling/Building-Projects.html">Building Projects</a></li> 156</ul> 157</li> 158<li class="toctree-l1"><a class="reference internal" href="../api_reference/index.html">API Reference</a><ul> 159<li class="toctree-l2"><a class="reference internal" href="../api_reference/emscripten.h.html">emscripten.h</a></li> 160<li class="toctree-l2"><a class="reference internal" href="../api_reference/html5.h.html">html5.h</a></li> 161<li class="toctree-l2"><a class="reference internal" href="../api_reference/console.h.html">console.h</a></li> 162<li class="toctree-l2"><a class="reference internal" href="../api_reference/preamble.js.html">preamble.js</a></li> 163<li class="toctree-l2"><a class="reference internal" href="../api_reference/Filesystem-API.html">File System API</a></li> 164<li class="toctree-l2"><a class="reference internal" href="../api_reference/fetch.html">Fetch API</a></li> 165<li class="toctree-l2"><a class="reference internal" href="../api_reference/module.html">Module object</a></li> 166<li class="toctree-l2"><a class="reference internal" href="../api_reference/val.h.html">val.h</a></li> 167<li class="toctree-l2"><a class="reference internal" href="../api_reference/bind.h.html">bind.h (under-construction)</a></li> 168<li class="toctree-l2"><a class="reference internal" href="../api_reference/trace.h.html">trace.h</a></li> 169<li class="toctree-l2"><a class="reference internal" href="../api_reference/fiber.h.html">fiber.h</a></li> 170<li class="toctree-l2"><a class="reference internal" href="../api_reference/proxying.h.html">proxying.h</a></li> 171<li class="toctree-l2"><a class="reference internal" href="../api_reference/stack.h.html">stack.h</a></li> 172<li class="toctree-l2"><a class="reference internal" href="../api_reference/wasm_workers.html">Wasm Workers API</a></li> 173<li class="toctree-l2"><a class="reference internal" href="../api_reference/wasm_audio_worklets.html">Wasm Audio Worklets API</a></li> 174<li class="toctree-l2"><a class="reference internal" href="../api_reference/advanced-apis.html">Advanced APIs</a></li> 175</ul> 176</li> 177<li class="toctree-l1"><a class="reference internal" href="../tools_reference/index.html">Tools Reference</a><ul> 178<li class="toctree-l2"><a class="reference internal" href="../tools_reference/emsdk.html">Emscripten SDK (emsdk)</a></li> 179<li class="toctree-l2"><a class="reference internal" href="../tools_reference/emcc.html">Emscripten Compiler Frontend (emcc)</a></li> 180<li class="toctree-l2"><a class="reference internal" href="../tools_reference/emcmdprompt.html">Emscripten Windows Command Prompt (emcmdprompt.bat)</a></li> 181<li class="toctree-l2"><a class="reference internal" href="../tools_reference/settings_reference.html">Emscripten Compiler Settings</a></li> 182<li class="toctree-l2"><a class="reference internal" href="../tools_reference/settings_reference.html#deprecated-settings">Deprecated Settings</a></li> 183<li class="toctree-l2"><a class="reference internal" href="../tools_reference/settings_reference.html#legacy-settings">Legacy Settings</a></li> 184</ul> 185</li> 186<li class="toctree-l1"><a class="reference internal" href="../optimizing/Optimizing-Code.html">Optimizing Code</a></li> 187<li class="toctree-l1"><a class="reference internal" href="../optimizing/Optimizing-WebGL.html">Optimizing WebGL</a></li> 188<li class="toctree-l1"><a class="reference internal" href="../debugging/Sanitizers.html">Debugging with Sanitizers</a></li> 189<li class="toctree-l1"><a class="reference internal" href="../building_from_source/index.html">Building Emscripten from Source</a><ul> 190<li class="toctree-l2"><a class="reference internal" href="../building_from_source/toolchain_what_is_needed.html">Emscripten Toolchain Requirements</a></li> 191<li class="toctree-l2"><a class="reference internal" href="../building_from_source/configuring_emscripten_settings.html">Configuring Emscripten Settings when Manually Building from Source</a></li> 192<li class="toctree-l2"><a class="reference internal" href="../building_from_source/verify_emscripten_environment.html">Verifying the Emscripten Development Environment</a></li> 193</ul> 194</li> 195<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to Emscripten</a><ul> 196<li class="toctree-l2"><a class="reference internal" href="../contributing/contributing.html">Contributing</a></li> 197<li class="toctree-l2"><a class="reference internal" href="../contributing/developers_guide.html">
197Developerâs Guide</a></li> 198<li class="toctree-l2"><a class="reference internal" href="../contributing/AUTHORS.html">AUTHORS</a></li> 199</ul> 200</li> 201<li class="toctree-l1"><a class="reference internal" href="../optimizing/Profiling-Toolchain.html">Profiling the Toolchain</a></li> 202<li class="toctree-l1"><a class="reference internal" href="../site/about.html">About this site</a></li> 203<li class="toctree-l1"><a class="reference internal" href="../../genindex.html">Index</a></li> 204</ul> 205 206 </div> 207 </div> 208 </div> 209 </aside> 210 <div class="lside-overlay js-menu" role="button" aria-label="Close left sidebar" aria-controls="lside" aria-expanded="false"></div> 211 <aside id="rside" class="sy-rside pb-3 w-64 shrink-0 order-last"> 212 <button class="rside-close js-menu xl:hidden" aria-label="Close Table of Contents" type="button" aria-controls="rside" aria-expanded="false"> 213 <i class="i-lucide close"></i> 214 </button> 215 <div class="sy-scrollbar sy-rside-inner px-6 xl:top-16 xl:sticky xl:pl-0 pt-6 pb-4"><div class="localtoc"><h3>On this page</h3><ul> 216<li><a class="reference internal" href="#installation-instructions-using-the-emsdk-recommended">Installation instructions using the emsdk (recommended)</a><ul> 217<li><a class="reference internal" href="#emsdk-install-targets">Emsdk install targets</a></li> 218<li><a class="reference internal" href="#platform-specific-notes">Platform-specific notes</a><ul> 219<li><a class="reference internal" href="#windows">Windows</a></li> 220<li><a class="reference internal" href="#macos">macOS</a></li> 221<li><a class="reference internal" href="#linux">Linux</a></li> 222</ul> 223</li> 224</ul> 225</li> 226<li><a class="reference internal" href="#verifying-the-installation">Verifying the installation</a></li> 227<li><a class="reference internal" href="#updating-the-sdk">Updating the SDK</a></li> 228<li><a class="reference internal" href="#uninstalling-the-emscripten-sdk">Uninstalling the Emscripten SDK</a></li> 229<li><a class="reference internal" href="#using-the-docker-image">Using the Docker image</a></li> 230<li><a class="reference internal" href="#installation-using-unofficial-packages">Installation using unofficial packages</a></li> 231</ul> 232</div><a class="js-repo-stats repo-stats flex items-center" href="https://github.com/emscripten-core/emscripten" 233 data-type="github" data-user="emscripten-core" data-repo="emscripten"> 234 <span class="w-8 flex items-center justify-around shrink-0 text-3xl"> 235 <iconify-icon icon="simple-icons:github"></iconify-icon> 236 </span> 237 <span class="flex-grow px-2 break-all"> 238 239 240 <span>emscripten</span> 241 242 <span class="flex text-sm repo-stats-count"> 243 <span class="flex items-center pr-3"> 244 <iconify-icon icon="lucide:star"></iconify-icon> 245 <strong class="js-repo-stars ml-1">0</strong> 246 </span> 247 <span class="flex items-center"> 248 <iconify-icon icon="lucide:git-fork"></iconify-icon> 249 <strong class="js-repo-forks ml-1">0</strong> 250 </span> 251 </span> 252 </span> 253</a><div class="edit-this-page"> 254 <a href="https://github.com/emscripten-core/emscripten/blob/main/site/source/docs/getting_started/downloads.rst">Edit this page</a> 255</div><div id="ethical-ad-placement" data-ea-publisher="readthedocs"></div></div> 256 </aside> 257 <div class="rside-overlay js-menu" role="button" aria-label="Close Table of Contents" aria-controls="rside" aria-expanded="false"></div> 258 <main class="sy-main w-full max-sm:max-w-full print:pt-6"> 259<div class="sy-breadcrumbs" role="navigation"> 260 <div class="sy-breadcrumbs-inner flex items-center"> 261 <div class="md:hidden mr-3"> 262 <button class="js-menu" aria-label="Menu" type="button" aria-controls="lside" aria-expanded="false"> 263 <i class="i-lucide menu"></i> 264 </button> 265 </div> 266 <ol class="flex-1" itemscope itemtype="https://schema.org/BreadcrumbList"><li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"> 267 <a itemprop="item" href="../../index.html"><span itemprop="name">Emscripten</span></a> 268 <span>/</span> 269 <meta itemprop="position" content="1" /> 270 </li><li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"> 271 <a itemprop="item" href="index.html"><span itemprop="name">Getting Started</span></a>
272 <span>/</span> 273 <meta itemprop="position" content="2" /> 274 </li><li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"> 275 <strong itemprop="name">Download and install</strong> 276 <meta itemprop="position" content="3" /> 277 </li></ol> 278 <div class="xl:hidden ml-1"> 279 <button class="js-menu" aria-label="Show table of contents" type="button" aria-controls="rside" 280 aria-expanded="false"> 281 <i class="i-lucide outdent"></i> 282 </button> 283 </div> 284 </div> 285</div><div class="flex flex-col break-words justify-between"> 286 <div class="relative min-w-0 max-w-6xl px-6 pb-6 pt-8 xl:px-12"> 287 <article class="yue" role="main"> 288 <section id="download-and-install"> 289<span id="sdk-download-and-install"></span><h1>Download and install<a class="headerlink" href="#download-and-install" title="Link to this heading">¶</a></h1> 290<div class="admonition note"> 291<p class="admonition-title">Note</p> 292<p>You can also <a class="reference internal" href="../building_from_source/index.html#installing-from-source"><span class="std std-ref">build Emscripten from source</span></a> if you prefer that to downloading binaries using 293the emsdk.</p> 294</div> 295<div class="admonition tip"> 296<p class="admonition-title">Tip</p> 297<p>If youâd like to install emscripten using the <strong>unofficial</strong> packages 298instead of the <strong>officially supported</strong> emsdk, see the bottom of the page.</p> 299</div> 300<section id="installation-instructions-using-the-emsdk-recommended"> 301<span id="sdk-installation-instructions"></span><h2>Installation instructions using the emsdk (recommended)<a class="headerlink" href="#installation-instructions-using-the-emsdk-recommended" title="Link to this heading">¶</a></h2> 302<p>First, check the <a class="reference internal" href="#platform-notes-installation-instructions-sdk"><span class="std std-ref">Platform-specific notes</span></a> below and install any 303prerequisites.</p> 304<p>The core Emscripten SDK (emsdk) driver is a Python script. You can get it for 305the first time with:</p> 306<blockquote> 307<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span data-line="1"><span class="c1"># Get the emsdk repo</span> 308</span><span data-line="2"><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">
308com</span><span class="o">/</span><span class="n">emscripten</span><span class="o">-</span><span class="n">core</span><span class="o">/</span><span class="n">emsdk</span><span class="o">.</span><span class="n">git</span> 309</span><span data-line="3"> 310</span><span data-line="4"><span class="c1"># Enter that directory</span> 311</span><span data-line="5"><span class="n">cd</span> <span class="n">emsdk</span> 312</span></pre></div> 313</div> 314</div></blockquote> 315<div class="admonition note"> 316<p class="admonition-title">Note</p> 317<p>You can also get the emsdk without git, by selecting âClone or 318download => Download ZIPâ on the <a class="reference external" href="https://github.com/emscripten-core/emsdk">emsdk GitHub page</a>.</p> 319</div> 320<p>Run the following <a class="reference internal" href="../tools_reference/emsdk.html#emsdk"><span class="std std-ref">emsdk</span></a> commands to get the latest tools from 321GitHub and set them as <a class="reference internal" href="../site/glossary.html#term-Active-Tool-SDK"><span class="xref std std-term">active</span></a>:</p> 322<blockquote> 323<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span data-line="1"><span class="c1"># Fetch the latest version of the emsdk (not needed the first time you clone)</span> 324</span><span data-line="2"><span class="n">git</span> <span class="n">pull</span> 325</span><span data-line="3"> 326</span><span data-line="4"><span class="c1"># Download and install the latest SDK tools.</span> 327</span><span data-line="5"><span class="o">./</span><span class="n">emsdk</span> <span class="n">install</span> <span class="n">latest</span> 328</span><span data-line="6"> 329</span><span data-line="7"><span class="c1"># Make the "latest" SDK "active" for the current user. (writes .emscripten file)</span> 330</span><span data-line="8"><span class="o">./</span><span class="n">emsdk</span> <span class="n">activate</span> <span class="n">latest</span> 331</span><span data-line="9"> 332</span><span data-line="10"><span class="c1"># Activate PATH and other environment variables in the current terminal</span> 333</span><span data-line="11"><span class="n">source</span> <span class="o">./</span><span class="n">emsdk_env</span><span class="o">.</span><span class="n">sh</span> 334</span></pre></div> 335</div> 336<div class="admonition tip"> 337<p class="admonition-title">Tip</p> 338<p>If you want to avoid executing <cite>source ./emsdk_env.sh</cite> every time you open a new terminal, you can follow the instructions given by the <cite>emsdk activate</cite> command above to add this command to your startup scripts.</p> 339</div> 340<div class="admonition note"> 341<p class="admonition-title">Note</p> 342<p>On Windows, run <code class="docutils literal notranslate"><span class="pre">emsdk.bat</span></code> instead of <code class="docutils literal notranslate"><span class="pre">./emsdk</span></code>, and <code class="docutils literal notranslate"><span class="pre">emsdk_env.bat</span></code> instead of <code class="docutils literal notranslate"><span class="pre">source</span> <span class="pre">./emsdk_env.sh</span></code>.</p> 343</div> 344<div class="admonition note"> 345<p class="admonition-title">Note</p> 346<p>On Windows, if you use the <code class="docutils literal notranslate"><span class="pre">activate</span></code> command, the step of <code class="docutils literal notranslate"><span class="pre">emsdk_env.bat</span></code> is optional. If you want to know more, see <a class="reference internal" href="../tools_reference/emsdk.html#emsdk-set-active-tools"><span class="std std-ref">activate SDK version</span></a>.</p> 347</div> 348<div class="admonition note"> 349<p class="admonition-title">Note</p> 350<p><code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">pull</span></code> will fetch the current list of tags, but very recent ones may not yet be present there. You can run <code class="docutils literal notranslate"><span class="pre">./emsdk</span> <span class="pre">update-tags</span></code> to update the list of tags directly.</p> 351</div> 352</div></blockquote> 353<p>If you change the location of the SDK (e.g. take it to another computer on a 354USB), re-run the <code class="docutils literal notranslate"><span class="pre">./emsdk</span> <span class="pre">activate</span> <span class="pre">latest</span></code> and <code class="docutils literal notranslate"><span class="pre">source</span> <span class="pre">./emsdk_env.sh</span></code> 355commands.</p> 356<section id="emsdk-install-targets"> 357<h3>Emsdk install targets<a class="headerlink" href="#emsdk-install-targets" title="Link to this heading">¶</a></h3> 358<p>In the description above, we asked the emsdk to install and activate <code class="docutils literal notranslate"><span class="pre">latest</span></code>, 359which is the latest tagged release. That is often what you want.</p> 360<p>You can also install a specific version by specifying it, for example,</p> 361<blockquote> 362<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span data-line="1"><span class="o">./</span><span class="n">emsdk</span> <span class="n">install</span> <span class="mf">1.38.45</span> 363</span></pre></div> 364</div> 365</div></blockquote> 366<div class="admonition note"> 367<p class="admonition-title">Note</p> 368<p>
368When installing old versions from before the build infrastructure 369rewrite (anything before <code class="docutils literal notranslate"><span class="pre">1.38.33</span></code>), you need to write something like 370<code class="docutils literal notranslate"><span class="pre">./emsdk</span> <span class="pre">install</span> <span class="pre">sdk-1.38.20-64bit</span></code> (add <code class="docutils literal notranslate"><span class="pre">sdk-</span></code> and <code class="docutils literal notranslate"><span class="pre">-64bit</span></code>) as that 371was the naming convention at the time.</p> 372</div> 373<p>There are also âtip-of-tree buildsâ, which are the very latest code that passes 374integration tests on <a class="reference external" href="https://ci.chromium.org/p/emscripten-releases">Chromium CI</a>. This is updated much more 375frequently than tagged releases, but may be less stable (we <a class="reference external" href="https://github.com/emscripten-core/emscripten/blob/main/docs/process.md#minor-version-updates-1xy-to-1xy1">tag releases 376manually</a> 377using a more careful procedure). Tip-of-tree builds may be useful for continuous 378integration that uses the emsdk (as Emscriptenâs GitHub CI does), and you may 379want to use it in your own CI as well, so that if you find a regression on your 380project you can report it and prevent it from reaching a tagged release. 381Tip-of-tree builds may also be useful if you want to test a feature that just landed 382but didnât reach a release yet. To use a tip-of-tree build, use the <code class="docutils literal notranslate"><span class="pre">tot</span></code> 383target, and note that you must specify the backend explicitly,</p> 384<blockquote> 385<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span data-line="1"><span class="c1"># Get a tip-of-tree</span> 386</span><span data-line="2"><span class="o">./</span><span class="n">emsdk</span> <span class="n">install</span> <span class="n">tot</span> 387</span></pre></div> 388</div> 389</div></blockquote> 390<p>(In the above examples, we installed the various targets; remember to also 391<code class="docutils literal notranslate"><span class="pre">activate</span></code> them as in the full example from earlier.)</p> 392</section> 393<section id="platform-specific-notes"> 394<span id="platform-notes-installation-instructions-sdk"></span><h3>Platform-specific notes<a class="headerlink" href="#platform-specific-notes" title="Link to this heading">¶</a></h3> 395<section id="windows"> 396<h4>Windows<a class="headerlink" href="#windows" title="Link to this heading">¶</a></h4> 397<ol class="arabic simple"> 398<li><p>Install Python 3.8 or newer.</p></li> 399</ol> 400<blockquote> 401<div><div class="admonition note"> 402<p class="admonition-title">Note</p> 403<p>Instead of running emscripten on Windows directly, you can use the 404Windows Subsystem for Linux to run it in a Linux environment.</p> 405</div> 406</div></blockquote> 407</section> 408<section id="macos"> 409<h4>macOS<a class="headerlink" href="#macos" title="Link to this heading">¶</a></h4> 410<div class="admonition note"> 411<p class="admonition-title">Note</p> 412<p>Emscripten requires macOS 10.14 Mojave or above.</p> 413</div> 414<p>If you use the Emscripten SDK, it includes a bundled version of Python 3. 415Otherwise, you will need to manually install and use Python 3.8 or newer.</p> 416<p>These instructions explain how to install <strong>all</strong> the <a class="reference internal" href="../building_from_source/toolchain_what_is_needed.html#toolchain-what-you-need"><span class="std std-ref">required tools</span></a>. You can <a class="reference internal" href="../building_from_source/toolchain_what_is_needed.html#toolchain-test-which-dependencies-are-installed"><span class="std std-ref">test whether some of these are already 417installed</span></a> on the platform and 418skip those steps.</p> 419<ol class="arabic simple"> 420<li><p>Install the <em>Xcode Command Line Tools</em>. These are a precondition for <em>git</em>.</p></li> 421</ol> 422<blockquote> 423<div><ul class="simple"> 424<li><p>Install Xcode from the <a class="reference external" href="http://superuser.com/questions/455214/where-is-svn-on-os-x-mountain-lion">macOS App Store</a>.</p></li> 425<li><p>In <strong>Xcode | Preferences | Downloads</strong>, install <em>Command Line Tools</em>
425.</p></li> 426</ul> 427</div></blockquote> 428<ol class="arabic simple"> 429<li><p>Install <em>git</em>:</p></li> 430</ol> 431<blockquote> 432<div><ul class="simple"> 433<li><p><a class="reference external" href="https://support.apple.com/en-gb/HT202491">Make sure the OS allows installing git</a>.</p></li> 434<li><p>Install Xcode and the Xcode Command Line Tools (should already have been done). This will provide <em>git</em> to the system PATH (see <a class="reference external" href="http://stackoverflow.com/questions/9329243/xcode-4-4-command-line-tools">this stackoverflow post</a>).</p></li> 435<li><p>Download and install git directly from <a class="reference external" href="http://git-scm.com/">http://git-scm.com/</a>.</p></li> 436</ul> 437</div></blockquote> 438<ol class="arabic simple"> 439<li><p>Install <em>cmake</em> if you do not have it yet:</p></li> 440</ol> 441<blockquote> 442<div><ul class="simple"> 443<li><p>Download and install latest CMake from <a class="reference external" href="http://www.cmake.org/download/">Kitware CMake downloads</a>.</p></li> 444</ul> 445</div></blockquote> 446</section> 447<section id="linux"> 448<h4>Linux<a class="headerlink" href="#linux" title="Link to this heading">¶</a></h4> 449<div class="admonition note"> 450<p class="admonition-title">Note</p> 451<p><em>Emsdk</em> does not install any tools to the system, or otherwise 452interact with Linux package managers. All file changes are done inside the 453<strong>emsdk/</strong> directory.</p> 454</div> 455<ul> 456<li><p><em>Python</em> is not provided by <em>emsdk</em>. The user is expected to install this 457beforehand with the <em>system package manager</em>:</p> 458<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span data-line="1"><span class="c1"># Install Python</span> 459</span><span data-line="2"><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">python3</span> 460</span><span data-line="3"> 461</span><span data-line="4"><span class="c1"># Install CMake (optional, only needed for tests and building Binaryen or LLVM)</span> 462</span><span data-line="5"><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">cmake</span> 463</span></pre></div> 464</div> 465</li> 466<li><p><em>Git</em> is not installed automatically. Git is only needed if you want to use tools from a development branch.</p> 467<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span data-line="1"><span class="c1"># Install git</span> 468</span><span data-line="2"><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">git</span> 469</span></pre></div> 470</div> 471</li> 472</ul> 473</section> 474</section> 475</section> 476<section id="verifying-the-installation"> 477<h2>Verifying the installation<a class="headerlink" href="#verifying-the-installation" title="Link to this heading">¶</a></h2> 478<p>The easiest way to verify the installation is to compile some code using 479Emscripten.</p> 480<p>You can jump ahead to the <a class="reference internal" href="Tutorial.html#tutorial"><span class="std std-ref">Emscripten Tutorial</span></a>, but if you have any problems building 481you should run through the basic tests and troubleshooting instructions in 482<a class="reference internal" href="../building_from_source/verify_emscripten_environment.html#verifying-the-emscripten-environment"><span class="std std-ref">Verifying the Emscripten Development Environment</span></a>.</p> 483</section> 484<section id="updating-the-sdk"> 485<span id="updating-the-emscripten-sdk"></span><h2>Updating the SDK<a class="headerlink" href="#updating-the-sdk" title="Link to this heading">¶</a></h2> 486<div class="admonition tip"> 487<p class="admonition-title">Tip</p> 488<p>You only need to install the SDK once! After that you can update to the 489latest SDK at any time using <a class="reference internal" href="../tools_reference/emsdk.html#emsdk"><span class="std std-ref">Emscripten SDK (emsdk)</span></a>.</p> 490</div> 491<p>Type the following in a command prompt</p> 492<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span data-line="1"><span class="c1"># Fetch the latest registry of available tools.</span> 493</span><span data-line="2"><span class="o">./</span><span class="n">emsdk</span> <span class="n">update</span> 494</span><span data-line="3"> 495</span><span data-line="4"><span class="c1"># Download and install the latest SDK tools.</span> 496</span><span data-line="5"><span class="o">./</span><span class="n">emsdk</span> <span class="n">install</span> <span class="n">latest</span> 497</span><span data-line="6"> 498</span><span data-line="7"><span class="c1"># Set up the compiler configuration to point to the "latest" SDK.</span> 499</span><span data-line="8"><span class="o">./</span><span class="n">emsdk</span> <span class="n">activate</span> <span class="n">latest</span> 500</span><span data-line="9"> 501</span><span data-line="10"><span class="c1"># Activate PATH and other environment variables in the current terminal</span> 502</span><span data-line="11"><span class="n">source</span> <span class="o">./</span><span class="n">emsdk_env</span><span class="o">.</span><span class="n">sh</span> 503</span></pre></div> 504</div> 505<p>The package manager can do many other maintenance tasks ranging from fetching 506specific old versions of the SDK through to using the <a class="reference internal" href="../tools_reference/emsdk.html#emsdk-dev-sdk"><span class="std std-ref">versions of the 507tools on GitHub</span></a> (or even your own fork). Check out all the 508possibilities in the <a class="reference internal" href="../tools_reference/emsdk.html#emsdk-howto"><span class="std std-ref">âHow toâ guides</span></a>.</p> 509</section> 510<section id="uninstalling-the-emscripten-sdk"> 511<span id="downloads-uninstall-the-sdk"></span><h2>Uninstalling the Emscripten SDK<a class="headerlink" href="#uninstalling-the-emscripten-sdk" title="Link to this heading">¶</a></h2> 512<p>If you want to remove the whole SDK, just delete the directory containing the 513SDK.</p> 514<p>It is also possible to <a class="reference internal" href="../tools_reference/emsdk.html#emsdk-remove-tool-sdk"><span class="std std-ref">remove specific tools in the SDK using emsdk</span></a>.</p> 515</section> 516<section id="using-the-docker-image"> 517<h2>Using the Docker image<a class="headerlink" href="#using-the-docker-image" title="Link to this heading">¶</a></h2> 518<p>The entire Emscripten SDK is also available in the form of a <a class="reference external" href="https://hub.docker.com/r/emscripten/emsdk">docker image</a>. For example:</p> 519<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span data-line="1">docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) \ 520</span><span data-line="2"> emscripten/emsdk emcc helloworld.cpp -o helloworld.js 521</span></pre></div> 522</div> 523<p>See the Docker Hub page for more details and examples.</p> 524</section> 525<section id="installation-using-unofficial-packages"> 526<h2>Installation using unofficial packages<a class="headerlink" href="#installation-using-unofficial-packages" title="Link to this heading">¶</a></h2> 527<div class="admonition note"> 528<p class="admonition-title">Note</p> 529<p>The <cite>emsdk</cite> is the only officially supported way to use 530Emscripten that is supported by the Emscripten project, and the only one 531that we constantly test 532(<a class="reference external" href="https://github.com/emscripten-core/emsdk/blob/main/.circleci/config.yml">emsdk CI</a>, 533<a class="reference external" href="https://github.com/emscripten-core/emscripten/blob/main/.circleci/config.yml">Emscripten GitHub CI</a>, 534<a class="reference external" href="https://ci.chromium.org/p/emscripten-releases">Chromium CI</a>).</p> 535</div> 536<p>While we donât officially support other ways of getting Emscripten, we definitely 537appreciate the efforts by third parties to 538<a class="reference external" href="https://github.com/emscripten-core/emscripten/blob/main/docs/packaging.md">package Emscripten</a> 539for usersâ convenience, and weâd like to help out, please get in touch if 540you are such a packager!</p> 541<p>The following is a partial list of such unofficial emscripten packages:</p> 542<dl class="simple"> 543<dt><strong>Windows</strong></dt><dd><ul class="simple"> 544<li><p>package info: <cite>emscripten</cite> in <a class="reference external" href="https://chocolatey.org/packages/emscripten">chocolatey</a></p></li> 545<li><p>maintainer: @aminya</p></li> 546</ul> 547</dd> 548<dt><strong>Homebrew</strong></dt><dd><ul class="simple"> 549<li><p>package info: <a class="reference external" href="https://formulae.brew.sh/formula/emscripten">https://formulae.brew.sh/formula/emscripten</a></p></li> 550<li><p>maintainer: @chenrui333</p></li> 551</ul> 552</dd> 553<dt><strong>Arch Linux</strong></dt><dd><ul class="simple"> 554<li><p>package info: <a class="reference external" href="https://archlinux.org/packages/extra/x86_64/emscripten">https://archlinux.org/packages/extra/x86_64/emscripten</a></p></li> 555<li><p>maintainer: Sven-Hendrik Haase <<a class="reference external" href="mailto:svenstaro%40archlinux.org">svenstaro<span>@</span>archlinux<span>.</span>org</a>></p></li> 556</ul> 557</dd> 558</dl> 559</section> 560</section> 561 562 </article><button class="back-to-top" type="button"> 563 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> 564 <path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path> 565 </svg> 566 <span>Back to top</span> 567</button><div class="navigation flex print:hidden"><div class="navigation-prev"> 568 <a href="index.html"> 569 <i class="i-lucide chevron-left"></i> 570 <div class="page-info">
571 <span>Previous</span><div class="title">Getting Started</div></div> 572 </a> 573 </div><div class="navigation-next"> 574 <a href="Tutorial.html"> 575 <div class="page-info"> 576 <span>Next</span> 577 <div class="title">Emscripten Tutorial</div> 578 </div> 579 <i class="i-lucide chevron-right"></i> 580 </a> 581 </div></div></div> 582 </div> 583 </main> 584</div> 585<footer class="sy-foot"> 586 <div class="sy-foot-inner sy-container mx-auto"> 587 <div class="sy-foot-reserved md:flex justify-between items-center"> 588 <div class="sy-foot-copyright"><p>Copyright © 2015, Emscripten Contributors.</p> 589 590 <p> 591 Made with 592 593 <a href="https://www.sphinx-doc.org/">Sphinx</a> and 594 595 <a href="https://shibuya.lepture.com">Shibuya theme</a>. 596 </p> 597</div> 598 <div class="sy-foot-socials"> 599<a href="https://github.com/emscripten-core/emscripten" aria-label="GitHub"> 600 <iconify-icon icon="simple-icons:github"></iconify-icon> 601</a> 602<a href="https://discord.gg/53u3EKq" aria-label="Discord"> 603 <iconify-icon icon="simple-icons:discord"></iconify-icon> 604</a></div> 605 </div> 606 </div> 607</footer> 608
608<script src="../../_static/jquery.js?v=5d32c60e"></script>
608 609
609<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
609 610
610<script src="../../_static/documentation_options.js?v=02d30c87"></script>
610 611
611<script src="../../_static/doctools.js?v=9a2dae69"></script>
611 612
612<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
612 613
613<script src="../../_static/design-tabs.js?v=f930bc37"></script>
613 614
614<script src="../../_static/shibuya.js?v=50760d75"></script>
614</body> 615</html>
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.