Open arasouli91 opened 5 years ago
emmake make -f Makefile-emscript
is the correct command. I have updated the README.
Compilation works for me with emsdk version sdk-1.37.9-64bit
. There are many versions with regressions listed here. Can you try either upgrading to 1.37.40
or downgrading to 1.37.9
?
Ok, I will try with 1.37.9. But, first I felt like trying to build with the latest emsdk version, and that doesn't work either. Also, wouldn't it be a good thing to get the build to work with the latest emsdk?
Stack: Error
at assertTrue (eval at globalEval (/.../emsdk/emscripten/1.38.11/tools/js-optimizer.js:114:8), <anonymous>:59:26)
at Object.emitDCEGraph (/.../emsdk/emscripten/1.38.11/tools/js-optimizer.js:8182:3)
at /.../emsdk/emscripten/1.38.11/tools/js-optimizer.js:8406:14
at Array.forEach (<anonymous>)
at Object.<anonymous> (/.../emsdk/emscripten/1.38.11/tools/js-optimizer.js:8405:21)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
undefined:60
throw msg;
^
Assertion failed: could not find the assigment to "asmLibraryArg". perhaps --pre-js or --post-js code moved it out of the global scope? (things like that should be done after emcc runs, as they do not need to be run through the optimizer which is the special thing about --pre-js/--post-js code)
Traceback (most recent call last):
File "/.../emsdk/emscripten/1.38.11/emcc.py", line 3042, in <module>
sys.exit(run())
File "/.../emsdk/emscripten/1.38.11/emcc.py", line 2030, in run
wasm_text_target, misc_temp_files, optimizer)
File "/.../emsdk/emscripten/1.38.11/emcc.py", line 2578, in do_binaryen
emit_symbol_map=emit_symbol_map)
File "/.../emsdk/emscripten/1.38.11/tools/shared.py", line 2505, in minify_wasm_js
js_file = Building.metadce(js_file, wasm_file, minify_whitespace=minify_whitespace, debug_info=debug_info)
File "/.../emsdk/emscripten/1.38.11/tools/shared.py", line 2525, in metadce
txt = Building.js_optimizer_no_asmjs(js_file, ['emitDCEGraph', 'noEmitAst'], return_output=True)
File "/.../emsdk/emscripten/1.38.11/tools/shared.py", line 2368, in js_optimizer_no_asmjs
return run_process(NODE_JS + [js_optimizer.JS_OPTIMIZER, filename] + passes, stdout=PIPE).stdout
File "/.../emsdk/emscripten/1.38.11/tools/shared.py", line 167, in run_process
return run_base(cmd, universal_newlines=universal_newlines, check=check, *args, **kw)
File "/.../emsdk/emscripten/1.38.11/tools/shared.py", line 162, in run_base
result.check_returncode()
File "/.../emsdk/emscripten/1.38.11/tools/shared.py", line 148, in check_returncode
raise Py2CalledProcessError(returncode=self.returncode, cmd=self.args, output=self.stdout, stderr=self.stderr)
tools.shared.Py2CalledProcessError: Command '['/.../emsdk/node/8.9.1_64bit/bin/node', '/.../emsdk/emscripten/1.38.11/tools/js-optimizer.js', '/tmp/tmpTa6Pg_/flif.bc.o.js.pp.js.mem.js.jso.js', 'emitDCEGraph', 'noEmitAst']' returned non-zero exit status 1
Makefile-emscript:49: recipe for target 'em-out/flif.html' failed
make: *** [em-out/flif.html] Error 1
Ok thanks for the info. Well, I would want to make those changes to get the WASM build to work. But, I need to figure out whether your repo or saschanaz's libflif is more promising to make FLIF on the web viable more quickly.
So, I tried to build with 1.37.40 and I get the same error
/tmp/tmp_I1XS8.cl.js:4323: ERROR - variable PolyFlif is undeclared var pf = new PolyFlif({"buf": content, "canvas": elem});
I suggest trying with 1.37.9 and if that works, atleast you will have a starting point. From that point, you can try going up the versions till it fails, and by looking at the change log for the failing sdk version, you will get a hint of how to fix this.
I ran emmake make, as suggested by the README, but I got an error. I guess it has to do with libpng. So, I installed libpng with: sudo apt-get install libpng-dev. But, I still got this error.
I ran emmake make -f Makefile-emscript, and it fails with this error: