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

265 views
Skip to first unread message

sangeeta chowdhary via llvm-dev

unread,
Dec 18, 2020, 8:35:09 AM12/18/20
to LLVM Developers Mailing List
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

sangeeta chowdhary via llvm-dev

unread,
Feb 22, 2021, 6:06:39 PM2/22/21
to LLVM Developers Mailing List
Any suggestions or pointers?

Mehdi AMINI via llvm-dev

unread,
Feb 22, 2021, 6:21:31 PM2/22/21
to sangeeta chowdhary, LLVM Developers Mailing List
Hi,

This looks like a question for the numba folks: some of the symbols here as provided by the numba runtime.

-- 
Mehdi


_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply all
Reply to author
Forward
0 new messages