2012-04-28 131 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++