Re: where can I find the file which created by emscipten ?
thanks you for your advice! 在 2017年8月11日星期五 UTC+8上午3:58:29,Michael Uman写道: > > Hello, > > I am no expert but the little experience i have tells me that from within > a browser you cannot write to the local file-system. I am working in the > NodeJS environment and have access to the NodeFS file-system which is > capable of writing to the users local filesystem. > > Maybe someone else could clarify if it is possible. > > Thank you, > Michael Uman > Sr Software Engineer - Sigma Designs uCode Tools > > On Thursday, August 10, 2017 at 3:17:41 AM UTC-7, Wanghb Wang wrote: >> >> Can I save the "IndexedDB" file into disk?? >> >> 在 2017年8月10日星期四 UTC+8下午6:13:53,jj写道: >>> >>> IDBFS uses browser's IndexedDB to persist the files. See >>> https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API and >>> https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector. >>> >>> 2017-08-10 13:08 GMT+03:00 Wanghb Wang: >>> > I learn from the website >>> > >>> https://kripken.github.io/emscripten-site/docs/api_reference/Filesystem-API.html. >>> >>> >>> > I use the followed code to create a file, However, I cannot find the >>> file. >>> > Where is it? >>> > EM_ASM( >>> > FS.mkdir('/IDBFS'); >>> > FS.mount(IDBFS,{},'/IDBFS'); >>> > FS.syncfs(true, function(err){ >>> > assert(!err); >>> > >>> > open("/IDBFS/moar.txt", "r+"); >>> > // fopen("/IDBFS/test.test.pcm","wb"); >>> > }); >>> > ); >>> > >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> Groups >>> > "emscripten-discuss" group. >>> > To unsubscribe from this group and stop receiving emails from it, send >>> an >>> > email to emscripten-discuss+unsubscr...@googlegroups.com. >>> > For more options, visit https://groups.google.com/d/optout. >>> >> -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: About vanilla wasm and emcc SIDE_MODULE
Thanks for your detailed answer, it's really helpful. For the "WebAssembly.Table" feature, I was talking about this https://github.com/mdn/webassembly-examples/blob/master/js-api-examples/table2.wat On Thursday, August 10, 2017 at 7:23:15 PM UTC+2, Alon Zakai wrote: > > Global destructors aren't called for you, and so far the dynamic library > spec (which is the basis for current side module support) doesn't have a > feature for that. So you'd need to do that manually. > > There are some differences between how asm2wasm and the wasm backend > (vanilla llvm) allocate the stack. The wasm backend path is not stable yet > so you might be seeing a bug there, but also I think that side modules > haven't been tested with the wasm backend yet. I'd use the default compiler > path (asm2wasm) until the wasm backend is stable. > > Not sure what you're asking about Table. Your compiled c++ code should use > it automatically. > > On Wed, Aug 9, 2017 at 9:27 PM, Jean Valjean> wrote: > >> Also, do you recommend the use of emscripten for "vanilla wasm" output or >> should I stick with the original LLVM distrib ? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "emscripten-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to emscripten-discuss+unsubscr...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Please help get Emscripten Module to load into NodeJS environment, supplied example
Hello once again, Is this the place to post questions about emscripten? This group was listed on the emscripten official site and I was hoping to be able to get some answers regarding actually using this thing. Is there anyone out there who knows what I am asking here? It should not be too difficult as I believe what I am trying to do is a common thing that people developing modules using emscripten need to do. I have found another funny work-around just loading the emscripten modules using a construct like this: var fs = require('fs'); eval( fs.readFileSync( moduleName, { encoding : 'utf8' }) ); But I have been told this is not the 'recommended' way of doing this. Anyway, i have more questions and will start another thread soon. I am just wondering if anyone ever gets a response from anyone in the community. I have been involved with the wxWidgets community and I often get responses within 1-2 days there. Thank you, -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: About vanilla wasm and emcc SIDE_MODULE
Global destructors aren't called for you, and so far the dynamic library spec (which is the basis for current side module support) doesn't have a feature for that. So you'd need to do that manually. There are some differences between how asm2wasm and the wasm backend (vanilla llvm) allocate the stack. The wasm backend path is not stable yet so you might be seeing a bug there, but also I think that side modules haven't been tested with the wasm backend yet. I'd use the default compiler path (asm2wasm) until the wasm backend is stable. Not sure what you're asking about Table. Your compiled c++ code should use it automatically. On Wed, Aug 9, 2017 at 9:27 PM, Jean Valjeanwrote: > Also, do you recommend the use of emscripten for "vanilla wasm" output or > should I stick with the original LLVM distrib ? > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to emscripten-discuss+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: asm.js very slow compile time
Chrome error: failed to asynchronously prepare wasm: LinkError: Import #3 module="env" function="__ZN6Editor10s_instanceE" error: global import must be a number testing.html:160 LinkError: Import #3 module="env" function="__ZN6Editor10s_instanceE" error: global import must be a number at http://localhost/bin.js?timestamp=1502360564253:5659:23 at testing.html:161 LinkError: Import #3 module="env" function="__ZN6Editor10s_instanceE" error: global import must be a number at http://localhost/bin.js?timestamp=1502360564253:5659:23 at testing.html:1 Uncaught (in promise) abort({}) at Error at jsStackTrace (http://localhost/bin.js?timestamp=1502360564253:5206:12) at stackTrace (http://localhost/bin.js?timestamp=1502360564253:5220:11) at abort (http://localhost/bin.js?timestamp=1502360564253:15934:43) at http://localhost/bin.js?timestamp=1502360564253:5664:4 at If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information. 2017-08-10 17:32 GMT+07:00 Александр Гурьянов: > emcc (Emscripten gcc/clang-like replacement) 1.37.18 (commit > cb2260892ddc2c73aa40dbe0821f5a8ce3f79975) > > bin.js: > function __ZN6Editor10s_instanceE() { >Module["printErr"]("missing function: _ZN6Editor10s_instanceE"); >abort(-1); > } > // ... > getBinaryPromise().then((function(binary) { >return WebAssembly.instantiate(binary, info); // <-- HERE > })).then((function(output) { > > I don't know how to look inside wasm, it's looks like binary file: > STACKTOP envSTACK_MAX env __ZN6Editor10s_instanceE env > > c++: > class Editor { > private: > static Editor* s_instance; > public: > static Editor* getInstance() { return s_instance; } > > } > > > Yes it's a singleton pointer, but this class is not implemented, it > have many undefined references, including to s_instance: > 51: undefined reference to `Editor::s_instance' > > So I think problem in that place, but I don't want to implement it, it > never calls. > > > 2017-08-10 17:12 GMT+07:00 Jukka Jylänki : >> Is that on latest Emscripten 1.37.18? That looks like a new error that >> is not known. What does the generated code around that location look >> like? What should __ZN6Editor10s_instanceE be, is that a singleton >> pointer? >> >> 2017-08-10 6:55 GMT+03:00 Александр Гурьянов : >>> Update on compile time: >>> -O2 - ~60 sec >>> -O3 - ~7 sec >>> >>> Also I try to build project with WASM=1, and it built successfully, >>> but I can't run it due this error: >>> failed to asynchronously prepare wasm: LinkError: import object field >>> '__ZN6Editor10s_instanceE' is not a Number testing.html:161:40 >>> LinkError: import object field '__ZN6Editor10s_instanceE' is not a >>> Number testing.html:160:37 >>> LinkError: import object field '__ZN6Editor10s_instanceE' is not a >>> Number testing.html:161:40 >>> >>> I have some unresovled symbols in project, but this symbols never >>> calls from code. I also build native version with flag >>> -Wl,--unresolved-symbols=ignore-all and it works fine, asm.js also >>> works. >>> >>> 2017-08-09 19:36 GMT+07:00 Александр Гурьянов : The source is not public, but I think I can share result js if it's useful. I will try to build WebAssembly and check. 2017-08-09 19:04 GMT+07:00 Jukka Jylänki : > This looks like a performance bug in the browser. It may be possible > to reduce the compilation time, but without a test case it's not > possible to know what might be wrong. Is the project public somewhere? > > One known source of slow compilation times is if one has very large > switch-case statements with tens of thousands of cases. > > Though FF 54 already supports WebAssembly. Do you have a WebAssembly > build of the same, does that compile quickly on Firefox? > > 2017-08-09 14:52 GMT+03:00 caiiiycuk : >> Hi. I use Firefox 54.0 to test my game that I compile from C++ to js. Js >> size is 6.3Mb, when I open game in FF, then it compiles asm.js for very >> long >> time: >> Successfully compiled asm.js code (total compilation time 55703ms; >> stored in >> cache) >> >> As you see I wait one minute before game starts, all other browsers >> start >> game immediately. It's possible to reduce this compilation time? >> >> I have very powerfull CPU - i7, os is Ubuntu x64 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "emscripten-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to emscripten-discuss+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group.
Re: asm.js very slow compile time
emcc (Emscripten gcc/clang-like replacement) 1.37.18 (commit cb2260892ddc2c73aa40dbe0821f5a8ce3f79975) bin.js: function __ZN6Editor10s_instanceE() { Module["printErr"]("missing function: _ZN6Editor10s_instanceE"); abort(-1); } // ... getBinaryPromise().then((function(binary) { return WebAssembly.instantiate(binary, info); // <-- HERE })).then((function(output) { I don't know how to look inside wasm, it's looks like binary file: STACKTOP envSTACK_MAX env __ZN6Editor10s_instanceE env c++: class Editor { private: static Editor* s_instance; public: static Editor* getInstance() { return s_instance; } } Yes it's a singleton pointer, but this class is not implemented, it have many undefined references, including to s_instance: 51: undefined reference to `Editor::s_instance' So I think problem in that place, but I don't want to implement it, it never calls. 2017-08-10 17:12 GMT+07:00 Jukka Jylänki: > Is that on latest Emscripten 1.37.18? That looks like a new error that > is not known. What does the generated code around that location look > like? What should __ZN6Editor10s_instanceE be, is that a singleton > pointer? > > 2017-08-10 6:55 GMT+03:00 Александр Гурьянов : >> Update on compile time: >> -O2 - ~60 sec >> -O3 - ~7 sec >> >> Also I try to build project with WASM=1, and it built successfully, >> but I can't run it due this error: >> failed to asynchronously prepare wasm: LinkError: import object field >> '__ZN6Editor10s_instanceE' is not a Number testing.html:161:40 >> LinkError: import object field '__ZN6Editor10s_instanceE' is not a >> Number testing.html:160:37 >> LinkError: import object field '__ZN6Editor10s_instanceE' is not a >> Number testing.html:161:40 >> >> I have some unresovled symbols in project, but this symbols never >> calls from code. I also build native version with flag >> -Wl,--unresolved-symbols=ignore-all and it works fine, asm.js also >> works. >> >> 2017-08-09 19:36 GMT+07:00 Александр Гурьянов : >>> The source is not public, but I think I can share result js if it's useful. >>> >>> I will try to build WebAssembly and check. >>> >>> 2017-08-09 19:04 GMT+07:00 Jukka Jylänki : This looks like a performance bug in the browser. It may be possible to reduce the compilation time, but without a test case it's not possible to know what might be wrong. Is the project public somewhere? One known source of slow compilation times is if one has very large switch-case statements with tens of thousands of cases. Though FF 54 already supports WebAssembly. Do you have a WebAssembly build of the same, does that compile quickly on Firefox? 2017-08-09 14:52 GMT+03:00 caiiiycuk : > Hi. I use Firefox 54.0 to test my game that I compile from C++ to js. Js > size is 6.3Mb, when I open game in FF, then it compiles asm.js for very > long > time: > Successfully compiled asm.js code (total compilation time 55703ms; stored > in > cache) > > As you see I wait one minute before game starts, all other browsers start > game immediately. It's possible to reduce this compilation time? > > I have very powerfull CPU - i7, os is Ubuntu x64 > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to emscripten-discuss+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "emscripten-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to emscripten-discuss+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to emscripten-discuss+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: where can I find the file which created by emscipten ?
Can I save the "IndexedDB" file into disk?? 在 2017年8月10日星期四 UTC+8下午6:13:53,jj写道: > > IDBFS uses browser's IndexedDB to persist the files. See > https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API and > https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector. > > 2017-08-10 13:08 GMT+03:00 Wanghb Wang: > > I learn from the website > > > https://kripken.github.io/emscripten-site/docs/api_reference/Filesystem-API.html. > > > > I use the followed code to create a file, However, I cannot find the > file. > > Where is it? > > EM_ASM( > > FS.mkdir('/IDBFS'); > > FS.mount(IDBFS,{},'/IDBFS'); > > FS.syncfs(true, function(err){ > > assert(!err); > > > > open("/IDBFS/moar.txt", "r+"); > > // fopen("/IDBFS/test.test.pcm","wb"); > > }); > > ); > > > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "emscripten-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to emscripten-discuss+unsubscr...@googlegroups.com . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: asm.js very slow compile time
Is that on latest Emscripten 1.37.18? That looks like a new error that is not known. What does the generated code around that location look like? What should __ZN6Editor10s_instanceE be, is that a singleton pointer? 2017-08-10 6:55 GMT+03:00 Александр Гурьянов: > Update on compile time: > -O2 - ~60 sec > -O3 - ~7 sec > > Also I try to build project with WASM=1, and it built successfully, > but I can't run it due this error: > failed to asynchronously prepare wasm: LinkError: import object field > '__ZN6Editor10s_instanceE' is not a Number testing.html:161:40 > LinkError: import object field '__ZN6Editor10s_instanceE' is not a > Number testing.html:160:37 > LinkError: import object field '__ZN6Editor10s_instanceE' is not a > Number testing.html:161:40 > > I have some unresovled symbols in project, but this symbols never > calls from code. I also build native version with flag > -Wl,--unresolved-symbols=ignore-all and it works fine, asm.js also > works. > > 2017-08-09 19:36 GMT+07:00 Александр Гурьянов : >> The source is not public, but I think I can share result js if it's useful. >> >> I will try to build WebAssembly and check. >> >> 2017-08-09 19:04 GMT+07:00 Jukka Jylänki : >>> This looks like a performance bug in the browser. It may be possible >>> to reduce the compilation time, but without a test case it's not >>> possible to know what might be wrong. Is the project public somewhere? >>> >>> One known source of slow compilation times is if one has very large >>> switch-case statements with tens of thousands of cases. >>> >>> Though FF 54 already supports WebAssembly. Do you have a WebAssembly >>> build of the same, does that compile quickly on Firefox? >>> >>> 2017-08-09 14:52 GMT+03:00 caiiiycuk : Hi. I use Firefox 54.0 to test my game that I compile from C++ to js. Js size is 6.3Mb, when I open game in FF, then it compiles asm.js for very long time: Successfully compiled asm.js code (total compilation time 55703ms; stored in cache) As you see I wait one minute before game starts, all other browsers start game immediately. It's possible to reduce this compilation time? I have very powerfull CPU - i7, os is Ubuntu x64 -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "emscripten-discuss" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to emscripten-discuss+unsubscr...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to emscripten-discuss+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Emscripten errors when used with a React App
Sorry, I have not used the React linter, but perhaps someone else might have, and would know more experience there. 2017-08-10 0:08 GMT+03:00 Lubo Astinov: > Have you ever been successfull in getting something compiled with Emscripten > to pass the React linter? I'm wondering if I'm just doing something like not > passing in the correct flag or something. > > On Wednesday, August 9, 2017 at 12:39:51 PM UTC-7, jj wrote: >> >> Hmm, most of these should be present in the compiled code file? Also, >> `importScripts` is a web built-in in Web Worker's global scope: >> >> https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts, >> I wonder if React's linter needs to be taught that the app is run in a >> Web Worker. `dump` is an extern that comes from >> https://developer.mozilla.org/en-US/docs/Web/API/Window/dump, though >> the presence should always be tested first. >> >> 2017-08-09 20:41 GMT+03:00 Lubo Astinov : >> > Hi everyone, >> > >> > I'm new to Emscripten and I'm running into a problem which probably has >> > a >> > simple solution, yet I'm unable to find it. >> > >> > I create a basic React JS app with create-react-app. I then want to use >> > a >> > very simple .cpp file (just a noop at this point really, returning a >> > constant) which I compile to JS with: >> > >> > emcc --bind -o matrix.js matrix.cpp >> > >> > If I use the resulting JS file in a regular html file, all is well. But >> > the >> > problem is that the React App linter finds missing definitions that >> > break >> > the compilation and I can't figure out how to make Emscripten define >> > those. >> > Here are the errors I'm getting: >> > >> > ./src/matrix.js Line 90: 'read' is not defined no-undef Line 117: >> > Unexpected >> > use of 'print' no-restricted-globals Line 118: 'printErr' is not defined >> > no-undef Line 121: 'read' is not defined no-undef Line 128: 'readbuffer' >> > is >> > not defined no-undef Line 130: 'read' is not defined no-undef Line 136: >> > 'scriptArgs' is not defined no-undef Line 143: 'quit' is not defined >> > no-undef Line 196: 'dump' is not defined no-undef Line 203: >> > 'importScripts' >> > is not defined no-undef Line 281: 'tempRet0' is not defined no-undef >> > Line >> > 285: 'tempRet0' is not defined no-undef Line 489: 'EmterpreterAsync' is >> > not >> > defined no-undef Line 495: 'EmterpreterAsync' is not defined no-undef >> > Line >> > 587: 'tempI64' is not defined no-undef Line 587: 'tempDouble' is not >> > defined >> > no-undef Line 587: 'tempDouble' is not defined no-undef Line 587: >> > 'tempDouble' is not defined no-undef Line 587: 'tempDouble' is not >> > defined >> > no-undef Line 587: 'tempDouble' is not defined no-undef Line 587: >> > 'tempDouble' is not defined no-undef Line 587: 'tempI64' is not defined >> > no-undef Line 587: 'tempI64' is not defined no-undef Line 1965: >> > '___cxa_free_exception' is not defined no-undef Line 2767: >> > 'FUNCTION_TABLE' >> > is not defined no-undef >> > >> > Can someone point me to what I'm missing? >> > >> > Thanks! >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "emscripten-discuss" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> > an >> > email to emscripten-discuss+unsubscr...@googlegroups.com. >> > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to emscripten-discuss+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
where can I find the file which created by emscipten ?
I learn from the website https://kripken.github.io/emscripten-site/docs/api_reference/Filesystem-API.html . I use the followed code to create a file, However, I cannot find the file. Where is it? EM_ASM( FS.mkdir('/IDBFS'); FS.mount(IDBFS,{},'/IDBFS'); FS.syncfs(true, function(err){ assert(!err); open("/IDBFS/moar.txt", "r+"); // fopen("/IDBFS/test.test.pcm","wb"); }); ); -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.