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

TensorFlow lite compilation error under Ubuntu 22.04.4 LTS #65222

Closed
saad-koukous opened this issue Apr 8, 2024 · 2 comments
Closed

TensorFlow lite compilation error under Ubuntu 22.04.4 LTS #65222

saad-koukous opened this issue Apr 8, 2024 · 2 comments
Assignees
Labels

Comments

@saad-koukous
Copy link

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

source

TensorFlow version

2.10.0baz

Custom code

Yes

OS platform and distribution

Ubuntu 22.04.4 LTS

Mobile device

No response

Python version

No response

Bazel version

bazel 6.5.0

GCC/compiler version

gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

I built the tflite library using bazel and i'm just trying to test if it work but can't compile

Standalone code to reproduce the issue

#include <stdio.h>
#include "tensorflow/lite/c/c_api.h"

int main() {

  printf("Hello from TensorFlow C library version %s\n", TfLiteExtensionApisVersion());

  return 0;

}

Relevant log output

gcc -o hello_tf hello_tf.c -I. -Llib/tensorflow/lite -ltensorflowlite

/usr/bin/ld: /tmp/ccynBol8.o: in function `main':

hello_tf.c:(.text+0x9): undefined reference to `TfLiteExtensionApisVersion'

collect2: error: ld returned 1 exit status
@saad-koukous
Copy link
Author

1-Clone the TensorFlow Lite repository.
2-Build the library using this command: bazel build -c opt //tensorflow/lite/c:libtensorflowlite_c.so.
3-Copy libtensorflowlite_c.so to your folder from bazel-bin/tensorflow/lite/c/.
4-Compile: gcc -o hello_tf hello_tf.c -I. -Llib/tensorflow/lite -ltensorflowlite_c.
5-Copy and paste your dynamic library to /usr/lib: sudo cp lib/tensorflow/lite/libtensorflowlite_c.so /usr/lib.
6-Almost done: ./hello_tf.

Copy link

Are you satisfied with the resolution of your issue?
Yes
No

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

No branches or pull requests

2 participants