emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

tmp files not being created/found

Open zz-james opened this issue 13 years ago • 7 comments

I just installed emscripten (and dependencies)

I can get some tests to compile, but not ./emcc tests/hello_world_sdl.cpp -o hello.html

My debug trace is long but I think the problems comes in the last few lines:

clang: warning: argument unused during compilation: '-nostdinc++'
DEBUG    root: [35moptimizing /emscripten/system/lib/libc/stdlib/strtod.c with -O3[0m
DEBUG    root: [35memcc: LLVM opts: ['-O3'][0m
DEBUG    root: [35mBuilding.is_ar failed to test whether file '/tmp/tmpT5WCgH/dlmalloc.c.o' is a llvm archive file! Failed on exception: [Errno 2] No such file or directory: '/tmp/tmpT5WCgH/dlmalloc.c.o'[0m
DEBUG    root: [35mBuilding.is_ar failed to test whether file '/tmp/tmpT5WCgH/err.c.o' is a llvm archive file! Failed on exception: [Errno 2] No such file or directory: '/tmp/tmpT5WCgH/err.c.o'[0m
DEBUG    root: [35mBuilding.is_ar failed to test whether file '/tmp/tmpT5WCgH/errx.c.o' is a llvm archive file! Failed on exception: [Errno 2] No such file or directory: '/tmp/tmpT5WCgH/errx.c.o'[0m
DEBUG    root: [35mBuilding.is_ar failed to test whether file '/tmp/tmpT5WCgH/warn.c.o' is a llvm archive file! Failed on exception: [Errno 2] No such file or directory: '/tmp/tmpT5WCgH/warn.c.o'[0m
DEBUG    root: [35mBuilding.is_ar failed to test whether file '/tmp/tmpT5WCgH/warnx.c.o' is a llvm archive file! Failed on exception: [Errno 2] No such file or directory: '/tmp/tmpT5WCgH/warnx.c.o'[0m
DEBUG    root: [35mBuilding.is_ar failed to test whether file '/tmp/tmpT5WCgH/dlmalloc.c.o' is a llvm archive file! Failed on exception: [Errno 2] No such file or directory: '/tmp/tmpT5WCgH/dlmalloc.c.o'[0m
Traceback (most recent call last):
  File "./emcc", line 1409, in <module>
libfile = shared.Cache.get(name, create)
  File "/emscripten/tools/cache.py", line 37, in get
shutil.copyfile(creator(), cachename)
  File "./emcc", line 1220, in create_libc
return build_libc('libc.bc', libc_files)
  File "./emcc", line 1190, in build_libc
shared.Building.link(o_s, in_temp(lib_filename))
  File "/emscripten/tools/shared.py", line 882, in link
if Building.is_bitcode(f):
  File "/emscripten/tools/shared.py", line 1263, in is_bitcode
b = open(filename, 'r').read(4)
IOError: [Errno 2] No such file or directory: '/tmp/tmpT5WCgH/dlmalloc.c.o'

Anyone have any hints/tips on where I go from here?

Thanks

James

zz-james avatar Jul 24 '13 22:07 zz-james

Try emcc --clear-cache and running that again.

kripken avatar Jul 26 '13 17:07 kripken

that didn't work. I tried another test compilation: ./emcc -O2 tests/hello_world.cpp

and the debug trace contained the line:

x86_mmx %62 = call x86_mmx @llvm.x86.3dnow.pfsubr(i8* %61, x86_mmx (x86_mmx, x86_mmx)* @llvm.x86.3dnow.pfsubr) Broken module found, compilation aborted!

does this mean I don't have the right hardware (mmx on the processor??)

zz-james avatar Jul 30 '13 00:07 zz-james

What LLVM version are you using? Is it a custom build? Looks like it is doing something very different than the LLVM we expect (3.2, unmodified).

kripken avatar Jul 30 '13 01:07 kripken

Aha! I think that might be the problem, I think maybe this is 'not unmodified' thanks will hunt down an unmodified version.

james@james-AO533:/usr/lib/llvm-3.2/bin$ ./llvm-nm --version LLVM (http://llvm.org/): LLVM version 3.2 Ubuntu 3.2-2ubuntu5~precise1 Optimized build. Built May 28 2013 (06:32:46). Default target: i386-pc-linux-gnu Host CPU: atom

zz-james avatar Jul 30 '13 07:07 zz-james

everything is working now thanks. advice for fellow travellers, follow the instructions on https://earthserver.com/Setting_up_emscripten_development_environment_on_Linux carefully, in my setup (ubuntu 12.10) using apt to install llvm and clang just never worked no matter what combination or repository I hit so always download source and compile (even if it takes an age) also my netbook ran out of memory compiling so I reran make without the -j 8 option and it completed ok

zz-james avatar Jul 31 '13 18:07 zz-james

Perhaps we should link to that guide more prominently (it's already linked to in the tutorial I think).

kripken avatar Jul 31 '13 21:07 kripken

The guide is quite prominently linked, I'm afraid I think the problem is the usual one of different linux versions with different repositories, and 'interfaces' between components changing - my laptop is getting old now so to download source and compile takes a long time, and if it fails (it did a couple of times) the machine can be out of action for a whole day, so I tried to install binaries using apt-get but (here's where gaps in my knowledge show up) I needed to add repositories to get LLVM 3.2 - by adding repositories I ended up with less stable versions, that didn't seem to behave well, also installing Clang would either install LLVM3.0 or act strangely with LLVM3.2 - which again is about matching what versions expect what, by default it also installs clang to it's own directory, and emscripten seemed to think clang should be within the LLVM directory, again not sure if it is gaps in my knowledge but there's not a line in the default ~/.emscripten config file to specify an alternative path to clang.

obviously emscripten is not for newbie's - I think it was more difficult than I thought it would be, but obviously since I've now got it running so it's not impossible - I don't know how possible or difficult it would be to get to the point where I can type

sudo apt-get install emscripten

but I think that would make a big difference!!!

thanks for your help I know you must have a lot of work on.

James

p.s. sorry if this reopens the issue in the forum that happens all the time to me at work :-)

On Wed, Jul 31, 2013 at 10:32 PM, Alon Zakai [email protected]:

Perhaps we should link to that guide more prominently (it's already linked to in the tutorial I think).

— Reply to this email directly or view it on GitHubhttps://github.com/kripken/emscripten/issues/1432#issuecomment-21897512 .

zz-james avatar Aug 01 '13 09:08 zz-james