Skip to content

Mac 安装 emscripten 编译报 OSError: [Errno 2] No such file or directory #4

@unbug

Description

@unbug

官网安装 emsdk 的方法比较慢,可以直接安装 emscripten brew install emscripten.
安装完底部有提示需要修改手动修改 ~/.emscripten.

LLVM_ROOT = os.path.expanduser(os.getenv('LLVM') or '/usr/bin') # directory
BINARYEN_ROOT = os.path.expanduser(os.getenv('BINARYEN') or '') # directory

修改成

LLVM_ROOT = os.path.expanduser(os.getenv('LLVM') or '/usr/local/opt/emscripten/libexec/llvm/bin') # directory
#BINARYEN_ROOT = os.path.expanduser(os.getenv('BINARYEN') or '') # directory

再运行 emcc -v

在编译过程中,如 emcc hello.c -s WASM=1 -o hello.html,可能会报 OSError: [Errno 2] No such file or directory 的错误,安装 brew install cmake 搞定!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions