If I compile this code in emscripten_test.c:

#include <complex.h>

int main(int arc, char **argv) {
    double complex a, b, c;
    a = 2.0+3.0*I;
    b = 3.0+4.0*I;
    c = a * b;
    c = a / b;
    return 0;
}

Then compile with the command:

emcc emscripten_test.c -o emscripten_test.js

The output is:

warning: unresolved symbol: __divdc3
warning: unresolved symbol: __muldc3

Then run the output with nodejs or serve up this HTML using python:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>test</title>
  </head>
  <body>
    <script src="emscripten_test.js"></script>
  </body>
</html>

I get this output in the Firefox console:

pre-main prep time: 3 ms emscripten_test.js:146:7
missing function: __divdc3 emscripten_test.js:146:7
uncaught exception: abort(-1) at 
jsStackTrace@http://localhost:8000/emscripten_test.js:1173:13
stackTrace@http://localhost:8000/emscripten_test.js:1190:22
abort@http://localhost:8000/emscripten_test.js:9893:44
___divdc3@http://localhost:8000/emscripten_test.js:1788:53
_main@http://localhost:8000/emscripten_test.js:5903:1
asm._main@http://localhost:8000/emscripten_test.js:9668:8
callMain@http://localhost:8000/emscripten_test.js:9758:15
doRun@http://localhost:8000/emscripten_test.js:9816:42
run@http://localhost:8000/emscripten_test.js:9830:5
@http://localhost:8000/emscripten_test.js:9919:1
 <unknown>
-1 emscripten_test.js:143:7
-1 emscripten_test.js:146:7

The output from $ emcc --version:

emcc (Emscripten gcc/clang-like replacement) 1.34.12 ()
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE.

On Wednesday, October 14, 2015 at 8:39:24 PM UTC+2, Alon Zakai wrote:
>
> Is the code sample above what you are building? And with what command?
>
> On Wed, Oct 14, 2015 at 4:56 AM, Richard Lincoln <[email protected] 
> <javascript:>> wrote:
>
>> I have updated to version 1.34.12 (it takes 2h15m on this old machine) 
>> but I still get the same error.  I got the message that libc was updated:
>>
>> INFO:root:(Emscripten: Running sanity checks)
>> WARNING:root:generating system library: libc.bc...
>> WARNING:root:                                     ok
>> WARNING:root:generating system library: dlmalloc.bc...
>> WARNING:root:                                         ok
>>
>> On Wednesday, October 14, 2015 at 1:54:48 AM UTC+2, Alon Zakai wrote:
>>>
>>> I don't see the problem on 1.34.12. We updated our libc quite a bit 
>>> between those revisions, so I suggest trying the incoming branch.
>>>
>>> On Tue, Oct 13, 2015 at 2:59 PM, Richard Lincoln <[email protected]> 
>>> wrote:
>>>
>>>> Interestingly, on execution complex multiplication works as expected.  
>>>> It is only complex division that produces an error:
>>>>
>>>> missing function: __divdc3
>>>>
>>>> Can anyone reproduce this result?
>>>>
>>>>
>>>> On Tuesday, October 13, 2015 at 9:02:11 PM UTC+2, Richard Lincoln wrote:
>>>>>
>>>>> I receive these two warnings when compiling code with complex number 
>>>>> multiplication and division:
>>>>>
>>>>> warning: unresolved symbol: __divdc3
>>>>> warning: unresolved symbol: __muldc3
>>>>>
>>>>> I can reproduce the message by compiling this:
>>>>>
>>>>> #include <complex.h>
>>>>>
>>>>> void cdiv() {
>>>>>     double complex a, b, c;
>>>>>     a = 2.0+3.0*I;
>>>>>     b = 3.0+4.0*I;
>>>>>     c = a / b;
>>>>>     c = a * b;
>>>>> }
>>>>>
>>>>> The message is received using emcc 1.34.1.  If I change the type to float 
>>>>> complex I get:
>>>>>
>>>>> warning: unresolved symbol: __mulsc3
>>>>> warning: unresolved symbol: __divsc3
>>>>>
>>>>> Is there a library that I should be linking to?  Perhaps something is 
>>>>> missing from Emscripten.  Should I create an issue for this?
>>>>>
>>>>> Regards,
>>>>> Richard
>>>>>
>>>> -- 
>>>> 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].
>>>> 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 [email protected] <javascript:>.
>> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to