WebAssembly演示指南因丢失文件而失败

时间:2016-11-16 06:35:20

标签: c++ emscripten webassembly

按照开发人员指南的步骤,我在MAC上失败了。

http://webassembly.org/getting-started/developers-guide/

我有一个干净的mac安装10.11.6 (15G31),这是日志。


    Mac-MBP:emsdk_portable wasm$ ./emsdk activate clang-incoming-64bit emscripten-incoming-64bit sdk-incoming-64bit
    Writing .emscripten configuration file to user home directory /Users/wasm/
    The Emscripten configuration file /Users/wasm/.emscripten has been rewritten with the following contents:

    import os
    LLVM_ROOT='/Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin'
    NODE_JS='/Users/wasm/repo/webassembly/emsdk_portable/node/4.1.1_64bit/bin/node'
    EMSCRIPTEN_ROOT='/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming'
    EMSCRIPTEN_NATIVE_OPTIMIZER='/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming_64bit_optimizer/optimizer'
    SPIDERMONKEY_ENGINE = ''
    V8_ENGINE = ''
    TEMP_DIR = '/var/folders/wk/mngy_vmn0xs6j32tm53vvg7m0000gn/T'
    COMPILER_ENGINE = NODE_JS
    JS_ENGINES = [NODE_JS]

    To conveniently access the selected set of tools from the command line, consider adding the following directories to PATH, or call 'source ./emsdk_env.sh' to do this for you.

       /Users/wasm/repo/webassembly/emsdk_portable:/Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin:/Users/wasm/repo/webassembly/emsdk_portable/node/4.1.1_64bit/bin:/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming
    Mac-MBP:emsdk_portable wasm$ source ./emsdk_env.sh
    Adding directories to PATH:
    PATH += /Users/wasm/repo/webassembly/emsdk_portable
    PATH += /Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin
    PATH += /Users/wasm/repo/webassembly/emsdk_portable/node/4.1.1_64bit/bin
    PATH += /Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming

    Setting environment variables:
    EM_CONFIG = /Users/wasm/.emscripten
    EMSCRIPTEN = /Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming

    Mac-MBP:emsdk_portable wasm$ cd ..
    Mac-MBP:webassembly wasm$ emmc --version
    -bash: emmc: command not found
    Mac-MBP:webassembly wasm$ emcc --version
    INFO:root:generating system asset: is_vanilla.txt... (this will be cached in "/Users/wasm/.emscripten_cache/is_vanilla.txt" for subsequent builds)
    INFO:root: - ok
    emcc (Emscripten gcc/clang-like replacement) 1.36.14 (commit ca2685c89546ce5f7c01e1bc769b7d2a401093dc)
    Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
    This is free and open source software under the MIT license.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    Mac-MBP:webassembly wasm$ 
    Mac-MBP:webassembly wasm$ mkdir hello
    Mac-MBP:webassembly wasm$ cd hello
    Mac-MBP:hello wasm$ echo '#include ' > hello.c
    Mac-MBP:hello wasm$ echo 'int main(int argc, char ** argv) {' >> hello.c
    Mac-MBP:hello wasm$ echo 'printf("Hello, world!\n");' >> hello.c
    Mac-MBP:hello wasm$ echo '}' >> hello.c
    Mac-MBP:hello wasm$ emcc hello.c -s WASM=1 -o hello.html
    INFO:root:(Emscripten: Running sanity checks)
    WARNING:root:retrieving port: binaryen from https://github.com/WebAssembly/binaryen/archive/version_21.zip
    WARNING:root:unpacking port: binaryen
    INFO:root:generating port: binaryen_tag_version_21.txt... (this will be cached in "/Users/wasm/.emscripten_cache/asmjs/binaryen_tag_version_21.txt" for subsequent builds)
    INFO:root:building port: binaryen
    -- The C compiler identification is Clang 3.9.0
    -- The CXX compiler identification is Clang 3.9.0
    -- Check for working C compiler: /Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin/clang
    -- Check for working C compiler: /Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin/clang -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: /Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin/clang++
    -- Check for working CXX compiler: /Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin/clang++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - found
    -- Found Threads: TRUE  
    -- Building with -std=c++11
    -- Building with -msse2
    -- Building with -mfpmath=sse
    -- Building with -Wall
    -- Building with -Werror
    -- Building with -Wextra
    -- Building with -Wno-unused-parameter
    -- Building with -fno-omit-frame-pointer
    -- Building with -fPIC
    -- Building with -O2
    -- Building with -UNDEBUG
    -- Configuring done
    CMake Warning (dev):
      Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
      --help-policy CMP0042" for policy details.  Use the cmake_policy command to
      set the policy and suppress this warning.

      MACOSX_RPATH is not specified for the following targets:

       binaryen

    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Generating done
    -- Build files have been written to: /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21
    Scanning dependencies of target wasm
    Scanning dependencies of target asmjs
    Scanning dependencies of target support
    Scanning dependencies of target passes
    [  1%] Building CXX object src/support/CMakeFiles/support.dir/archive.cpp.o
    [  2%] Building CXX object src/asmjs/CMakeFiles/asmjs.dir/asm_v_wasm.cpp.o
    [  4%] Building CXX object src/wasm/CMakeFiles/wasm.dir/wasm.cpp.o
    In file included from /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/support/archive.cpp:17:
    /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/support/archive.h:27:10: fatal error: 'cstdint' file not found
    In file included from /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/asmjs/asm_v_wasm.cpp:17:
    In file included from /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/asm_v_wasm.h:20:
    /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/mixed_arena.h:20:10: fatal error: 'atomic' file not found
    #include 
             ^
    #include 
             ^
    In file included from /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/wasm/wasm.cpp:17:
    /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/wasm.h:46:10: fatal error: 'cassert' file not found
    #include 
             ^
    [  5%] Building CXX object src/passes/CMakeFiles/passes.dir/pass.cpp.o
    /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/passes/pass.cpp:17:10: fatal error: 'chrono' file not found
    #include 
             ^
    1 error generated.
    1 error generated.
    make[2]: *** [src/support/CMakeFiles/support.dir/archive.cpp.o] Error 1
    make[1]: *** [src/support/CMakeFiles/support.dir/all] Error 2make[2]: 
    *** [src/asmjs/CMakeFiles/asmjs.dir/asm_v_wasm.cpp.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: *** [src/asmjs/CMakeFiles/asmjs.dir/all] Error 2
    [  8%] Building CXX object src/passes/CMakeFiles/passes.dir/CoalesceLocals.cpp.o
    [  8%] Building CXX object src/wasm/CMakeFiles/wasm.dir/wasm-binary.cpp.o
    1 error generated.
    make[2]: *** [src/wasm/CMakeFiles/wasm.dir/wasm.cpp.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    In file included from /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/wasm/wasm-binary.cpp:17:
    /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/wasm-binary.h:24:10: fatal error: 'cassert' file not found
    #include 
             ^
    /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/passes/CoalesceLocals.cpp:25:10: fatal error: 'algorithm' file not found
    #include 
             ^
    [ 10%] Building CXX object src/passes/CMakeFiles/passes.dir/CodePushing.cpp.o
    1 error generated.
    make[2]: *** [src/passes/CMakeFiles/passes.dir/pass.cpp.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    In file included from /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/passes/CodePushing.cpp:22:
    /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/wasm.h:46:10: fatal error: 'cassert' file not found
    #include 
             ^
    1 error generated.
    make[2]: *** [src/passes/CMakeFiles/passes.dir/CoalesceLocals.cpp.o] Error 1
    1 error generated.
    make[2]: *** [src/passes/CMakeFiles/passes.dir/CodePushing.cpp.o] Error 1
    make[1]: *** [src/passes/CMakeFiles/passes.dir/all] Error 2
    1 error generated.
    make[2]: *** [src/wasm/CMakeFiles/wasm.dir/wasm-binary.cpp.o] Error 1
    make[1]: *** [src/wasm/CMakeFiles/wasm.dir/all] Error 2
    make: *** [all] Error 2
    Traceback (most recent call last):
      File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/emcc", line 13, in 
        emcc.run()
      File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/emcc.py", line 1334, in run
        compile_source_file(i, input_file)
      File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/emcc.py", line 1323, in compile_source_file
        args = get_bitcode_args([input_file]) + ['-emit-llvm', '-c', '-o', output_file]
      File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/emcc.py", line 1306, in get_bitcode_args
        args = system_libs.process_args(args, shared.Settings)
      File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/tools/system_libs.py", line 636, in process_args
        args = port.process_args(Ports, args, settings, shared)
      File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/tools/ports/binaryen.py", line 34, in process_args
        get(ports, settings, shared)
      File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/tools/ports/binaryen.py", line 29, in get
        return [shared.Cache.get('binaryen_tag_' + TAG, create, what='port', extension='.txt')]
      File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/tools/cache.py", line 95, in get
        temp = creator()
      File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/tools/ports/binaryen.py", line 24, in create
        ports.build_native(os.path.join(ports.get_dir(), 'binaryen', 'binaryen-' + TAG))
      File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/tools/system_libs.py", line 607, in build_native
        subprocess.check_call(['cmake', '--build', '.'] + make_args, env=env)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--', '-j', '4']' returned non-zero exit status 2
    Mac-MBP:hello wasm$ emcc hello.c -s WASM=1 -o hello.htmlc
    Mac-MBP:hello wasm$ whi
    which  while  
    Mac-MBP:hello wasm$ whi
    which  while  
    Mac-MBP:hello wasm$ which emcc
    /Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/emcc
    Mac-MBP:hello wasm$ 
    Mac-MBP:hello wasm$ clang -v
    clang version 3.9.0 (https://github.com/kripken/emscripten-fastcomp-clang/ b6ea91778b2b30e6746f2a5f2baba463948729a4) (https://github.com/kripken/emscripten-fastcomp/ dfcb07a871addf339ffac17e606e16e97e8c5f71) (emscripten 1.36.14 : 1.36.14)
    Target: x86_64-apple-darwin15.6.0
    Thread model: posix
    InstalledDir: /Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin
    Mac-MBP:hello wasm$ 

1 个答案:

答案 0 :(得分:5)

看起来你正在点击this bug

以下建议解决此问题: