Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `getEmbeddedConstPool' #303

Open
ArunaKote opened this issue Sep 16, 2020 · 2 comments
Open

undefined reference to `getEmbeddedConstPool' #303

ArunaKote opened this issue Sep 16, 2020 · 2 comments

Comments

@ArunaKote
Copy link

I converted ONNX to MLIR using onnx-mlir --EmitMLIR.
I added main function to pass input to graph and print statement to print the output of graph.
Then I lowered LLVM Dialect using onnx-mlir-opt --convert-krnl-to-llvm and.onnx.mlir>n1.mlir.
Lowered to LLVM IR using mlir-translate --mlir-to-llvmir n1.mlir>n2.ll
the I ran the .ll file using clang n2.ll "pathto"/libmlir_runner_utils.so -o main -lm
/usr/bin/ld: /tmp/n2-dacb78.o: in function main_graph': undefined reference to getEmbeddedConstPool'
/usr/bin/ld: /tmp/n2-dacb78.o: in function _dyn_entry_point_main_graph': undefined reference to getRtMemRef'
undefined reference to getData' undefined reference to getSizes'
undefined reference to getStrides' undefined reference to createOrderedRtMemRefDict'
undefined reference to createRtMemRef' undefined reference to setData'
undefined reference to setDType' undefined reference to getSizes'
undefined reference to getStrides' undefined reference to setRtMemRef'

I am getting error like above.
How can I solve this?

Thank you

@doru1004
Copy link
Collaborator

You are not linking with the library where those functions are defined i.e. RtMemRefUtils

It would be much easier if you compile your code using onnx-mlir all the way to LLVM, compile the LLVM as a shared object and then just call the model function from inside a C/C++ main function.

@ArunaKote
Copy link
Author

Thank You. If I link RtMemRefUtils Iam still getting error as:
undefined reference to getEmbeddedConstPool'
To resolve this I tried creating a shared object of onnx-mlir/src/Runtime/GetEmbeddedConstPool.cpp and linking while compiling but I am getting error like:
onnx-mlir/src/Runtime/liblibrary.so: undefined reference to _binary_param_bin_start' onnx-mlir/src/Runtime/liblibrary.so: undefined reference to _binary_param_bin_end'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants