2012-04-28 70 views
0

我试图让EMScripten工作。我非常自信,我已经按照教程,并确保所提到的依赖关系已安装。EMScripten无法构建示例项目

在尝试构建示例项目时,它会失败,

[email protected]:~/git/emscripten$ EMCC_DEBUG=1 ./emcc tests/hello_world.c 

emcc invocation: ./emcc tests/hello_world.c 
emcc: compiling to bitcode 
emcc: compiling source file: tests/hello_world.c 
emcc running: /usr/bin/clang -m32 -U__i386__ -U__x86_64__ -U__i386 -U__x86_64 -U__SSE__ -U__SSE2__ -U__MMX__ -UX87_DOUBLE_ROUNDING -UHAVE_GCC_ASM_FOR_X87 -DEMSCRIPTEN -U__STRICT_ANSI__ -U__CYGWIN__ -D__STDC__ -Xclang -triple=i386-pc-linux-gnu -nostdinc -nostdinc++ -Xclang -nobuiltininc -Xclang -nostdinc++ -Xclang -nostdsysteminc -Xclang -isystem/home/tv/git/emscripten/system/include -Xclang -isystem/home/tv/git/emscripten/system/include/bsd -Xclang -isystem/home/tv/git/emscripten/system/include/libc -Xclang -isystem/home/tv/git/emscripten/system/include/libcxx -Xclang -isystem/home/tv/git/emscripten/system/include/gfx -Xclang -isystem/home/tv/git/emscripten/system/include/net -Xclang -isystem/home/tv/git/emscripten/system/include/SDL -U__APPLE__ -emit-llvm -c tests/hello_world.c -o /tmp/tmpMvgQiE/hello_world_0.o 
clang: warning: argument unused during compilation: '-nostdinc++' 
emcc: will generate JavaScript 
emcc: considering including libcxx: we need |[]| and have |[]| 
emcc: considering including libcxxabi: we need |[]| and have |[]| 
emcc: considering including dlmalloc: we need |[]| and have |[]| 
emcc: saving intermediate processing steps to /tmp/emscripten_temp 
emcc: LLVM dead globals elimination 
Traceback (most recent call last): 
    File "./emcc", line 837, in <module> 
    shared.Building.llvm_opt(in_temp(target_basename + '.bc'), ['-internalize', '-globaldce']) 
    File "/home/tv/git/emscripten/tools/shared.py", line 545, in llvm_opt 
    output = Popen([LLVM_OPT, filename] + opts + ['-o=' + filename + '.opt.bc'], stdout=PIPE).communicate()[0] 
    File "/usr/lib/python2.7/subprocess.py", line 679, in __init__ 
    errread, errwrite) 
    File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child 
    raise child_exception 
OSError: [Errno 2] No such file or directory 

~/.emscripten内容:

[email protected]:~/git/emscripten$ cat ~/.emscripten | egrep -v '^#|^$' 
EMSCRIPTEN_ROOT = os.path.expanduser('~/git/emscripten') # this helps projects using emscripten find it 
LLVM_ROOT = os.path.expanduser('/usr/bin') 
NODE_JS = 'node' 
TEMP_DIR = '/tmp' # You will need to modify this on Windows 
COMPILER_ENGINE = NODE_JS 
JS_ENGINES = [NODE_JS] 

我不知道是什么问题 - 需要帮助解决。有没有人有任何关于什么可能是错误的想法,在这里?我错过了什么?

+0

什么“哪个叮铛声”你? – meawoppl 2014-03-01 19:39:53

回答

0

您是否试过最新的Emscripten

看起来像你的LLVM_OPT不存在。如果问题仍然存在进入/home/tv/git/emscripten/tools/shared.py和线545(Popen([LLVM_OPT...)之前加一行

print 'LLVM_OPT IS: <' + LLVM_OPT + '>' 

在下次编译这应该打印到标准输出的路径LLVM_OPT。这个路径可能不存在,所以你可能只需要一个符号链接,因为opt二进制文件有一个版本附录或者这样的恶意软件。

0

看看你的路径。我正在和Emscripten一起工作,经过一系列令人困惑的失败后,结果显示我的路径信息不正确。特别是我的LLVM_ROOT。这是正确的我:

LLVM_ROOT = os.path.expanduser(os.getenv('LLVM') or '/usr/lib/llvm-3.2/bin') # directory 

注LLVM的位置,这是从默认的/ usr/bin中我原本非常不同。请注意,即使路径错误,我所得到的错误emscripten几乎可以正常工作。

注:我正在使用Linux Mint 14(Ubuntu Quantal)。

0

确保您铛或者是符号链接,它的像这样的东西你LLVM目录中: 须藤LN -s在/ usr/bin中/铛++ /usr/lib/llvm-3.2/bin/clang++