Skip to content

Commit

Permalink
move lib out of dedicated folder in /usr/local/lib
Browse files Browse the repository at this point in the history
helps the linker to automatically find the library
  • Loading branch information
lreiher committed Oct 19, 2022
1 parent 6039334 commit 98db1bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ COPY --from=build /tensorflow/bazel-bin/tensorflow/lib usr/local/lib/tensor
COPY --from=build /usr/local/bin/protoc usr/local/bin/protoc
COPY --from=build /usr/local/include/google usr/local/include/google
COPY --from=build /usr/local/lib usr/local/lib/protobuf
RUN cp -d usr/local/lib/protobuf/lib* usr/local/lib/ && \
rm -rf usr/local/lib/protobuf
RUN cp -d usr/local/lib/tensorflow/lib* usr/local/lib/protobuf/lib* usr/local/lib/ && \
rm -rf usr/local/lib/tensorflow usr/local/lib/protobuf
RUN sed -i "s/TF_VERSION/$TF_VERSION/" DEBIAN/control

# build .deb
Expand Down
8 changes: 3 additions & 5 deletions example/build-and-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ set -e

g++ -I /usr/local/include/tensorflow \
hello_tensorflow.cpp \
-o hello_tensorflow \
-Wl,-rpath,/usr/local/lib/tensorflow:/usr/local/lib \
/usr/local/lib/tensorflow/libtensorflow_cc.so \
/usr/local/lib/libprotobuf.so
-ltensorflow_cc -lprotobuf \
-o hello_tensorflow

./hello_tensorflow
./hello_tensorflow

0 comments on commit 98db1bb

Please sign in to comment.