Skip to content

[tensorflow gpu] build tensorflow shared library for C & apply it

HyoungJoo Ahn edited this page Mar 12, 2019 · 3 revisions

environment

  • ubuntu 18.04
  • nvidia 418
  • cuda 9.0
  • cudnn 7.3.1
  • bazel 0.18.0
  • GeForce GTX 1080

build tensorflow shared library for C++

tensorflow$ bazel build //tensorflow:libtensorflow_cc.so

below 2 .so files are generated

libtensorflow_cc.so
libtensorflow_framework.so

how to apply

It's simply applied with cmake for instance

link_libraries(
  ${PATH_TO_LIB}/libtensorflow_cc.so
  ${PATH_TO_LIB}/libtensorflow_framework.so
  )

Clone this wiki locally