On Thu, Feb 20, 2020 at 10:43 PM Laurent Pugin <[email protected]> wrote:

> Great, thanks!
>
> > (Btw, I noticed your build script compiles serially - might be nice to
> use cmake or a Makefile, as that allow compiling sources in parallel, which
> could speed things up.)
>
> Thanks for the tip, I will look at it. Do you mean using emcmake cmake?
> Any pointers to the doc or a good example, by any chance?
>
>
For example a simple Makefile like this:

https://github.com/emscripten-core/emscripten/blob/master/tests/box2d/Makefile

(replacing the box2d.a with *.js and using emcc instead of AR there, to
link the final executable). You can run that with emmake make -j 8 and it
will use 8 cores, for example. A CMakeLists.txt file with CMake is also an
option if you need more flexibility in the script.

On Friday, 21 February 2020 04:09:59 UTC+1, Alon Zakai wrote:
>>
>> Thanks Laurent! Fix in
>>
>> https://github.com/emscripten-core/emscripten/pull/10522
>>
>> This is a very old bug, but was never a problem in practice until we
>> added some new globals recently, and if there are enough other imports they
>> can overlap.
>>
>> (Btw, I noticed your build script compiles serially - might be nice to
>> use cmake or a Makefile, as that allow compiling sources in parallel, which
>> could speed things up.)
>>
>> On Wed, Feb 19, 2020 at 10:46 PM Laurent Pugin <[email protected]> wrote:
>>
>>>
>>> This is it https://github.com/rism-ch/verovio
>>>
>>> Checkout the default (develop) branch, and in ./emscripten run
>>> ./buildToolkit -c -H
>>>
>>> The options a given here
>>>
>>> https://github.com/rism-ch/verovio/blob/fdb371d6a2c3bdee2a8bb177b54455c48e9e5d5d/emscripten/buildToolkit#L77
>>>
>>> Thanks
>>>
>>>
>>> On Wednesday, 19 February 2020 21:59:35 UTC+1, Alon Zakai wrote:
>>>>
>>>> Thanks, I see. Ok, this looks like a wasm2js bug.
>>>>
>>>> Any chance you can provide the project so I can build locally to test?
>>>> If not, if you can provide the build output with  -g1  (so there is
>>>> whitespace) that might (but no sure) be enough to figure this out.
>>>>
>>>> (The -O1 issue is a known limitation of EM_ASM currently. As the error
>>>> suggests, EM_JS is a workaround, which is also better anyhow, so best to
>>>> switch to that.)
>>>>
>>>> On Tue, Feb 18, 2020 at 11:43 PM Laurent Pugin <[email protected]>
>>>> wrote:
>>>>
>>>>> There are no other flags (except for the exported functions). It is
>>>>> using upstream.
>>>>>
>>>>> I tested with other optimization flags.
>>>>>
>>>>> With -O0: it compiles and runs as normal
>>>>> With -O2 and -O3: it compiles but fails to run as reported before
>>>>> With -O1: compilation fails with
>>>>>
>>>>> Fatal: local.get of unknown in arg0 of call to
>>>>> emscripten_asm_const_int (used by EM_ASM* macros) in function 18029.
>>>>> This might be caused by aggressive compiler transformations. Consider
>>>>> using EM_JS instead.
>>>>> shared:ERROR:
>>>>> '/Users/laurent/tools/emsdk/upstream/bin/wasm-emscripten-finalize
>>>>> --detect-features --global-base=1024
>>>>> /var/folders/wd/7vt44b8n035_qp6k8mt55rdr0000gn/T/emscripten_temp_ue0ycr/verovio.wasm
>>>>> -o
>>>>> /var/folders/wd/7vt44b8n035_qp6k8mt55rdr0000gn/T/emscripten_temp_ue0ycr/verovio.wasm.o.wasm'
>>>>> failed (1)
>>>>>  Failed.
>>>>>
>>>>>
>>>>>
>>>>> On Tuesday, 18 February 2020 22:37:49 UTC+1, Alon Zakai wrote:
>>>>>>
>>>>>> Hmm, this is puzzling. Nothing in that range on emscripten looks
>>>>>> suspicious, except perhaps for closure - do you have any other link 
>>>>>> flags,
>>>>>> like --closure 1, than those mentioned?
>>>>>>
>>>>>> If that's not it, perhaps this is a regression in Binaryen's wasm2js.
>>>>>> To confirm, this is with 1.39.8 or 1.39.8-upstream, and and not
>>>>>> 1.39.8-fastcomp?
>>>>>>
>>>>>> Do you also get an error when building with -O0 or -O1? The error
>>>>>> message might be clearer.
>>>>>>
>>>>>>
>>>>>> On Mon, Feb 17, 2020 at 11:16 PM Laurent Pugin <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have a problem with a project that builds asm.js output with the
>>>>>>> following parameters.
>>>>>>>
>>>>>>> my $FLAGS = "-O3";
>>>>>>> $FLAGS .= " -DNDEBUG";
>>>>>>> $FLAGS .= " --memory-init-file 0";
>>>>>>> $FLAGS .= " -std=c++17";
>>>>>>> $FLAGS .= " -s ASM_JS=1";
>>>>>>> $FLAGS .= " -s WASM=0";
>>>>>>> $FLAGS .= " -s TOTAL_MEMORY=256MB";
>>>>>>> $FLAGS .= " -s TOTAL_STACK=128MB";
>>>>>>>
>>>>>>> It generates a single JS file that can be included in a webpage
>>>>>>> within a <script> tag in the header, and then exported function are
>>>>>>> accessible. This used to work fine up to 1.39.7 but fails with 1.39.8. 
>>>>>>> Any
>>>>>>> ideas of what has changed between the two versions and how to fix it? 
>>>>>>> Thanks
>>>>>>>
>>>>>>> The console throws (Chrome)
>>>>>>>
>>>>>>> verovio-toolkit.js:43 failed to asynchronously prepare wasm:
>>>>>>> ReferenceError: oa is not defined
>>>>>>> (anonymous) @ verovio-toolkit.js:43
>>>>>>> Promise.then (async)
>>>>>>> instantiateArrayBuffer @ verovio-toolkit.js:43
>>>>>>> instantiateAsync @ verovio-toolkit.js:43
>>>>>>> createWasm @ verovio-toolkit.js:43
>>>>>>> (anonymous) @ verovio-toolkit.js:43
>>>>>>> verovio-toolkit.js:43 ReferenceError: oa is not defined
>>>>>>> verovio-toolkit.js:43 ReferenceError: oa is not defined
>>>>>>> abort @ verovio-toolkit.js:43
>>>>>>> (anonymous) @ verovio-toolkit.js:43
>>>>>>> Promise.then (async)
>>>>>>> instantiateArrayBuffer @ verovio-toolkit.js:43
>>>>>>> instantiateAsync @ verovio-toolkit.js:43
>>>>>>> createWasm @ verovio-toolkit.js:43
>>>>>>> (anonymous) @ verovio-toolkit.js:43
>>>>>>> verovio-toolkit.js:43 Uncaught (in promise) Error:
>>>>>>> abort(ReferenceError: oa is not defined). Build with -s ASSERTIONS=1 for
>>>>>>> more info.
>>>>>>> at abort (verovio-toolkit.js:43)
>>>>>>> at verovio-toolkit.js:43
>>>>>>> abort @ verovio-toolkit.js:43
>>>>>>> (anonymous) @ verovio-toolkit.js:43
>>>>>>> Promise.then (async)
>>>>>>> instantiateArrayBuffer @ verovio-toolkit.js:43
>>>>>>> instantiateAsync @ verovio-toolkit.js:43
>>>>>>> createWasm @ verovio-toolkit.js:43
>>>>>>> (anonymous) @ verovio-toolkit.js:43
>>>>>>> verovio-toolkit.js:43 Uncaught TypeError: Cannot read property
>>>>>>> 'apply' of undefined
>>>>>>> at Object.Module._vrvToolkit_constructor [as constructor]
>>>>>>> (verovio-toolkit.js:43)
>>>>>>> at new verovio.toolkit (verovio-toolkit.js:135)
>>>>>>> at verovio.js:3
>>>>>>> Module._vrvToolkit_constructor @ verovio-toolkit.js:43
>>>>>>> verovio.toolkit @ verovio-toolkit.js:135
>>>>>>> (anonymous) @ verovio.js:3
>>>>>>>
>>>>>>> Firefox
>>>>>>>
>>>>>>> failed to asynchronously prepare wasm: ReferenceError: oa is not
>>>>>>> defined verovio-toolkit-light.js:43:10692
>>>>>>> <http://localhost:4001/javascript/develop/verovio-toolkit-light.js>
>>>>>>> ReferenceError: oa is not defined verovio-toolkit-light.js:43:9036
>>>>>>> <http://localhost:4001/javascript/develop/verovio-toolkit-light.js>
>>>>>>> ReferenceError: oa is not defined verovio-toolkit-light.js:43:9046
>>>>>>> <http://localhost:4001/javascript/develop/verovio-toolkit-light.js>
>>>>>>> Error: abort(ReferenceError: oa is not defined). Build with -s
>>>>>>> ASSERTIONS=1 for more info.
>>>>>>> TypeError: Module.asm.vrvToolkit_constructor is undefined
>>>>>>> verovio-toolkit-light.js:43:85119
>>>>>>> <http://localhost:4001/javascript/develop/verovio-toolkit-light.js>
>>>>>>>     _vrvToolkit_constructor
>>>>>>> http://localhost:4001/javascript/develop/verovio-toolkit-light.js:43
>>>>>>>     toolkit
>>>>>>> http://localhost:4001/javascript/develop/verovio-toolkit-light.js:
>>>>>>> 135
>>>>>>>     <anonymous> http://localhost:4001/midi.xhtml:111
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> 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 [email protected].
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/emscripten-discuss/9619c413-0463-427e-ae26-27c41942466d%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/9619c413-0463-427e-ae26-27c41942466d%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>>>> 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 [email protected].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/emscripten-discuss/6fe85c54-f3a2-44c6-bb2c-26002a3e14ef%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/6fe85c54-f3a2-44c6-bb2c-26002a3e14ef%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>> 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 [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/emscripten-discuss/119cb9f8-7c60-49e7-b60a-48271818bcc5%40googlegroups.com
>>> <https://groups.google.com/d/msgid/emscripten-discuss/119cb9f8-7c60-49e7-b60a-48271818bcc5%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/6e9cba9b-9896-492e-9724-1941f38d8ab2%40googlegroups.com
> <https://groups.google.com/d/msgid/emscripten-discuss/6e9cba9b-9896-492e-9724-1941f38d8ab2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpT_BT-xkMmKLpsR9kYy2_vQb7wMz7ySBm1nr9_1TLcZjQ%40mail.gmail.com.

Reply via email to