{"id":14981518,"url":"https://github.com/figma/emsdk","last_synced_at":"2025-10-02T22:31:40.998Z","repository":{"id":65660292,"uuid":"481700390","full_name":"figma/emsdk","owner":"figma","description":"Emscripten SDK","archived":false,"fork":true,"pushed_at":"2024-07-19T15:13:39.000Z","size":2268,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-29T05:41:42.090Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://emscripten.org","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"emscripten-core/emsdk","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/figma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-14T17:57:04.000Z","updated_at":"2023-07-17T21:43:12.000Z","dependencies_parsed_at":"2023-02-18T01:00:44.310Z","dependency_job_id":null,"html_url":"https://github.com/figma/emsdk","commit_stats":null,"previous_names":[],"tags_count":74,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/figma%2Femsdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/figma%2Femsdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/figma%2Femsdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/figma%2Femsdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/figma","download_url":"https://codeload.github.com/figma/emsdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235049009,"owners_count":18927715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T14:03:45.055Z","updated_at":"2025-10-02T22:31:35.703Z","avatar_url":"https://github.com/figma.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Emscripten SDK\n==============\n\n[![CircleCI](https://circleci.com/gh/emscripten-core/emsdk/tree/main.svg?style=svg)](https://circleci.com/gh/emscripten-core/emsdk/tree/main)\n\nThe Emscripten toolchain is distributed as a standalone Emscripten SDK. The SDK\nprovides all the required tools, such as Clang, Python and Node.js along with an\nupdate mechanism that enables migrating to newer Emscripten versions as they are\nreleased.\n\nYou can also set up Emscripten from source, without the pre-built SDK, see\n\"Installing from Source\" below.\n\n## Downloads / How do I get the latest Emscripten build?\n\nTo get started with Emscripten development, see the [Emscripten website\ndocumentation](https://emscripten.org/docs/getting_started/downloads.html).\n\nThat explains how to use the emsdk to get the latest binary builds (without\ncompiling from source). Basically, that amounts to\n\n```\n./emsdk install latest\n./emsdk activate latest\n```\n\n## SDK Concepts\n\nThe Emscripten SDK is effectively a small package manager for tools that are\nused in conjunction with Emscripten. The following glossary highlights the\nimportant concepts to help understanding the internals of the SDK:\n\n* **Tool**: The basic unit of software bundled in the SDK. A Tool has a name and\n  a version. For example, 'clang-3.2-32bit' is a Tool that contains the 32-bit\n  version of the Clang v3.2 compiler.\n* **SDK**: A set of tools. For example, 'sdk-1.5.6-32bit' is an SDK consisting\n  of the tools `clang-3.2-32bit`, `node-0.10.17-32bit`, `python-2.7.5.1-32bit`\n  and `emscripten-1.5.6`.\n* **Active Tool/SDK**: Emscripten SDK stores compiler configuration in a file\n  called `.emscripten` within the emsdk directory. This file points to paths\n  for Emscripten, Python, Clang and so on. If the configuration file points to a\n  Tool in a specific directory, then that tool is denoted as being\n  **active**. This mechanism allows switching between different installed\n  tools and SDKs.\n* **emsdk**: This is the name of the manager script that Emscripten SDK is\n  accessed through. Most operations are of the form `emsdk \u003ccommand\u003e`.\n\n## System Requirements\n\nUsing the emsdk pre-compiled packages requires only the minimal set of\ndependenencies lists below.  When building from source a wider set of tools\ninclude git, cmake, and a host compiler are required. See:\nhttps://emscripten.org/docs/building_from_source/toolchain_what_is_needed.html.\n\n### Mac OS X\n\n- For Intel-based Macs, macOS 10.13 or newer. For ARM64 M1 based Macs, macOS\n  11.0 or newer.\n- `java`: For running closure compiler (optional).  After installing emscripten\n  via emsdk, typing 'emcc --help' should pop up a OS X dialog \"Java is not\n  installed. To open java, you need a Java SE 6 runtime. Would you like to\n  install one now?\" that will automatically download a Java runtime to the\n  system.\n\n### Linux\n\n- `python`: Version 2.7.0 or above.\n- `java`: For running closure compiler (optional)\n\nThe emsdk pre-compiled binaries are built aginst Ubuntu/Xenial 16.04 LTS and\ntherefore depend on system libraries compatiable with versions of `glibc` and\n`libstdc++` present in that release.  If your linux distribution is very old\nyou may not be able to use the pre-compiled binaries packages.\n\n### Windows\n\n- `java`: For running closure compiler (optional)\n\n## Uninstalling the Emscripten SDK\n\nTo remove the Emscripten SDK, simply delete the emsdk directory.\n\n## SDK Maintenance\n\nThe following tasks are common with the Emscripten SDK:\n\n### How do I work the emsdk utility?\n\nRun `emsdk help` or just `emsdk` to get information about all available commands.\n\n### How do I check the installation status and version of the SDK and tools?\n\nTo get a list of all currently installed tools and SDK versions, and all\navailable tools, run `emsdk list`.\n* A line will be printed for each tool/SDK that is available for installation.\n* The text `INSTALLED` will be shown for each tool that has already been\n  installed.\n* If a tool/SDK is currently active, a star * will be shown next to it.\n* If a tool/SDK is currently active, but the terminal your are calling emsdk\n  from does not have `PATH` and environment set up to utilize that tool, a star\n  in parentheses (\\*) will be shown next to it. Run `emsdk_env.bat` (Windows) or\n  `source ./emsdk_env.sh` (Linux and OS X) to set up the environment for the\n  calling terminal.\n\n### How do I install a tool/SDK version?\n\nRun the command `emsdk install \u003ctool/sdk name\u003e` to download and install a new\ntool or an SDK version.\n\n### How do I remove a tool or an SDK?\n\nRun the command `emsdk uninstall \u003ctool/sdk name\u003e` to delete the given tool or\nSDK from the local hard drive completely.\n\n### How do I check for updates to the Emscripten SDK?\n\n`emsdk update` will fetch package information for all the new tools and\nSDK versions. After that, run `emsdk install \u003ctool/sdk name\u003e` to install a new\nversion.\n\n### How do I install an old Emscripten compiler version?\n\nEmsdk contains a history of old compiler versions that you can use to maintain\nyour migration path. Type `emsdk list --old` to get a list of archived tool and\nSDK versions, and `emsdk install \u003cname_of_tool\u003e` to install it.\n\n### I want to build from source!\n\nSome Emsdk Tool and SDK targets refer to packages that are precompiled, and\nno compilation is needed when installing them. Other Emsdk Tools and SDK\ntargets come \"from source\", meaning that they will fetch the source repositories\nusing git, and compile the package on demand.\n\nWhen you run `emsdk list`, it will group the Tools and SDKs under these two\ncategories.\n\nTo obtain and build latest wasm SDK from source, run\n\n```\nemsdk install sdk-main-64bit\nemsdk activate sdk-main-64bit\n```\n\nYou can use this target for example to bootstrap developing patches to LLVM,\nBinaryen or Emscripten. (After initial installation, use `git remote add`\nin the cloned tree to add your own fork to push changes as patches)\n\nIf you only intend to contribute to Emscripten repository, and not to LLVM\nor Binaryen, you can also use precompiled versions of them, and only git\nclone the Emscripten repository. For more details, see\n\nhttps://emscripten.org/docs/contributing/developers_guide.html?highlight=developer#setting-up\n\n### When working on git branches compiled from source, how do I update to a newer compiler version?\n\nUnlike tags and precompiled versions, a few of the SDK packages are based on\n\"moving\" git branches and compiled from source (e.g. sdk-main,\nsdk-main, emscripten-main, binaryen-main). Because of that, the\ncompiled versions will eventually go out of date as new commits are introduced\nto the development branches. To update an old compiled installation of one of\nthis branches, simply reissue the \"emsdk install\" command on that tool/SDK. This\nwill `git pull` the latest changes to the branch and issue an incremental\nrecompilation of the target in question. This way you can keep calling `emsdk\ninstall` to keep an Emscripten installation up to date with a given git branch.\n\nNote though that if the previously compiled branch is very old, sometimes CMake\ngets confused and is unable to properly rebuild a project. This has happened in\nthe past e.g. when LLVM migrated to requiring a newer CMake version. In cases of\nany odd compilation errors, it is advised to try deleting the intermediate build\ndirectory to clear the build (e.g. \"emsdk/clang/fastcomp/build_xxx/\") before\nreissuing `emsdk install`.\n\n### How do I change the currently active SDK version?\n\nYou can toggle between different tools and SDK versions by running `emsdk\nactivate \u003ctool/sdk name\u003e`. Activating a tool will set up `~/.emscripten` to\npoint to that particular tool. On Windows, you can pass the option `--permanent` to\nthe `activate` command to register the environment permanently for the current user. Use `--system` to do this for all users.\n\n### How do I track the latest Emscripten development with the SDK?\n\nA common and supported use case of the Emscripten SDK is to enable the workflow\nwhere you directly interact with the github repositories. This allows you to\nobtain new features and latest fixes immediately as they are pushed to the\ngithub repository, without having to wait for release to be tagged. You do not\nneed a github account or a fork of Emscripten to do this. To switch to using the\nlatest git development branch `main`, run the following:\n\n    emsdk install git-1.9.4 # Install git. Skip if the system already has it.\n    emsdk install sdk-main-64bit # Clone+pull the latest emscripten-core/emscripten/main.\n    emsdk activate sdk-main-64bit # Set the main SDK as the currently active one.\n\n### How do I use my own Emscripten github fork with the SDK?\n\nIt is also possible to use your own fork of the Emscripten repository via the\nSDK. This is achieved with standard git machinery, so there if you are already\nacquainted with working on multiple remotes in a git clone, these steps should\nbe familiar to you. This is useful in the case when you want to make your own\nmodifications to the Emscripten toolchain, but still keep using the SDK\nenvironment and tools. To set up your own fork as the currently active\nEmscripten toolchain, first install the `sdk-main` SDK like shown in the\nprevious section, and then run the following commands in the emsdk directory:\n\n    cd emscripten/main\n    # Add a git remote link to your own repository.\n    git remote add myremote https://github.com/mygituseraccount/emscripten.git\n    # Obtain the changes in your link.\n    git fetch myremote\n    # Switch the emscripten-main tool to use your fork.\n    git checkout -b mymain --track myremote/main\n\nIn this way you can utilize the Emscripten SDK tools while using your own git\nfork. You can switch back and forth between remotes via the `git checkout`\ncommand as usual.\n\n### How do I use Emscripten SDK with a custom version of python, java, node.js or some other tool?\n\nThe provided Emscripten SDK targets are metapackages that refer to a specific\nset of tools that have been tested to work together. For example,\n`sdk-1.35.0-64bit` is an alias to the individual packages `clang-e1.35.0-64bit`,\n`node-4.1.1-64bit`, `python-2.7.5.3-64bit` and `emscripten-1.35.0`. This means\nthat if you install this version of the SDK, both python and node.js will be\ninstalled inside emsdk as well. If you want to use your own/system python or\nnode.js instead, you can opt to install emsdk by specifying the individual set\nof packages that you want to use. For example, `emsdk install\nclang-e1.35.0-64bit emscripten-1.35.0` will only install the Emscripten\nLLVM/Clang compiler and the Emscripten frontend without supplying python and\nnode.js.\n\n### My installation fails with \"fatal error: ld terminated with signal 9 [Killed]\"?\n\nThis may happen if the system runs out of memory. If you are attempting to build\none of the packages from source and are running in a virtual OS or may have\nrelatively little RAM and disk space available, then the build might fail. Try\nfeeding your computer more memory. Another thing to try is to force emsdk\ninstall to build in a singlethreaded mode, which will require less RAM\nsimultaneously. To do this, pass the `-j1` flag to the `emsdk install` command.\n\n### How do I run Emscripten on 32-bit systems or non-x86-64 systems?\n\nEmscripten SDK releases are no longer packaged or maintained for 32-bit systems.\nIf you want to run Emscripten on a 32-bit system, you can try manually building\nthe compiler. Follow the steps in the above section \"Building an Emscripten tag\nor branch from source\" to get started.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffigma%2Femsdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffigma%2Femsdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffigma%2Femsdk/lists"}