Sorted this in the end.. digging a bit deeper revealed the problem 
eventually, in the CLAPACK library some function declarations returned int 
when the implenentation (in the f2c library) had them returning void.

On Monday, July 26, 2021 at 2:57:29 PM UTC+1 nickw wrote:

>
> To follow up on this and give a little more info, the function causing the 
> problem in CLAPACK is the dgesvd_() function within file dgesvd.c
>
> Unusual (to my eyes) coding styles from this auto-generated code include 
> function declarations within the body of another function, something I have 
> not encountered before.
>
> On Monday, July 26, 2021 at 2:50:26 PM UTC+1 nickw wrote:
>
>>
>> Hi,
>>
>> I am investigating using Emscripten to provide a web interface to an 
>> augmented reality system,. PTAM (https://www.robots.ox.ac.uk/~gk/PTAM/)
>>
>> I have written a small test application which just initialises the 
>> library. At the link stage I get this error:
>>
>> ```
>> [ 50%] Linking CXX executable ptam_wasm.js
>> [parse exception: attempted pop from empty stack / beyond block start 
>> boundary at 122228 (at 0:122228)]
>> Fatal: error in parsing input
>> em++: error: '/home/nick/src/emsdk/upstream/bin/wasm-emscripten-finalize 
>> --minimize-wasm-changes --dyncalls-i64 ptam_wasm.wasm -o ptam_wasm.wasm 
>> --detect-features' failed (returned 1)
>> CMakeFiles/ptam_wasm.dir/build.make:112: recipe for target 'ptam_wasm.js' 
>> failed
>> make[2]: *** [ptam_wasm.js] Error 1
>> CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ptam_wasm.dir/all' 
>> failed
>> make[1]: *** [CMakeFiles/ptam_wasm.dir/all] Error 2
>> Makefile:83: recipe for target 'all' failed
>> make: *** [all] Error 2
>> emmake: error: 'make' failed (returned 2)
>> ```
>>
>> This error appears to have been reported occasionally at other times, but 
>> without a definite cause other than Emscripten trying to deal with code 
>> which it cannot process.
>>
>> Doing a bit of analysis to locate the problem by commenting out the PTAM 
>> code until I find a call which produces the error when uncommented and not 
>> when commented, I find that a function in the CLAPACK library (C conversion 
>> of maths library LAPACK) is the source of the problem. 
>>
>> CLAPACK is C code auto-generated from Fortran (
>> http://www.netlib.org/clapack/)
>>
>> Looking at the code, it seems somewhat non-standard in style, being 
>> autogenerated by `f2c`.
>>
>> Does emscripten have a known problem with this type of code? Has anyone 
>> else tried using emscripten with CLAPACK?
>>
>> Thanks,
>> Nick
>>
>>
>>

-- 
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/1b09fe1b-8d5d-4bed-a506-4f879e494619n%40googlegroups.com.

Reply via email to