You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tvm.apache.org by wZuck via Apache TVM Discuss <no...@discuss.tvm.ai> on 2022/02/28 09:41:50 UTC

[Apache TVM Discuss] [Development] [BYOC] how to link extern .so files


Hi, I followed the BYOC tutorial and inserted some op functions of my compute library. When my op can run without any extern .so files, I found it works well. But if a op function relays on an extern .so library, TVM reports this error:
```
python: symbol lookup error: /home/.../dense.so: undefined symbol: extern_func_symbol
```
I have tried to add compile flags in `lib.export_library("./dense.so", options = "-std=c++11 -Lxxxxx")
`, but TVM reports `g++: error: unrecognized command line option ‘-std=c++11 -Lxxxxx’`

How can I fix it?





---
[Visit Topic](https://discuss.tvm.apache.org/t/byoc-how-to-link-extern-so-files/12186/1) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/0dfcc07bd7bfa275356c91c5c38d1e5e2c5950be98b1a4f1808c8d3daa1becdc).

[Apache TVM Discuss] [Development] [BYOC] how to link extern .so files

Posted by masahi via Apache TVM Discuss <no...@discuss.tvm.ai>.

You can take a look at how we integrate DNNL (aka oneDNN). I think you need to link your `*.so` file to `libtvm.so` or `libtvm_runtime.so`. cc @comaniac





---
[Visit Topic](https://discuss.tvm.apache.org/t/byoc-how-to-link-extern-so-files/12186/2) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/88019aaef0fbbacdb7790b229657dc95f225e1f84724c19b8edfc3ecf0b52912).

[Apache TVM Discuss] [Development] [BYOC] how to link extern .so files

Posted by Zihao Ye via Apache TVM Discuss <no...@discuss.tvm.ai>.

try add the following line to `CMakeLists.txt`:

```
target_link_libraries(tvm PRIVATE ${PATH_TO_YOUR_SHARED_LIBRARY})
target_link_libraries(tvm_runtime PRIVATE ${PATH_TO_YOUR_SHARED_LIBRARY})
```

and rebuild TVM.





---
[Visit Topic](https://discuss.tvm.apache.org/t/byoc-how-to-link-extern-so-files/12186/4) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/b1ddf99b702eb1b2dd88b7b0d899768a04647a754041905b4b62905416255e67).

[Apache TVM Discuss] [Development] [BYOC] how to link extern .so files

Posted by "Cody H. Yu via Apache TVM Discuss" <no...@discuss.tvm.ai>.

The way you use is for static link for the generated code why the error is for dynamic link. As @masahi pointed out, you should link your .so to TVM, which means you may need to add this library to the TVM building process.





---
[Visit Topic](https://discuss.tvm.apache.org/t/byoc-how-to-link-extern-so-files/12186/3) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/18c3b04031069c1dd3c95b77654675a74c45a2a51145faa3fbe031845826cabb).