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

use static library #36

Open
ruben-sch opened this issue Nov 19, 2020 · 1 comment
Open

use static library #36

ruben-sch opened this issue Nov 19, 2020 · 1 comment

Comments

@ruben-sch
Copy link

tensorflow provides scripts to build static tf lite libraries:
tflite make scripts

Are there plans to support .a files additionally to the .so files build with bazel?

@lugiger
Copy link

lugiger commented Nov 27, 2020

I was able to make it run this on a rpi zero by renaming the generated static library libtensorflow-lite.a to libtensorflowlite_c.a and link to that.
I also had to link -lm and -lstdc++. Here is the build command I used:

CGO_CFLAGS=-I/source/directory/tensorflow CGO_LDFLAGS="-w -s -L$(pwd)/lib -Wl,-rpath,$(pwd)/lib -lstdc++ -lm" go build -o mylib.so -buildmode=c-shared .

In this case, the libtensorflowlite_c.a has to be located in ./lib.

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