2013-08-14 6 views
1

Я пытаюсь настроить emscripten. Итак, я следовал this инструкциям.Проблема с настройкой emscripten

To use Emscripten and complete this tutorial, you need a few things: 

    The Emscripten code, from github (git clone git://github.com/kripken/emscripten.git. The master branch is fine, it is guaranteed to always be stable. We merge to master only after all tests pass.) 
    LLVM with Clang. Version 3.2 is the officially supported version, others may not work. There are official clang binaries that include LLVM for some platforms, if yours is not there then you should get the LLVM and Clang sources and build them. 
    Node.js (0.8 or above) 
    Python 2.7.3 

Я проверил версии по этой линии:

node --version ->v0.10.15

python --version ->Python 2.7.3

Я не имел LLVM и Clang не установлены. Таким образом, установить их таким образом:

sudo add-apt-repository ppa:kxstudio-team/builds 
sudo apt-get update 
sudo apt-get install llvm clang 

тогда, я проверяю их версии:

llvm-config --version ->3.2

clang --version ->

Ubuntu clang version 3.2-1~exp9ubuntu1~precise1 (tags/RELEASE_32/final) (based on LLVM 3.2) 
Target: i386-pc-linux-gnu 
Thread model: posix 

Далее я 'm загрузить emscripten по этой команде:

git clone git://github.com/kripken/emscripten.git ~/emscripten (следующим образом в учебнике)

Ввод emscripten каталога: cd ~/emscripten

Кроме того, я вслед за этим:

Before continuing, it's a good idea to make sure the requirements work. Try 

clang tests/hello_world.cpp 
./a.out 

(Add the path to clang if it isn't installed systemwide.) That uses Clang and LLVM to compile a "hello world" app and run it. The second command there should print "hello, world!". Then, test Node.js with 

node tests/hello_world.js 

which should also print out "hello, world!". (As before, add the path to node if it isn't installed systemwide.) 

Выходы в обеих команд hello, world!.

Далее, первый запуск EMCC:

./emcc (следующим в учебнике)

Выходы:

============================================================================== 
Welcome to Emscripten! 

This is the first time any of the Emscripten tools has been run. 

A settings file has been copied to ~/.emscripten, at absolute path: /home/<my-user-name>/.emscripten 

It contains our best guesses for the important paths, which are: 

    LLVM_ROOT  = /usr/bin 
    PYTHON   = /usr/bin/python2 
    NODE_JS   = /usr/bin/node 
    EMSCRIPTEN_ROOT = /home/<my-user-name>/emscripten 

Please edit the file if any of those are incorrect. 

This command will now exit. When you are done editing those paths, re-run it. 
============================================================================== 

Проверка эти пути, чтобы убедиться, что они являются правильными:

/usr/bin/python2 --version - >Python 2.7.3

/usr/bin/node --version ->v0.10.15

/usr/bin/llvm-config --version ->3.2

Это выглядит нормально.Теперь я хочу попробовать скомпилировать примеры из учебника:

например, здание 1:

./emcc tests/hello_world.cpp 

Выходы: '' (ничего) Бегущий пример 1:

node a.out.js 

Выходы: hello, world!

Пример здания 2 (Генерирование HTML):

./emcc tests/hello_world_sdl.cpp -o hello.html 

Выходы:

Traceback (most recent call last): 
    File "./emcc", line 1428, in <module> 
    libfile = shared.Cache.get(name, create) 
    File "/home/<my-user-name>/emscripten/tools/cache.py", line 37, in get 
    shutil.copyfile(creator(), cachename) 
    File "./emcc", line 1234, in create_libc 
    return build_libc('libc.bc', libc_files) 
    File "./emcc", line 1204, in build_libc 
    shared.Building.link(o_s, in_temp(lib_filename)) 
    File "/home/<my-user-name>/emscripten/tools/shared.py", line 891, in link 
    if Building.is_bitcode(f): 
    File "/home/<my-user-name>/emscripten/tools/shared.py", line 1272, in is_bitcode 
    b = open(filename, 'r').read(4) 
IOError: [Errno 2] No such file or directory: '/tmp/tmphG0_UZ/dlmalloc.c.o' 

Нет 'Hello.html' создан! Что я делаю неправильно?

Дополнительная информация:

uname -a 

Linux <name-of-my-system> 3.2.0-29-generic-pae #46-Ubuntu SMP Fri Jul 27 17:25:43 UTC 2012 i686 athlon i386 GNU/Linux 

Я искал это на Google, но их решения не помогают мне. (больше различных ошибок и больше боли)

ответ

0

Это выглядит очень похоже на вопрос отчётный здесь: https://github.com/kripken/emscripten/issues/1432

+0

Действительно, это похоже на мое. Я последовал за предложением человека и загрузил исходный код LLVM, CLANG и скомпилировал их сам. И это сработало. Похоже, что библиотеки, находящиеся в хранилищах, повреждены или не совместимы с моей системой. Время компиляции - ~ 3 часа в моей системе (Athlon 2.2 Ghz, 3 Gb RAM). –

Смежные вопросы