undefined symbol: createInferRuntime_INTERNAL

I am building a C++ app that uses Tensorflow. Because I am using the C++ API of TF I can’t use a precompiled wheel. So, I have built TF 1.15-rc2 (git version) on my own with TRT support enabled. After that I load dynamically the libtrt_op_kernels.so and get the following error: undefined symbol: createInferRuntime_INTERNAL
I checked other posts in the forum and looked for nvinfer. Grep finds a symbol in libnvinfer:

nvidia@xavier-97:/usr$ sudo find -type f -name ".so" -exec grep createInferRuntime_INTERNAL {} \;
Binary file ./lib/aarch64-linux-gnu/libnvinfer.so.5.1.6 matches


nvidia@xavier-97:/usr$ nm /usr/lib/aarch64-linux-gnu/libnvinfer.so.5.1.6
nm: /usr/lib/aarch64-linux-gnu/libnvinfer.so.5.1.6: no symbols

I have added -lnvinfer to the Makefile of my app to no avail. What am I doing wrong?

With TF 1.10, 1.12 and 1.14 I had no such problem. Maybe TF started using this functionality pretty recently.


any help?

I have the same problem when compiling against Tensorflow 2.0.0 . Again missing symbol although I have added -lnvinfer to my Makefile and it links without problems.

I have tried adding LD_PRELOAD in front of the command line when executing and then I get no error. Now the question is what I am doing wrongly…