ITADN

Assertion failed: native function Highs_getModelStatus called with 2 args but expects 1

#42Openfacundosw 创建于 2024-12-19
F
facundoswcommented
We got this error, `Assertion failed: native function Highs_getModelStatus called with 2 args but expects 1` , when running the model. To get the error message we compiled highs with the following flags in the build.sh file `emcc -O0 \ -s EXPORTED_FUNCTIONS="@$root/exported_functions.json" \ -s EXPORTED_RUNTIME_METHODS="['cwrap']" \ -s MODULARIZE=1 \ -s ALLOW_MEMORY_GROWTH=1 \ -s ASSERTIONS \ -s STACK_SIZE=1mb \ -flto \ --closure 1 \ --pre-js "$root/src/pre.js" \ --post-js "$root/src/post.js" \ lib/*.a -o highs.js` After getting the error we made changes in the src\post.js file, deleting references to a second parameter. These changes made the error message disappear. [line 57](https://github.com/lovasoa/highs-js/blob/91461be708d109c973cbcf3c8085c3e191ab6b70/src/post.js#L57) `/** @type {(arg0:Highs)=>(keyof (typeof MODEL_STATUS_CODES))} */ _Highs_getModelStatus,` [line 92](https://github.com/lovasoa/highs-js/blob/91461be708d109c973cbcf3c8085c3e191ab6b70/src/post.js#L92C1-L92C70) ` MODEL_STATUS_CODES[_Highs_getModelStatus(highs)] || "Unknown";` ![image](https://github.com/user-attachments/assets/f9e419bb-2052-4a31-865f-590905ffb7ed)
1 条评论