lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.37k stars 156 forks source link

[Bug] `_lfortran_caimag` and `_lfortran_zaimag` is defined as `@ccall` but is not defined anywhere #2703

Closed Vipul-Cariappa closed 1 month ago

Vipul-Cariappa commented 1 month ago

A bug arises when using the modulo operator with the interactive shell. LLVM jit cannot find _lfortran_caimag and _lfortran_zaimag functions. I used grep to find any definition of the two functions but I did not find any. I believe the functions are not required.

Example to replicate:

>>> print(2 % 3)
JIT session error: Symbols not found: [ _lfortran_zaimag, _lfortran_caimag ]
< Stack Track ... >

You will find that they are declared at https://github.com/lcompilers/lpython/blob/8773842fffae1f202b2fed4b34003992e44b8e0a/src/runtime/lpython_builtin.py#L438-L444.