[llvm-dev] How to execute LLVM IR code generated from Python source code using numba

sangeeta chowdhary via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 18 05:34:49 PST 2020


Hello Everyone,

I am trying to generate llvm IR from python and then execute it. I used
numba to generate llvm IR. While linking I am getting some undefined
references. I am not sure which python packages I need to load to resolve
this issue. If someone can help me I would appreciate it. If there is any
other way to get llvm IR from python, please let me know.

#   numba test.py --dump-llvm > test.ll
# llvm-as test.ll –o test.bc

# llc test.bc -filetype=obj -o test.c.o

# clang -pg test.c.o -o test.o

test.ll:(.text+0x631): undefined reference to `numba_gil_ensure'

test.ll:(.text+0x643): undefined reference to `numba_unpickle'

test.ll:(.text+0x64e): undefined reference to `PyObject_Str'

test.ll:(.text+0x659): undefined reference to `PyUnicode_AsUTF8'

test.ll:(.text+0x668): undefined reference to `PySys_WriteStdout'

test.ll:(.text+0x670): undefined reference to `Py_DecRef'

test.ll:(.text+0x678): undefined reference to `Py_DecRef'

test.ll:(.text+0x684): undefined reference to `PySys_WriteStdout'


Regards,

Sangeeta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201218/1cf22c58/attachment.html>


More information about the llvm-dev mailing list